Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tip to restart app when enabling ssh #2314

Merged
merged 3 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions command/v7/enable_ssh_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,14 @@ 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
}

2 changes: 2 additions & 0 deletions command/v7/enable_ssh_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ var _ = Describe("enable-ssh Command", func() {
Expect(testUI.Err).To(Say("some-get-ssh-enabled-warnings"))
Expect(testUI.Out).To(Say(`Enabling ssh support for app %s as %s\.\.\.`, appName, currentUserName))
Expect(testUI.Out).To(Say("OK"))
Expect(testUI.Out).To(Say("TIP: An app restart is required for the change to take effect."))
})

When("SSH is disabled at a level above the app level", func() {
Expand Down Expand Up @@ -160,6 +161,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."))
})
})

Expand Down
2 changes: 2 additions & 0 deletions integration/v7/isolated/enable_ssh_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var _ = Describe("enable-ssh command", func() {
Eventually(session).Should(Say(`Enabling ssh support for app %s as %s\.\.\.`, appName, userName))

Eventually(session).Should(Say("OK"))
Eventually(session).Should(Say("TIP: An app restart is required for the change to take effect."))
Eventually(session).Should(Exit(0))

session = helpers.CF("curl", fmt.Sprintf("v3/apps/%s/ssh_enabled", helpers.AppGUID(appName)))
Expand All @@ -125,6 +126,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))
Expand Down
Loading