Skip to content
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

Can't overwrite a KUBECONFIG that's in use #12

Open
dhaiducek opened this issue Feb 2, 2021 · 2 comments
Open

Can't overwrite a KUBECONFIG that's in use #12

dhaiducek opened this issue Feb 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@dhaiducek
Copy link
Collaborator

dhaiducek commented Feb 2, 2021

This line will cause issues if a user is still using the file to login to the ClusterPool cluster and reuses the same claim:
https://github.com/open-cluster-management/lifeguard/blob/0ce949b7e2d9997a1d5e0511e3b8ba4af946c165/clusterclaims/apply.sh#L389

@dhaiducek
Copy link
Collaborator Author

Should be fairly straightforward (?) to check up-front whether the KUBECONFIG in use is a lifeguard/clusterclaims/*/kubeconfig file

@dhaiducek
Copy link
Collaborator Author

dhaiducek commented Feb 2, 2021

I've addressed it in startrhacm this way:

if [[ "${KUBECONFIG}" == */lifeguard/clusterclaims/*/kubeconfig ]]; then
  printlog error "KUBECONFIG is set to an existing claim's configuration file. Please unset before continuing: unset KUBECONFIG"
  exit 1

https://github.com/dhaiducek/startrhacm/blob/e271da0a72ce8ac0ea4b4eb86e2936e68e77219d/startrhacm.sh#L70-L72

@dhaiducek dhaiducek added the bug Something isn't working label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant