Skip to content

Commit 6d9e10f

Browse files
zyjiaobjying
authored andcommitted
show warning message to reset env when credential is removed (#49)
1 parent ddc8be2 commit 6d9e10f

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/cli/commands/delete_credential.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ func DeleteCredential(cliConnection api.Connection, appName string) error {
4848
}
4949

5050
ui.SayOK()
51+
ui.SayWarningMessage(ui.DeleteCredentialWarning, appName)
5152
return nil
5253
}

src/cli/main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,7 @@ var _ = Describe("App-AutoScaler Commands", func() {
18841884

18851885
Expect(session.Out).To(gbytes.Say(ui.DeleteCredentialHint, fakeAppName))
18861886
Expect(session.Out).To(gbytes.Say("OK"))
1887+
Expect(session.Out).To(gbytes.Say(ui.DeleteCredentialWarning, fakeAppName))
18871888
Expect(session.ExitCode()).To(Equal(0))
18881889
})
18891890

src/cli/ui/message.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@ const (
4848

4949
MoreRecordsWarning = "TIP: More records available. Please re-run the command with --start or --end option to fetch more."
5050
DeprecatedDescWarning = "TIP: The default order is set to descending now. Please remove the DEPRECATED flag '--desc'."
51-
CreateCredentialWarning = "TIP: A new credential generated. Please update the credential setting, and use 'cf restart %s' to ensure your env variable changes take effect."
51+
CreateCredentialWarning = "TIP: A new credential generated. Please update the credential setting of your application, and use 'cf restart %s' to ensure your env variable changes take effect."
52+
DeleteCredentialWarning = "TIP: The credential removed. Please remove the credential setting from your application, and use 'cf restart %s' to ensure your env variable changes take effect."
5253
)

0 commit comments

Comments
 (0)