Skip to content

Commit

Permalink
meesage when secret not present
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek committed Jan 10, 2025
1 parent 8abd609 commit 325af8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cmd/adm/unregister_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func UnregisterMemberCluster(ctx *clicontext.CommandContext, clusterName string,
if !errors.IsNotFound(err) {
return err
}

Check warning on line 68 in pkg/cmd/adm/unregister_member.go

View check run for this annotation

Codecov / codecov/patch

pkg/cmd/adm/unregister_member.go#L67-L68

Added lines #L67 - L68 were not covered by tests
ctx.Printlnf("\nThe referenced ToolchainCluster secret %s, is not present.", toolchainCluster.Spec.SecretRef.Name)
} else {
ctx.Printlnf("\nDeleting the ToolchainCluster secret %s...", toolchainCluster.Spec.SecretRef.Name)
if err := hostClusterClient.Delete(context.TODO(), tcSecret); err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/cmd/adm/unregister_member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestUnregisterMemberWhenSecretIsMissing(t *testing.T) {
// then
require.NoError(t, err)
AssertToolchainClusterDoesNotExist(t, fakeClient, toolchainCluster)
assert.Contains(t, term.Output(), "The referenced ToolchainCluster secret member-cool-server.com-secret, is not present.")
assert.NotContains(t, term.Output(), "cool-token")
}

Expand Down

0 comments on commit 325af8b

Please sign in to comment.