Skip to content

Commit

Permalink
Add STS option in krew plugin (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjuarezd committed Mar 11, 2023
1 parent b258c07 commit 2416357
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kubectl-minio/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func newInitCmd(out io.Writer, errOut io.Writer) *cobra.Command {
f.StringVar(&o.operatorOpts.ImagePullSecret, "image-pull-secret", "", "image pull secret to be used for pulling MinIO Operator")
f.StringVar(&o.operatorOpts.ConsoleImage, "console-image", "", "console image")
f.BoolVar(&o.operatorOpts.ConsoleTLS, "console-tls", false, "enable tls for Operator console")
f.BoolVar(&o.operatorOpts.STS, "sts", false, "enable Operator sts (v1alpha1)")
f.StringVar(&o.operatorOpts.TenantMinIOImage, "default-minio-image", "", "default tenant MinIO image")
f.StringVar(&o.operatorOpts.TenantConsoleImage, "default-console-image", "", "default tenant Console image")
f.StringVar(&o.operatorOpts.TenantKesImage, "default-kes-image", "", "default tenant KES image")
Expand Down Expand Up @@ -241,6 +242,16 @@ func (o *operatorInitCmd) run(writer io.Writer) error {
Value: o.operatorOpts.ConsoleImage,
})
}
if o.operatorOpts.STS {
operatorDepPatches = append(operatorDepPatches, opInterface{
Op: "add",
Path: "/spec/template/spec/containers/0/env/0",
Value: corev1.EnvVar{
Name: "OPERATOR_STS_ENABLED",
Value: "on",
},
})
}
// attach the patches to the kustomization file
if len(operatorDepPatches) > 0 {
kustomizationYaml.PatchesJson6902 = append(kustomizationYaml.PatchesJson6902, types.Patch{
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 @@ -30,4 +30,5 @@ type OperatorOptions struct {
TenantKesImage string
PrometheusNamespace string
PrometheusName string
STS bool
}

0 comments on commit 2416357

Please sign in to comment.