Skip to content

Commit 63cce58

Browse files
Merge pull request #14 from fabi200123/json-schema
Adding unit-tests and json schema validation
2 parents b915449 + e067ade commit 63cce58

459 files changed

Lines changed: 17693 additions & 3829 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/go-tests.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Go Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
go-tests-linux:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Setup Golang
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version-file: go.mod
23+
24+
- run: go version
25+
26+
- name: Run GARM Go Tests
27+
run: make go-test
28+
29+
go-tests-windows:
30+
runs-on: windows-latest
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
36+
- name: Setup Golang
37+
uses: actions/setup-go@v3
38+
with:
39+
go-version-file: go.mod
40+
41+
- run: go version
42+
43+
- name: Run GARM Go Tests
44+
run: go test -tags testing -v ./... -timeout=15m -parallel=4

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Garm supports sending opaque json encoded configs to the IaaS providers it hooks
3232
To this end, this provider supports the following extra specs schema:
3333

3434
```json
35+
3536
{
3637
"$schema": "http://cloudbase.it/garm-provider-openstack/schemas/extra_specs#",
3738
"type": "object",
@@ -65,16 +66,21 @@ To this end, this provider supports the following extra specs schema:
6566
},
6667
"enable_boot_debug": {
6768
"type": "boolean",
68-
"description": "Enable cloud-init debug mode. Adds `set -x` into the cloud-init script."
69+
"description": "Enable cloud-init debug mode. Adds 'set -x' into the cloud-init script."
6970
},
70-
"allow_image_owners": {
71+
"allowed_image_owners": {
7172
"type": "array",
7273
"items": {
7374
"type": "string"
7475
},
7576
"description": "A list of image owners to allow when creating the instance. If not specified, all images will be allowed."
76-
}
77-
}
77+
},
78+
"image_visibility": {
79+
"type": "string",
80+
"description": "The visibility of the image to use."
81+
}
82+
},
83+
"additionalProperties": false
7884
}
7985
```
8086

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ func (o *OpenstackClient) StartServer(nameOrID string) error {
450450
}
451451

452452
if err := startstop.Start(o.compute, srv.ID).ExtractErr(); err != nil {
453-
return fmt.Errorf("failed to stop server: %w", err)
453+
return fmt.Errorf("failed to start server: %w", err)
454454
}
455455

456456
return nil

0 commit comments

Comments
 (0)