Skip to content

Commit

Permalink
feat: add Insecure flag to minioJob (#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker authored Sep 19, 2024
1 parent 6651c8b commit 056ce4b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/job_crd.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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* +

Expand Down
2 changes: 2 additions & 0 deletions helm/operator/templates/job.min.io_jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/job.min.io/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pkg/utils/miniojob/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions resources/base/crds/job.min.io_miniojobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 056ce4b

Please sign in to comment.