Skip to content

Commit

Permalink
Generalize default webhook message (#50696)
Browse files Browse the repository at this point in the history
* Use different webhook msg for ambient mode

* update msg

* add comment
  • Loading branch information
leosarra committed May 2, 2024
1 parent 75c6eaf commit 96a6174
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion operator/cmd/mesh/install.go
Expand Up @@ -210,7 +210,7 @@ func Install(kubeClient kube.CLIClient, rootArgs *RootArgs, iArgs *InstallArgs,
if processed, err := helmreconciler.ProcessDefaultWebhook(kubeClient, iop, exists, opts); err != nil {
return fmt.Errorf("failed to process default webhook: %v", err)
} else if processed {
p.Println("Made this installation the default for injection and validation.")
p.Println("Made this installation the default for cluster-wide operations.")
}

if iArgs.Verify {
Expand All @@ -232,6 +232,10 @@ func Install(kubeClient kube.CLIClient, rootArgs *RootArgs, iArgs *InstallArgs,
}
}

// Post-install message
if profile == "ambient" {
p.Println("The ambient profile has been installed successfully, enjoy Istio without sidecars!")
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/operator/install_test.go
Expand Up @@ -82,7 +82,7 @@ func TestReInstallAfterFailure(t *testing.T) {
// Here we should have two activated webhooks, but dry-run should not report any error, which
// means the re-installation can be done successfully.
output, outErr := istioCtl.InvokeOrFail(t, []string{"install", "--dry-run"})
if !strings.Contains(output, "Made this installation the default for injection and validation.") {
if !strings.Contains(output, "Made this installation the default for cluster-wide operations.") {
t.Errorf("install expects to succeed but didn't")
}
assert.Equal(t, "", outErr)
Expand Down

0 comments on commit 96a6174

Please sign in to comment.