From 2c332c381159ae1c0dbbe680431d5617ee32bd8a Mon Sep 17 00:00:00 2001 From: carabasdaniel Date: Mon, 6 Mar 2023 10:37:17 +0200 Subject: [PATCH] Add deprecation message for remote commands Signed-off-by: carabasdaniel --- cmd/policy/images.go | 1 + cmd/policy/remote.go | 1 + cmd/policy/rm.go | 1 + 3 files changed, 3 insertions(+) diff --git a/cmd/policy/images.go b/cmd/policy/images.go index 1b8e3ef..c334e6c 100644 --- a/cmd/policy/images.go +++ b/cmd/policy/images.go @@ -15,6 +15,7 @@ type ImagesCmd struct { func (c *ImagesCmd) Run(g *Globals) error { if c.Remote { + g.App.UI.Exclamation().Msg("This command is deprecated and it will be removed in a future version of the policy CLI.") if c.Org == "" { return errors.New("organization parameter is required, please provide it using -o/--organization") } diff --git a/cmd/policy/remote.go b/cmd/policy/remote.go index 6d5591c..bb9d1b1 100644 --- a/cmd/policy/remote.go +++ b/cmd/policy/remote.go @@ -20,6 +20,7 @@ type RemoteImagesCmd struct { } func (c *SetPublicCmd) Run(g *Globals) error { + g.App.UI.Exclamation().Msg("This command is deprecated and it will be removed in a future version of the policy CLI.") public := false if c.Public == "true" { public = true diff --git a/cmd/policy/rm.go b/cmd/policy/rm.go index 0913433..09caf2c 100644 --- a/cmd/policy/rm.go +++ b/cmd/policy/rm.go @@ -13,6 +13,7 @@ func (c *RmCmd) Run(g *Globals) error { var errs error for _, policyRef := range c.Policies { if c.Remote { + g.App.UI.Exclamation().Msg("This command is deprecated and it will be removed in a future version of the policy CLI.") err := g.App.RmRemote(policyRef, c.All, c.Force) if err != nil { g.App.UI.Problem().WithErr(err).Msgf("Failed to remove policy: %s", policyRef)