-
Notifications
You must be signed in to change notification settings - Fork 55
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
[FEATURE] Make saving kubeconfig to state optional when creating a civo_kubernetes resource #296
Comments
Hi @uzaxirr Hope you are doing fine. I worked on this issue and would like to explain my approach for your review. For this, I added a and since the update in state of a resource after creation/modification happens in And as evident below, It correctly hides the Post these changes, resource creation/update/deletion goes through as usual. I tested it. For the warning message I have a question, Should I add a validation function to check if the provider's version is <= Regards! |
Great work as usual @Praveen005 to your last question, I say yes! That would be great. The rest looks pretty good to me. Make sure that changing I will let @uzaxirr weigh in on all the rest, see his thoughts. |
Thank you for the feedback @fernando-villalba. I'll proceed with raising the PR then. |
I added the validation function for But I have a question, How will user know that the default behaviour has changed? This warning will flash only if Initially, till the next version is released, should we flash this warning regardless of As for updating the https://github.com/civo/civogo/blob/22e0a732c195459152546dfd52ab854867b65f39/kubernetes.go#L133 |
Hi @uzaxirr, When you have a moment, could you please review this? Your input is needed to proceed. Thank you! |
hii @Praveen005
|
Thank you for reviewing it @uzaxirr For the sdk change part, actually I was getting the following error, every time I updated the configuration. Debug log revealed that, we are passing an empty Had there been a field like As a workaround to ensure we don't send an empty config, I did the following: I am not sure if this is the best way, but I couldn't think of another one. And this fixed the issue. Furthermore in the
I have a question, is the error handling done right here? If other errors like This is how the warning looks: Post changes, the creation/update goes through as intended: Kubeconfig hidden: Updating resource: Kubeconfig being shown in state: Updating again: |
@Praveen005 please go ahead and raise a PR |
Description
When creating a civo_kubernetes resource the kubeconfig gets saved to state, this includes secret tokens that grant complete access to the cluster. This is potentially not very secure.
I can see many scenarios (perhaps most?) where a user may not want that at all. Users may want to just create a cluster and then fetch the configuration with the Civo CLI or Dashboard, etc.
Acceptance Criteria
write_kubeconfig
or something like that. Whentrue
write kubeconfig to state, whenfalse
don't write it.write_kubeconfig
flag and set it totrue
. For example:"Starting on version x kubeconfig is not written to state by default, if you wish to keep the kubeconfig configuration in state, please add the input write_kubeconfig and set it to true"
The text was updated successfully, but these errors were encountered: