Skip to content

Commit

Permalink
Merge pull request #14 from fabi200123/json-schema
Browse files Browse the repository at this point in the history
 Adding unit-tests and json schema validation
  • Loading branch information
gabriel-samfira authored May 20, 2024
2 parents b915449 + e067ade commit 63cce58
Show file tree
Hide file tree
Showing 459 changed files with 17,693 additions and 3,829 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Go Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
go-tests-linux:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version-file: go.mod

- run: go version

- name: Run GARM Go Tests
run: make go-test

go-tests-windows:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version-file: go.mod

- run: go version

- name: Run GARM Go Tests
run: go test -tags testing -v ./... -timeout=15m -parallel=4
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Garm supports sending opaque json encoded configs to the IaaS providers it hooks
To this end, this provider supports the following extra specs schema:

```json

{
"$schema": "http://cloudbase.it/garm-provider-openstack/schemas/extra_specs#",
"type": "object",
Expand Down Expand Up @@ -65,16 +66,21 @@ To this end, this provider supports the following extra specs schema:
},
"enable_boot_debug": {
"type": "boolean",
"description": "Enable cloud-init debug mode. Adds `set -x` into the cloud-init script."
"description": "Enable cloud-init debug mode. Adds 'set -x' into the cloud-init script."
},
"allow_image_owners": {
"allowed_image_owners": {
"type": "array",
"items": {
"type": "string"
},
"description": "A list of image owners to allow when creating the instance. If not specified, all images will be allowed."
}
}
},
"image_visibility": {
"type": "string",
"description": "The visibility of the image to use."
}
},
"additionalProperties": false
}
```

Expand Down
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ func (o *OpenstackClient) StartServer(nameOrID string) error {
}

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

return nil
Expand Down
Loading

0 comments on commit 63cce58

Please sign in to comment.