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

Make inlets-operator not fail on existing secret #173

Merged
merged 1 commit into from Jan 31, 2020

Conversation

hasheddan
Copy link
Contributor

In order for the inlets-operator app to not fail on re-runs
it is necessary for the command to be resilient to the
inlets-access-key secret already being present in cluster.

Signed-off-by: hasheddan georgedanielmangum@gmail.com

Description

Currently, running k3sup app install inlets-operator after it has already been run once will fail due to the presence of the inlets-access-key secret already being present. This change updates behavior to log when the secret is already present, but to continue execution using the existing secret.

Motivation and Context

  • I have raised an issue to propose this change (required)

Fixes #172

How Has This Been Tested?

Running installation for the first time on a k3s cluster set up using k3sup:

Using kubeconfig: /home/dan/code/github.com/alexellis/k3sup/kubeconfig                                                                                                                                      
amd64Node architecture: "amd64"                                                                                                                                                                             
x86_64                                                                                                                                                                                                      
Linux                                                                                                                                                                                                       
Client: "x86_64", "Linux"                                                                                                                                                                                   
2020/01/29 10:51:37 User dir established as: /home/dan/.k3sup/                                                                                                                                              
"inlets" has been added to your repositories                                                                                                                                                                
Hang tight while we grab the latest from your chart repositories...                                                                                                                                         
...Skip local chart repository                                                                                                                                                                              
...Successfully got an update from the "inlets" chart repository                                                                                                                                            
...Successfully got an update from the "crossplane-alpha" chart repository                                                                                                                                  
...Successfully got an update from the "stable" chart repository                                                                                                                                            
Update Complete.                                                                                                                                                                                            
...

Running installation for a second time on same k3s cluster:

Using kubeconfig: /home/dan/code/github.com/alexellis/k3sup/kubeconfig                                                                                                                                      
amd64Node architecture: "amd64"                                                                                                                                                                             
x86_64                                                                                                                                                                                                      
Linux                                                                                                                                                                                                       
Client: "x86_64", "Linux"                                                                                                                                                                                   
2020/01/29 10:51:37 User dir established as: /home/dan/.k3sup/                                                                                                                                              
"inlets" has been added to your repositories                                                                                                                                                                
Hang tight while we grab the latest from your chart repositories...                                                                                                                                         
...Skip local chart repository                                                                                                                                                                              
...Successfully got an update from the "inlets" chart repository                                                                                                                                            
...Successfully got an update from the "crossplane-alpha" chart repository                                                                                                                                  
...Successfully got an update from the "stable" chart repository                                                                                                                                            
Update Complete.                                                                                                                                                                                            
Error from server (AlreadyExists): secrets "inlets-access-key" already exists                                                                                                                               
[Warning] secret inlets-access-key already exists and will be used.
...

Note: we still get the Error from server (AlreadyExists): secrets "inlets-access-key already exists` printed in output because of

StreamStdio: true,
. This could be changed in the future if it is desirable not to always show the kubectl output immediately.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

In order for the inlets-operator app to not fail on re-runs
it is necessary for the command to be resilient to the
inlets-access-key secret already being present in cluster.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
Copy link
Owner

@alexellis alexellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@alexellis alexellis merged commit 0bf5110 into alexellis:master Jan 31, 2020
@alexellis
Copy link
Owner

Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App - inlets-operator should not fail to install the second time if its token secret already exists.
2 participants