Skip to content

Commit

Permalink
PB-6331: Add S3DisableSSL field to the JobOptions to fix tls secret m…
Browse files Browse the repository at this point in the history
…ount to the maintenance job spec
  • Loading branch information
sgajawada-px committed Apr 18, 2024
1 parent 9a1ed66 commit 7530705
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/drivers/kopiamaintenance/kopiamaintenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func jobFor(
jobSpec.Volumes = append(jobSpec.Volumes, volume)
}

if drivers.CertFilePath != "" {
if drivers.CertFilePath != "" && !jobOption.S3DisableSSL {
volumeMount = corev1.VolumeMount{
Name: utils.TLSCertMountVol,
MountPath: drivers.CertMount,
Expand Down Expand Up @@ -375,7 +375,7 @@ func jobFor(
},
}

if drivers.CertFilePath != "" {
if drivers.CertFilePath != "" && !jobOption.S3DisableSSL {
jobV1.Spec.JobTemplate.Spec.Template.Spec.Containers[0].VolumeMounts = append(
jobV1.Spec.JobTemplate.Spec.Template.Spec.Containers[0].VolumeMounts,
volumeMount,
Expand Down Expand Up @@ -408,7 +408,7 @@ func jobFor(
},
}

if drivers.CertFilePath != "" {
if drivers.CertFilePath != "" && !jobOption.S3DisableSSL {
jobV1Beta1.Spec.JobTemplate.Spec.Template.Spec.Containers[0].VolumeMounts = append(
jobV1Beta1.Spec.JobTemplate.Spec.Template.Spec.Containers[0].VolumeMounts,
volumeMount,
Expand Down
9 changes: 9 additions & 0 deletions pkg/drivers/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ type JobOpts struct {
AppCRNamespace string
ResoureBackupName string
ResoureBackupNamespace string
S3DisableSSL bool
}

// WithS3DisableSSL is job parameter
func WithS3DisableSSL(disableSSL bool) JobOption {
return func(opts *JobOpts) error {
opts.S3DisableSSL = disableSSL
return nil
}
}

// WithResoureBackupName is job parameter
Expand Down

0 comments on commit 7530705

Please sign in to comment.