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/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..fdce2472b59 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 { + 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