Skip to content

Commit

Permalink
Merge pull request #124 from opcr-io/deprecate
Browse files Browse the repository at this point in the history
Add deprecation message for remote commands
  • Loading branch information
oanatmaria authored Mar 7, 2023
2 parents 0813c1e + 2c332c3 commit 5801e75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/policy/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
1 change: 1 addition & 0 deletions cmd/policy/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmd/policy/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5801e75

Please sign in to comment.