-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feat: add update_window to workspace_group for create/update #20
base: master
Are you sure you want to change the base?
Feat: add update_window to workspace_group for create/update #20
Conversation
a2d3d84
to
a4e0f2c
Compare
Getting the following error when applying and assume it is because the API might not be returning
|
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.
Hi Phil,
Thank you for creating the MR that adds the update window functionality to the workspace group resource!
The current state of the MR is a solid foundation.
-
Our team is working on setting update window details on the creation of a workspace group and this MR is blocked on the feature because, otherwise, the behavior of the provider is not consistent. E.g., an operator indicates Sunday yet gets a random day and overrides the random day only on the second
terraform apply
run. I'll make sure to notify you once the functionality is ready. -
The MR only implements updating the state, yet does not implement reading the state from remote. The function
toWorkspaceGroupResourceModel
is the relevant converter that should be changed. It's essential to provide proper reading as it will enable the proper resolution of deltas. -
By the convention of the current repository, almost all the functionality is covered by unit and integration tests. Make sure to extend the MR with both unit and integration tests. Note that it would be enough to extend tests that already exist.
Best,
Nestor
P.S. After resolving the comments, #20 (comment) should disappear. The error is because of the provider never forwards the hour and day that is read from the Management API (2).
The updateWindow input for a workspace group creation is now live. Moreover, the latest version of the Golang client for the Management API is pulled to this repo. |
…space-group-resource
Has the operator code been deployed yet? Began adjusting tests and still receive a random day/hour. |
Yes. The current version of the PR does not pass day and hour as input. This is a possible reason for the confusion. I've just verified that all works fine with a curl -X POST "https://api.singlestore.com/v1/workspaceGroups" -H "accept: application/json" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d "{\"adminPassword\":\"qw5erASDF19\",\"firewallRanges\":[],\"name\":\"demo-workspace-group\",\"regionID\":\"7e7ffd27-20f7-44b6-87e6-e72828a81ac7\", \"updateWindow\":{\"day\":1,\"hour\":2}}"
{"workspaceGroupID":"936580ff-215f-4e43-b0bd-2ec1a5561ddc"}
curl -X GET "https://api.singlestore.com/v1/workspaceGroups" -H "accept: application/json" -H "Authorization: Bearer $API_KEY"
[{"name":"demo-workspace-group","state":"PENDING","workspaceGroupID":"936580ff-215f-4e43-b0bd-2ec1a5561ddc","createdAt":"2023-07-07T14:53:57.007404Z","regionID":"7e7ffd27-20f7-44b6-87e6-e72828a81ac7","updateWindow":{"hour":2,"day":1}}] Note that |
aaedb62
to
5235ab1
Compare
fb5daec
to
de7b714
Compare
Codecov Report
@@ Coverage Diff @@
## master #20 +/- ##
==========================================
- Coverage 73.56% 73.54% -0.02%
==========================================
Files 18 18
Lines 1528 1561 +33
==========================================
+ Hits 1124 1148 +24
- Misses 335 341 +6
- Partials 69 72 +3
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@noprysk-ua , went ahead and updated the tests. I can also test the helper functions |
No description provided.