-
Notifications
You must be signed in to change notification settings - Fork 43
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(cloud): implement CRUD functions for Kubernetes cloud resource #598
feat(cloud): implement CRUD functions for Kubernetes cloud resource #598
Conversation
f861c1a
to
a5cafb4
Compare
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.
The PR description does not match the code. Import, Read and Delete were also implemented.
cloud, err := o.client.Clouds.ReadKubernetesCloud( | ||
&juju.ReadKubernetesCloudInput{ | ||
Name: plan.CloudName.ValueString(), | ||
KubernetesConfig: plan.KubernetesConfig.ValueString(), | ||
}, | ||
) |
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.
issue: Import will not work if Read is implemented this way. You have to get the name from the ID.
ee55703
to
988feb7
Compare
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.
Left some comments, am trying some QA now!
b96479c
to
74e8d91
Compare
ctlr := s.setupMocks(s.T()) | ||
defer ctlr.Finish() | ||
|
||
s.mockKubernetesCloudClient.EXPECT().AddCloud(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() |
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.
Should check some of the input to ensure it's correct.
return errors.Trace(err) | ||
} | ||
|
||
err = kubernetesAPIClient.UpdateCloud(newCloud) |
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'm wondering if the created credential will need an update too?
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.
Hmm... and what is your suggestion? to take credentials from the state and compare?
232a4c8
to
8da2f56
Compare
d63c33b
to
44b5a11
Compare
60cf3b8
to
351f4d3
Compare
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.
Thanks for all the work @anvial!
/merge |
- Added `CreateKubernetesCloud` method in `kubernetesCloudsClient` to handle the creation of Kubernetes clouds. - Integrated the new method into the Terraform provider's kubernetes resouce `Create` function in `kubernetesCloudResource`. - Updated the schema and model to include necessary attributes for Kubernetes cloud creation.
… resource - Added `Read` function in `kubernetesCloudResource` to handle reading the current state of the Kubernetes cloud. - Implemented `Delete` function in `kubernetesCloudResource` to handle the removal of Kubernetes clouds. - Integrated the new methods into the Terraform provider's resource lifecycle. - Updated the schema and model to ensure proper state management during read and delete operations.
- Added `Update` function in `kubernetesCloudResource` to handle updating the Kubernetes cloud. - Integrated the new method into the Terraform provider's resource lifecycle. - Updated the schema and model to ensure proper state management during update operations.
Combine into one step and do not test for a condition not found in this job.
7b0e404
to
fd816d3
Compare
I had to do one last force push to sign one of the commits, merge was failing otherwise. |
/merge |
Description
kubernetesCloudsClient
to handle the creation of Kubernetes clouds.kubernetesCloudResource
.Type of change
Environment
Juju controller version:
Terraform version:
QA steps