Skip to content

Commit

Permalink
[UPDATE] Addin VolumeMounts to BackendSpec and RestoreMethod
Browse files Browse the repository at this point in the history
Change:
- Removing VolumeMounts from S3Spec and RestServerSpec in BackendSpec. Adding to BackendSpec (File: v1/backend.go)
- Adding VolumeMounts to RestoreMethod (File: v1/restore_types.go)

Signed-off-by: poyaz <[email protected]>
  • Loading branch information
poyaz committed Mar 22, 2024
1 parent c42e748 commit ece84c7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 29 deletions.
11 changes: 7 additions & 4 deletions api/v1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ type (
B2 *B2Spec `json:"b2,omitempty"`
Rest *RestServerSpec `json:"rest,omitempty"`

Options *BackendOpts `json:"options,omitempty"`
Options *BackendOpts `json:"options,omitempty"`
VolumeMounts *[]corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

// +k8s:deepcopy-gen=false
Expand Down Expand Up @@ -91,7 +92,11 @@ func IsNil(v interface{}) bool {
return v == nil || (reflect.ValueOf(v).Kind() == reflect.Ptr && reflect.ValueOf(v).IsNil())
}

func addEnvVarFromSecret(vars map[string]*corev1.EnvVarSource, key string, ref *corev1.SecretKeySelector) {
func addEnvVarFromSecret(
vars map[string]*corev1.EnvVarSource,
key string,
ref *corev1.SecretKeySelector,
) {
if ref != nil {
vars[key] = &corev1.EnvVarSource{
SecretKeyRef: ref,
Expand All @@ -118,7 +123,6 @@ type S3Spec struct {
Bucket string `json:"bucket,omitempty"`
AccessKeyIDSecretRef *corev1.SecretKeySelector `json:"accessKeyIDSecretRef,omitempty"`
SecretAccessKeySecretRef *corev1.SecretKeySelector `json:"secretAccessKeySecretRef,omitempty"`
VolumeMounts *[]corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

// EnvVars returns the env vars for this backend.
Expand Down Expand Up @@ -268,7 +272,6 @@ type RestServerSpec struct {
URL string `json:"url,omitempty"`
UserSecretRef *corev1.SecretKeySelector `json:"userSecretRef,omitempty"`
PasswordSecretReg *corev1.SecretKeySelector `json:"passwordSecretReg,omitempty"`
VolumeMounts *[]corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

// EnvVars returns the env vars for this backend.
Expand Down
7 changes: 4 additions & 3 deletions api/v1/restore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ type RestoreSpec struct {
// RestoreMethod contains how and where the restore should happen
// all the settings are mutual exclusive.
type RestoreMethod struct {
S3 *S3Spec `json:"s3,omitempty"`
Folder *FolderRestore `json:"folder,omitempty"`
Options *RestoreOpts `json:"options,omitempty"`
S3 *S3Spec `json:"s3,omitempty"`
Folder *FolderRestore `json:"folder,omitempty"`
Options *RestoreOpts `json:"options,omitempty"`
VolumeMounts *[]corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

type FolderRestore struct {
Expand Down
44 changes: 22 additions & 22 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ece84c7

Please sign in to comment.