Skip to content

Commit

Permalink
add --console-image flag to kubectl-minio (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoblitt authored Feb 23, 2021
1 parent bfa9605 commit 26f901c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions kubectl-minio/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func newInitCmd(out io.Writer, errOut io.Writer) *cobra.Command {
f.StringVarP(&o.operatorOpts.ClusterDomain, "cluster-domain", "d", helpers.DefaultClusterDomain, "cluster domain of the Kubernetes cluster")
f.StringVar(&o.operatorOpts.NSToWatch, "namespace-to-watch", "", "namespace where operator looks for MinIO tenants, leave empty for all namespaces")
f.StringVar(&o.operatorOpts.ImagePullSecret, "image-pull-secret", "", "image pull secret to be used for pulling operator image")
f.StringVar(&o.operatorOpts.ConsoleImage, "console-image", "", "console image")
f.BoolVarP(&o.output, "output", "o", false, "dry run this command and generate requisite yaml")

return cmd
Expand Down
4 changes: 4 additions & 0 deletions kubectl-minio/cmd/resources/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ func LoadConsoleUI(emfs http.FileSystem, decode func(data []byte, defaults *sche
case *appsv1.Deployment:
if resourceObj, ok := obj.(*appsv1.Deployment); ok {
resourceObj.Namespace = opts.Namespace
// console image
if opts.ConsoleImage != "" {
resourceObj.Spec.Template.Spec.Containers[0].Image = opts.ConsoleImage
}
// push down image pull secrets
if opts.ImagePullSecret != "" {
resourceObj.Spec.Template.Spec.ImagePullSecrets = []corev1.LocalObjectReference{{Name: opts.ImagePullSecret}}
Expand Down
1 change: 1 addition & 0 deletions kubectl-minio/cmd/resources/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type OperatorOptions struct {
NSToWatch string
ClusterDomain string
ImagePullSecret string
ConsoleImage string
}

func operatorLabels() map[string]string {
Expand Down

0 comments on commit 26f901c

Please sign in to comment.