diff --git a/pkg/commands/edit/set/setimage.go b/pkg/commands/edit/set/setimage.go index cba76575d..8454ab0f8 100644 --- a/pkg/commands/edit/set/setimage.go +++ b/pkg/commands/edit/set/setimage.go @@ -38,6 +38,7 @@ var ( errImageInvalidArgs = errors.New(`invalid format of image, use one of the following options: - =: - =@ +- = - : - @`) ) @@ -53,23 +54,34 @@ func newCmdSetImage(fsys fs.FileSystem) *cobra.Command { Short: `Sets images and their new names, new tags or digests in the kustomization file`, Example: ` The command - set image postgres=my-registry/postgres:latest nginx:1.8.0 my-app=my-registry/my-app alpine@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 -will add + set image postgres=eu.gcr.io/my-project/postgres:latest my-app=my-registry/my-app@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 +will add image: - name: postgres - newName: my-registry/postgres + newName: eu.gcr.io/my-project/postgres newTag: latest -- name: nginx - newTag: 1.8.0 -- name: my-app +- digest: sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 + name: my-app newName: my-registry/my-app + +to the kustomization file if it doesn't exist, +and overwrite the previous ones if the image name exists. + +The command + set image node:8.15.0 mysql=mariadb alpine@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 +will add + +image: +- name: node + newTag: 8.15.0 +- name: mysql + newName: mariadb - digest: sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 name: alpine to the kustomization file if it doesn't exist, and overwrite the previous ones if the image name exists. - `, RunE: func(cmd *cobra.Command, args []string) error { err := o.Validate(args) diff --git a/pkg/commands/edit/set/setimagetag.go b/pkg/commands/edit/set/setimagetag.go index 41baedbd7..2c8e5db32 100644 --- a/pkg/commands/edit/set/setimagetag.go +++ b/pkg/commands/edit/set/setimagetag.go @@ -41,7 +41,7 @@ func newCmdSetImageTag(fsys fs.FileSystem) *cobra.Command { cmd := &cobra.Command{ Use: "imagetag", - Short: "[*** DEPRECATED, use: kustomize edit set image ***] Sets images and their new tags or digests in the kustomization file", + Short: "The `imagetag` command is deprecated, instead use `edit set image`.", Example: ` The command set imagetag nginx:1.8.0 my-app:latest alpine@sha256:24a0c4b4a4c0eb97a1aabb8e29f18e917d05abfe1b7a7c07857230879ce7d3d3 @@ -59,7 +59,7 @@ to the kustomization file if it doesn't exist, and overwrite the previous ones if the image tag exists. `, RunE: func(cmd *cobra.Command, args []string) error { - log.Print("This is a deprecated command, it still works but will be removed in a further release. Use better kustomize edit set image") + log.Print(cmd.Short) err := o.Validate(args) if err != nil { return err