Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Insecure to minioJob #2321

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading