forked from guido9j/terraform-provider-spinnaker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Enhancements to Spinnaker application resource: - Add support for cloud providers - Add support for permissions - Implemented Update method - Improved error messages for Spinnaker application Co-authored-by: James Guido <[email protected]>
- Loading branch information
Showing
14 changed files
with
149 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ https://spinnaker.io/concepts/ | |
$ git clone [email protected]:homedepot/terraform-provider-spinnaker.git | ||
$ cd terraform-provider-spinnaker/ | ||
$ go build | ||
$ go test./... | ||
$ go test ./... | ||
``` | ||
|
||
## Using the provider | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,12 +15,30 @@ resource "spinnaker_application" "terraformtest" { | |
} | ||
``` | ||
|
||
```hcl | ||
resource "spinnaker_application" "terraformtest" { | ||
application = "terraformtest" | ||
email = "[email protected]" | ||
cloud_providers = [ | ||
"kubernetes", | ||
"appengine" | ||
] | ||
permissions { | ||
read = [ "group1", "group2", "group3" ] | ||
write = [ "group1" ] | ||
execute = [ "group1", "group2" ] | ||
} | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
- `application` - (Required) Spinnaker application name. | ||
- `email` - (Required) Application owner email. | ||
- `description` - (Optional) Description. (Default: `""`) | ||
- `platform_health_only` - (Optional) Consider only cloud provider health when executing tasks. (Default: `false`) | ||
- `platform_health_only_show_override` - (Optional) Show health override option for each operation. (Default: `false`) | ||
- `cloud_providers` - (Optional) Array list of cloud providers. | ||
- `permissions` - (Optional) Array of permissions in key/value pairs. Valid permission keys are `read`, `write` and `execute`. Permission value is array list of groups. | ||
|
||
## Attribute Reference |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/guido9j/terraform-provider-spinnaker | ||
module terraform-provider-spinnaker | ||
|
||
go 1.18 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package api | ||
|
||
import ( | ||
"fmt" | ||
gate_swagger "github.com/spinnaker/spin/gateapi" | ||
) | ||
|
||
func FormatAPIErrorMessage(function_name string, err error) error { | ||
switch err_sw := err.(type) { | ||
case gate_swagger.GenericSwaggerError: | ||
return fmt.Errorf("%s: %s() response payload: %s", err_sw.Error(), function_name, err_sw.Body()) | ||
} | ||
return fmt.Errorf("%s: From %s()", err, function_name) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.