Skip to content

Commit 18ef5e6

Browse files
committed
Support using image registry proxy in more cases.
Signed-off-by: Xun Jiang <xun.jiang@broadcom.com>
1 parent 01aa538 commit 18ef5e6

25 files changed

Lines changed: 419 additions & 140 deletions

File tree

test/e2e/backups/deletion.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,17 @@ func runBackupDeletionTests(client TestClient, veleroCfg VeleroConfig, backupLoc
115115
}()
116116
}
117117

118-
if err := KibishiiPrepareBeforeBackup(oneHourTimeout, client, providerName, ns,
119-
registryCredentialFile, veleroFeatures, kibishiiDirectory, useVolumeSnapshots, DefaultKibishiiData); err != nil {
118+
if err := KibishiiPrepareBeforeBackup(
119+
oneHourTimeout,
120+
client,
121+
providerName,
122+
ns,
123+
registryCredentialFile,
124+
veleroFeatures,
125+
kibishiiDirectory,
126+
DefaultKibishiiData,
127+
veleroCfg.ImageRegistryProxy,
128+
); err != nil {
120129
return errors.Wrapf(err, "Failed to install and prepare data for kibishii %s", ns)
121130
}
122131
err := ObjectsShouldNotBeInBucket(veleroCfg.ObjectStoreProvider, veleroCfg.CloudCredentialsFile, veleroCfg.BSLBucket, veleroCfg.BSLPrefix, veleroCfg.BSLConfig, backupName, BackupObjectsPrefix, 1)

test/e2e/backups/ttl.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@ func TTLTest() {
100100
})
101101

102102
By("Deploy sample workload of Kibishii", func() {
103-
Expect(KibishiiPrepareBeforeBackup(ctx, client, veleroCfg.CloudProvider,
104-
test.testNS, veleroCfg.RegistryCredentialFile, veleroCfg.Features,
105-
veleroCfg.KibishiiDirectory, useVolumeSnapshots, DefaultKibishiiData)).To(Succeed())
103+
Expect(KibishiiPrepareBeforeBackup(
104+
ctx,
105+
client,
106+
veleroCfg.CloudProvider,
107+
test.testNS,
108+
veleroCfg.RegistryCredentialFile,
109+
veleroCfg.Features,
110+
veleroCfg.KibishiiDirectory,
111+
DefaultKibishiiData,
112+
veleroCfg.ImageRegistryProxy,
113+
)).To(Succeed())
106114
})
107115

108116
var BackupCfg BackupConfig

test/e2e/basic/backup-volume-info/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func (v *BackupVolumeInfo) CreateResources() error {
121121
volumeName := fmt.Sprintf("volume-info-pv-%d", i)
122122
vols = append(vols, CreateVolumes(pvc.Name, []string{volumeName})...)
123123
}
124-
deployment := NewDeployment(v.CaseBaseName, createNSName, 1, labels, nil).WithVolume(vols).Result()
124+
deployment := NewDeployment(v.CaseBaseName, createNSName, 1, labels, v.VeleroCfg.ImageRegistryProxy).WithVolume(vols).Result()
125125
deployment, err := CreateDeployment(v.Client.ClientGo, createNSName, deployment)
126126
if err != nil {
127127
return errors.Wrap(err, fmt.Sprintf("failed to delete the namespace %q", createNSName))

test/e2e/basic/namespace-mapping.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,17 @@ func (n *NamespaceMapping) CreateResources() error {
9191
Expect(CreateNamespace(n.Ctx, n.Client, ns)).To(Succeed(), fmt.Sprintf("Failed to create namespace %s", ns))
9292
})
9393
By("Deploy sample workload of Kibishii", func() {
94-
Expect(KibishiiPrepareBeforeBackup(n.Ctx, n.Client, n.VeleroCfg.CloudProvider,
95-
ns, n.VeleroCfg.RegistryCredentialFile, n.VeleroCfg.Features,
96-
n.VeleroCfg.KibishiiDirectory, false, n.kibishiiData)).To(Succeed())
94+
Expect(KibishiiPrepareBeforeBackup(
95+
n.Ctx,
96+
n.Client,
97+
n.VeleroCfg.CloudProvider,
98+
ns,
99+
n.VeleroCfg.RegistryCredentialFile,
100+
n.VeleroCfg.Features,
101+
n.VeleroCfg.KibishiiDirectory,
102+
n.kibishiiData,
103+
n.VeleroCfg.ImageRegistryProxy,
104+
)).To(Succeed())
97105
})
98106
}
99107
return nil

test/e2e/basic/pvc-selected-node-changing.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ func (p *PVCSelectedNodeChanging) CreateResources() error {
7575
p.oldNodeName = nodeName
7676
fmt.Printf("Create PVC on node %s\n", p.oldNodeName)
7777
pvcAnn := map[string]string{p.ann: nodeName}
78-
_, err := CreatePod(p.Client, p.namespace, p.podName, StorageClassName, p.pvcName, []string{p.volume}, pvcAnn, nil)
78+
_, err := CreatePod(p.Client, p.namespace, p.podName, StorageClassName, p.pvcName, []string{p.volume},
79+
pvcAnn, nil, p.VeleroCfg.ImageRegistryProxy)
7980
Expect(err).To(Succeed())
8081
err = WaitForPods(p.Ctx, p.Client, p.namespace, []string{p.podName})
8182
Expect(err).To(Succeed())

test/e2e/basic/storage-class-changing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (s *StorageClasssChanging) CreateResources() error {
8282
Expect(err).To(Succeed())
8383
vols := CreateVolumes(pvc.Name, []string{s.volume})
8484

85-
deployment := NewDeployment(s.CaseBaseName, s.namespace, 1, label, nil).WithVolume(vols).Result()
85+
deployment := NewDeployment(s.CaseBaseName, s.namespace, 1, label, s.VeleroCfg.ImageRegistryProxy).WithVolume(vols).Result()
8686
deployment, err = CreateDeployment(s.Client.ClientGo, s.namespace, deployment)
8787
Expect(err).To(Succeed())
8888
s.deploymentName = deployment.Name

test/e2e/bsl-mgmt/deletion.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,17 @@ func BslDeletionTest(useVolumeSnapshots bool) {
152152
})
153153

154154
By("Deploy sample workload of Kibishii", func() {
155-
Expect(KibishiiPrepareBeforeBackup(oneHourTimeout, *veleroCfg.ClientToInstallVelero, veleroCfg.CloudProvider,
156-
bslDeletionTestNs, veleroCfg.RegistryCredentialFile, veleroCfg.Features,
157-
veleroCfg.KibishiiDirectory, useVolumeSnapshots, DefaultKibishiiData)).To(Succeed())
155+
Expect(KibishiiPrepareBeforeBackup(
156+
oneHourTimeout,
157+
*veleroCfg.ClientToInstallVelero,
158+
veleroCfg.CloudProvider,
159+
bslDeletionTestNs,
160+
veleroCfg.RegistryCredentialFile,
161+
veleroCfg.Features,
162+
veleroCfg.KibishiiDirectory,
163+
DefaultKibishiiData,
164+
veleroCfg.ImageRegistryProxy,
165+
)).To(Succeed())
158166
})
159167

160168
// Restic can not backup PV only, so pod need to be labeled also

test/e2e/e2e_suite_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import (
5555

5656
func init() {
5757
test.VeleroCfg.Options = install.Options{}
58+
test.VeleroCfg.BackupRepoConfigMap = test.BackupRepositoryConfigName // Set to the default value
5859
flag.StringVar(
5960
&test.VeleroCfg.CloudProvider,
6061
"cloud-provider",
@@ -699,6 +700,8 @@ func TestE2e(t *testing.T) {
699700
t.FailNow()
700701
}
701702

703+
veleroutil.UpdateImagesMatrixByProxy(test.VeleroCfg.ImageRegistryProxy)
704+
702705
RegisterFailHandler(Fail)
703706
testSuitePassed = RunSpecs(t, "E2e Suite")
704707
}

test/e2e/migration/migration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ func (m *migrationE2E) Backup() error {
195195
OriginVeleroCfg.RegistryCredentialFile,
196196
OriginVeleroCfg.Features,
197197
OriginVeleroCfg.KibishiiDirectory,
198-
OriginVeleroCfg.UseVolumeSnapshots,
199198
&m.kibishiiData,
199+
OriginVeleroCfg.ImageRegistryProxy,
200200
)).To(Succeed())
201201
})
202202

test/e2e/parallelfilesdownload/parallel_files_download.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ func (p *ParallelFilesDownload) CreateResources() error {
9595
})
9696

9797
By(fmt.Sprintf("Create pod %s in namespace %s", p.pod, p.namespace), func() {
98-
_, err := CreatePod(p.Client, p.namespace, p.pod, StorageClassName, p.pvc, []string{p.volume}, nil, nil)
98+
_, err := CreatePod(p.Client, p.namespace, p.pod, StorageClassName, p.pvc, []string{p.volume},
99+
nil, nil, p.VeleroCfg.ImageRegistryProxy)
99100
Expect(err).To(Succeed())
100101
err = WaitForPods(p.Ctx, p.Client, p.namespace, []string{p.pod})
101102
Expect(err).To(Succeed())

0 commit comments

Comments
 (0)