Skip to content

Commit 1073608

Browse files
committed
fixup! fixup! fixup! fix: fall back to canonical backup auth secret name on restore
fixup\! fixup\! fixup\! fix: fall back to canonical backup auth secret name on restore Replace "canonical" with "predefined" throughout Assisted-by: Claude Opus 4.6 (1M context) Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
1 parent 7bd062d commit 1073608

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/secrets/backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func HandleRegistryAuthSecret(ctx context.Context, c client.Client, workspace *d
5454
return nil, nil
5555
}
5656

57-
// On the restore path (operatorConfigNamespace == ""), look for the canonical name
57+
// On the restore path (operatorConfigNamespace == ""), look for the predefined name
5858
// that CopySecret always uses. On the backup path, look for the configured name
5959
// because the secret may exist directly in the workspace namespace under that name.
6060
lookupName := secretName

pkg/secrets/backup_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ var _ = Describe("HandleRegistryAuthSecret (restore path: operatorConfigNamespac
101101
scheme = buildScheme()
102102
})
103103

104-
It("returns the canonical secret when it exists in the workspace namespace", func() {
105-
By("creating the canonical DevWorkspaceBackupAuthSecretName secret in the workspace namespace")
106-
canonicalSecret := makeSecret(constants.DevWorkspaceBackupAuthSecretName, workspaceNS)
104+
It("returns the predefined secret when it exists in the workspace namespace", func() {
105+
By("creating the predefined DevWorkspaceBackupAuthSecretName secret in the workspace namespace")
106+
predefinedSecret := makeSecret(constants.DevWorkspaceBackupAuthSecretName, workspaceNS)
107107

108-
fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithObjects(canonicalSecret).Build()
108+
fakeClient := fake.NewClientBuilder().WithScheme(scheme).WithObjects(predefinedSecret).Build()
109109
workspace := makeWorkspace(workspaceNS)
110110
config := makeConfig("quay-backup-auth")
111111

@@ -115,7 +115,7 @@ var _ = Describe("HandleRegistryAuthSecret (restore path: operatorConfigNamespac
115115
Expect(result.Name).To(Equal(constants.DevWorkspaceBackupAuthSecretName))
116116
})
117117

118-
It("returns nil when the canonical secret does not exist in the workspace namespace", func() {
118+
It("returns nil when the predefined secret does not exist in the workspace namespace", func() {
119119
By("using a fake client with no secrets")
120120
fakeClient := fake.NewClientBuilder().WithScheme(scheme).Build()
121121
workspace := makeWorkspace(workspaceNS)
@@ -127,7 +127,7 @@ var _ = Describe("HandleRegistryAuthSecret (restore path: operatorConfigNamespac
127127
})
128128

129129
It("propagates a non-NotFound error from the workspace namespace lookup", func() {
130-
By("wrapping a fake client so that the canonical name lookup returns a server error")
130+
By("wrapping a fake client so that the predefined name lookup returns a server error")
131131
errClient := &errorOnNameClient{
132132
Client: fake.NewClientBuilder().WithScheme(scheme).Build(),
133133
failName: constants.DevWorkspaceBackupAuthSecretName,

0 commit comments

Comments
 (0)