From f3df4c3107859ae597b78b1739f607e7247aceb3 Mon Sep 17 00:00:00 2001 From: wanddynosios <67467325+wanddynosios@users.noreply.github.com> Date: Wed, 14 Dec 2022 10:08:59 +0100 Subject: [PATCH] enable tip to restart app after cf ssh --- command/v7/enable_ssh_command.go | 8 ++++++++ command/v7/enable_ssh_command_test.go | 1 + integration/v7/isolated/enable_ssh_command_test.go | 1 + 3 files changed, 10 insertions(+) diff --git a/command/v7/enable_ssh_command.go b/command/v7/enable_ssh_command.go index 7fadce6d718..70c79f0bc8c 100644 --- a/command/v7/enable_ssh_command.go +++ b/command/v7/enable_ssh_command.go @@ -65,5 +65,13 @@ func (cmd *EnableSSHCommand) Execute(args []string) error { cmd.UI.DisplayText("TIP: Ensure ssh is also enabled on the space and global level.") } + if sshEnabled.Enabled && !appFeature.Enabled { + cmd.UI.DisplayText("TIP: An app restart is required for the change to take effect.") + } + + if appFeature.Enabled { + cmd.UI.DisplayText("TIP: An app restart may be required for the change to take effect.") + } + return nil } diff --git a/command/v7/enable_ssh_command_test.go b/command/v7/enable_ssh_command_test.go index 8f6431e95be..f32e30c0de7 100644 --- a/command/v7/enable_ssh_command_test.go +++ b/command/v7/enable_ssh_command_test.go @@ -159,6 +159,7 @@ var _ = Describe("enable-ssh Command", func() { It("shows the app ssh is already enabled", func() { Expect(testUI.Out).To(Say("ssh support for app 'some-app' is already enabled.")) Expect(testUI.Out).To(Say("OK")) + Expect(testUI.Out).To(Say("TIP: An app restart may be required for the change to take effect.")) }) }) diff --git a/integration/v7/isolated/enable_ssh_command_test.go b/integration/v7/isolated/enable_ssh_command_test.go index 460bc6fbf9c..7948361041b 100644 --- a/integration/v7/isolated/enable_ssh_command_test.go +++ b/integration/v7/isolated/enable_ssh_command_test.go @@ -125,6 +125,7 @@ var _ = Describe("enable-ssh command", func() { Eventually(session).Should(Say("ssh support for app '%s' is already enabled.", appName)) Eventually(session).Should(Say("OK")) + Eventually(session).Should(Say("An app restart may be required for the change to take effect.")) session = helpers.CF("curl", fmt.Sprintf("v3/apps/%s/ssh_enabled", helpers.AppGUID(appName))) Eventually(session).Should(Exit(0))