Skip to content

Commit 72dc09e

Browse files
committed
Separate function for getting restore registry auth secret.
Signed-off-by: Ales Raszka <araszka@redhat.com>
1 parent 15346d3 commit 72dc09e

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

pkg/library/restore/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func GetWorkspaceRestoreInitContainer(
111111
MountPath: constants.DefaultProjectsSourcesRoot,
112112
},
113113
}
114-
registryAuthSecret, err := secrets.HandleRegistryAuthSecret(ctx, k8sClient, workspace.DevWorkspace, workspace.Config, "", scheme, log)
114+
registryAuthSecret, err := secrets.GetNamespaceRegistryAuthSecret(ctx, k8sClient, workspace.DevWorkspace, workspace.Config, scheme, log)
115115
if err != nil {
116116
return nil, nil, fmt.Errorf("handling registry auth secret for workspace restore: %w", err)
117117
}

pkg/secrets/backup.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ import (
2929
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
3030
)
3131

32+
// GetRegistryAuthSecret retrieves the registry authentication secret for accessing backup images
33+
// based on the operator configuration.
34+
func GetNamespaceRegistryAuthSecret(ctx context.Context, c client.Client, workspace *dw.DevWorkspace,
35+
dwOperatorConfig *controllerv1alpha1.OperatorConfiguration, scheme *runtime.Scheme, log logr.Logger,
36+
) (*corev1.Secret, error) {
37+
return HandleRegistryAuthSecret(ctx, c, workspace, dwOperatorConfig, "", scheme, log)
38+
}
39+
3240
func HandleRegistryAuthSecret(ctx context.Context, c client.Client, workspace *dw.DevWorkspace,
3341
dwOperatorConfig *controllerv1alpha1.OperatorConfiguration, operatorConfigNamespace string, scheme *runtime.Scheme, log logr.Logger,
3442
) (*corev1.Secret, error) {

0 commit comments

Comments
 (0)