-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SCALRCORE-31246: Add RunScheduleRule resource #323
Conversation
27d303f
to
30e3ebe
Compare
@@ -95,7 +95,7 @@ go mod edit -dropreplace github.com/scalr/go-scalr | |||
|
|||
To update the go-scalr version: | |||
```sh | |||
go get github.com/scalr/go-scalr@develop | |||
go get github.com/scalr/go-scalr@master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Required: true, | ||
}, | ||
"schedule_mode": { | ||
Description: "Mode of the scheduled run. (\"apply\", \"destroy\", \"refresh\")", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: "Mode of the scheduled run. (\"apply\", \"destroy\", \"refresh\")", | |
Description: "Mode of the scheduled run (\"apply\", \"destroy\", \"refresh\").", |
|
||
// Get and check the workspace. | ||
if workspaceID, ok := d.GetOk("workspace_id"); ok { | ||
ws, err := scalrClient.Workspaces.ReadByID(ctx, workspaceID.(string)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Provider should not be doing this validation, it's an API responsibility
workspace_id
is a required attribute, there is no need ind.GetOk()
check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Provider should not be doing this validation, it's an API responsibility
@lyzohub The request is still there.
id := d.Id() | ||
if d.HasChange("schedule") || d.HasChange("schedule_mode") { | ||
opts := scalr.RunScheduleRuleUpdateOptions{ | ||
ID: id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would skip setting ID
here to avoid confusion — keep only updatable attributes.
go.sum
Outdated
github.com/scalr/go-scalr v0.0.0-20240620130121-1e510532b379 h1:MP3OOBJmXwNRM0vv2ocrio+Q06+zMF9CtfuPgaoO7Qk= | ||
github.com/scalr/go-scalr v0.0.0-20240620130121-1e510532b379/go.mod h1:p34SHb25YRvbgft7SUjSDYESeoQhWzAlxGXId/BbaSE= | ||
github.com/scalr/go-scalr v0.0.0-20240621143826-3720e9e9274f h1:qwB5rLRDA6alyD/Yg3ln57FBJNejRdHJd+9VaB9lRcE= | ||
github.com/scalr/go-scalr v0.0.0-20240621143826-3720e9e9274f/go.mod h1:p34SHb25YRvbgft7SUjSDYESeoQhWzAlxGXId/BbaSE= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run go mod tidy
to clean up the old hashes.
038c4e4
to
79de1a4
Compare
Changelog
Documentation
State