From 041706ada8e38fba100d372f100db2407e73916e Mon Sep 17 00:00:00 2001 From: jiuker Date: Wed, 18 Sep 2024 16:56:59 +0800 Subject: [PATCH 1/3] feat: add Insecure to minioJob feat: add Insecure to minioJob --- docs/job_crd.adoc | 3 +++ helm/operator/templates/job.min.io_jobs.yaml | 2 ++ helm/operator/templates/sts.min.io_policybindings.yaml | 2 +- pkg/apis/job.min.io/v1alpha1/types.go | 4 ++++ pkg/utils/miniojob/types.go | 5 +++++ resources/base/crds/job.min.io_miniojobs.yaml | 2 ++ resources/base/crds/sts.min.io_policybindings.yaml | 2 +- 7 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/job_crd.adoc b/docs/job_crd.adoc index 3ca5478a102..c296987541c 100644 --- a/docs/job_crd.adoc +++ b/docs/job_crd.adoc @@ -188,6 +188,9 @@ Defaults to `parallel` if not provided. |FailureStrategy is the forward plan in case of the failure of one or more MinioJob pods Either `stopOnFailure` or `continueOnFailure`, defaults to `continueOnFailure`. +|*`insecure`* __boolean__ +|Insecure is boolean to enable/disable TLS verification + |*`commands`* __xref:{anchor_prefix}-github-com-minio-operator-pkg-apis-job-min-io-v1alpha1-commandspec[$$CommandSpec$$] array__ |*Required* + diff --git a/helm/operator/templates/job.min.io_jobs.yaml b/helm/operator/templates/job.min.io_jobs.yaml index a1f14e18358..c0fdc3ca210 100644 --- a/helm/operator/templates/job.min.io_jobs.yaml +++ b/helm/operator/templates/job.min.io_jobs.yaml @@ -1079,6 +1079,8 @@ spec: type: object x-kubernetes-map-type: atomic type: array + insecure: + type: boolean mcImage: default: quay.io/minio/mc:RELEASE.2024-08-17T11-33-50Z type: string diff --git a/helm/operator/templates/sts.min.io_policybindings.yaml b/helm/operator/templates/sts.min.io_policybindings.yaml index 10db901028c..2ef71786929 100644 --- a/helm/operator/templates/sts.min.io_policybindings.yaml +++ b/helm/operator/templates/sts.min.io_policybindings.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - operator.min.io/version: v6.0.3 + operator.min.io/version: v5.0.15 name: policybindings.sts.min.io spec: group: sts.min.io diff --git a/pkg/apis/job.min.io/v1alpha1/types.go b/pkg/apis/job.min.io/v1alpha1/types.go index 4e97765c7e4..0046c0865b2 100644 --- a/pkg/apis/job.min.io/v1alpha1/types.go +++ b/pkg/apis/job.min.io/v1alpha1/types.go @@ -89,6 +89,10 @@ type MinIOJobSpec struct { // +kubebuilder:validation:Enum=continueOnFailure;stopOnFailure; FailureStrategy FailureStrategy `json:"failureStrategy"` + // Insecure is boolean to enable/disable TLS verification + // +optional + Insecure *bool `json:"insecure"` + // *Required* + // // Commands List of MinioClient commands diff --git a/pkg/utils/miniojob/types.go b/pkg/utils/miniojob/types.go index 2c6e1863482..e690991c2b1 100644 --- a/pkg/utils/miniojob/types.go +++ b/pkg/utils/miniojob/types.go @@ -151,6 +151,11 @@ func (jobCommand *MinIOIntervalJobCommand) createJob(_ context.Context, _ client } } + if jobCR.Spec.Insecure != nil && *jobCR.Spec.Insecure && insecure == false { + jobCommands = append(jobCommands, "--insecure") + insecure = true + } + mcImage := jobCR.Spec.MCImage if mcImage == "" { mcImage = DefaultMCImage diff --git a/resources/base/crds/job.min.io_miniojobs.yaml b/resources/base/crds/job.min.io_miniojobs.yaml index a1f14e18358..c0fdc3ca210 100644 --- a/resources/base/crds/job.min.io_miniojobs.yaml +++ b/resources/base/crds/job.min.io_miniojobs.yaml @@ -1079,6 +1079,8 @@ spec: type: object x-kubernetes-map-type: atomic type: array + insecure: + type: boolean mcImage: default: quay.io/minio/mc:RELEASE.2024-08-17T11-33-50Z type: string diff --git a/resources/base/crds/sts.min.io_policybindings.yaml b/resources/base/crds/sts.min.io_policybindings.yaml index 10db901028c..2ef71786929 100644 --- a/resources/base/crds/sts.min.io_policybindings.yaml +++ b/resources/base/crds/sts.min.io_policybindings.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - operator.min.io/version: v6.0.3 + operator.min.io/version: v5.0.15 name: policybindings.sts.min.io spec: group: sts.min.io From 9aca69863ceb8062bc9f98af1abd70ec321e8ddf Mon Sep 17 00:00:00 2001 From: jiuker Date: Wed, 18 Sep 2024 17:00:59 +0800 Subject: [PATCH 2/3] change version change version --- helm/operator/templates/sts.min.io_policybindings.yaml | 2 +- resources/base/crds/sts.min.io_policybindings.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helm/operator/templates/sts.min.io_policybindings.yaml b/helm/operator/templates/sts.min.io_policybindings.yaml index 2ef71786929..10db901028c 100644 --- a/helm/operator/templates/sts.min.io_policybindings.yaml +++ b/helm/operator/templates/sts.min.io_policybindings.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - operator.min.io/version: v5.0.15 + operator.min.io/version: v6.0.3 name: policybindings.sts.min.io spec: group: sts.min.io diff --git a/resources/base/crds/sts.min.io_policybindings.yaml b/resources/base/crds/sts.min.io_policybindings.yaml index 2ef71786929..10db901028c 100644 --- a/resources/base/crds/sts.min.io_policybindings.yaml +++ b/resources/base/crds/sts.min.io_policybindings.yaml @@ -4,7 +4,7 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - operator.min.io/version: v5.0.15 + operator.min.io/version: v6.0.3 name: policybindings.sts.min.io spec: group: sts.min.io From d33fdfd057d794b6055b3dcd52092ace130b59ad Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Wed, 18 Sep 2024 20:30:02 +0800 Subject: [PATCH 3/3] Update pkg/utils/miniojob/types.go Co-authored-by: Ramon de Klein --- pkg/utils/miniojob/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/utils/miniojob/types.go b/pkg/utils/miniojob/types.go index e690991c2b1..fdce2472b59 100644 --- a/pkg/utils/miniojob/types.go +++ b/pkg/utils/miniojob/types.go @@ -151,7 +151,7 @@ func (jobCommand *MinIOIntervalJobCommand) createJob(_ context.Context, _ client } } - if jobCR.Spec.Insecure != nil && *jobCR.Spec.Insecure && insecure == false { + if jobCR.Spec.Insecure != nil && *jobCR.Spec.Insecure && !insecure { jobCommands = append(jobCommands, "--insecure") insecure = true }