Skip to content

Commit

Permalink
Fixed bug in install.
Browse files Browse the repository at this point in the history
  • Loading branch information
sadjamz committed Nov 17, 2021
1 parent 2d4ddae commit cb12fe9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cli/cmd/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ func (c *Command) checkForPreviousSecrets() error {
}
for _, secret := range secrets.Items {
// future TODO: also check for federation secret
if secret.ObjectMeta.Labels[common.CliLabelKey] == common.CliLabelKey {
return fmt.Errorf("found consul secret from previous installations: %q in namespace %q. To delete, run kubectl delete secret %s --namespace %s",
if secret.ObjectMeta.Labels[common.CliLabelKey] == common.CliLabelValue {
return fmt.Errorf("found Consul secret from previous installations: %q in namespace %q. To delete, run kubectl delete secret %s --namespace %s",
secret.Name, secret.Namespace, secret.Name, secret.Namespace)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestCheckForPreviousSecrets(t *testing.T) {
c.kubernetes.CoreV1().Secrets("default").Create(context.Background(), secret, metav1.CreateOptions{})
err := c.checkForPreviousSecrets()
require.Error(t, err)
require.Contains(t, err.Error(), "found consul secret from previous installations: \"test-consul-bootstrap-acl-token\" in namespace \"default\". To delete, run kubectl delete secret test-consul-bootstrap-acl-token --namespace default")
require.Contains(t, err.Error(), "found Consul secret from previous installation")

// Clear out the client and make sure the check now passes.
c.kubernetes = fake.NewSimpleClientset()
Expand Down

0 comments on commit cb12fe9

Please sign in to comment.