Skip to content

Commit

Permalink
unregister-member test
Browse files Browse the repository at this point in the history
Signed-off-by: Feny Mehta <[email protected]>
  • Loading branch information
fbm3307 committed Sep 25, 2024
1 parent 92d0237 commit c0332b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/adm/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func restartDeployment(ctx *clicontext.CommandContext, cl runtimeclient.Client,
}

if len(olmDeploymentList.Items) == 0 {
return fmt.Errorf("OLM based deployment not found in %s", ns)
fmt.Printf("OLM based deployment not found in %s", ns)
} else {
for _, olmDeployment := range olmDeploymentList.Items {
fmt.Printf("Proceeding to delete the Pods of %v \n", olmDeployment)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/adm/restart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ func TestRestart(t *testing.T) {
//when
err := restartDeployment(ctx, fakeClient, namespacedName.Namespace, tf, streams)
if tc.labelValue == "kubesaw-controller-manager" {
require.NoError(t, err)
require.NoError(t, err, "non-OLM based deployment not found in")
} else if tc.labelValue == "codeready-toolchain" {
require.Error(t, err)
require.NoError(t, err, "OLM based deployment not found in")
err := restartNonOlmDeployments(*deployment1, tf, streams)
require.NoError(t, err)
//checking the output from kubectl
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/adm/unregister_member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestUnregisterMemberWhenAnswerIsY(t *testing.T) {
toolchainCluster := NewToolchainCluster(ToolchainClusterName("member-cool-server.com"))
hostDeploymentName := test.NamespacedName("toolchain-host-operator", "host-operator-controller-manager")
deployment := newDeployment(hostDeploymentName, 1)
deployment.Labels = map[string]string{"olm.owner.namespace": "toolchain-host-operator"}
deployment.Labels = map[string]string{"kubesaw-control-plane": "kubesaw-controller-manager"}

newClient, fakeClient := NewFakeClients(t, toolchainCluster, deployment)
numberOfUpdateCalls := 0
Expand Down

0 comments on commit c0332b1

Please sign in to comment.