Merge pull request #10035 from HajimohammadiNet/fix-install-plugin-spacing
Run the E2E test on kind / get-go-version (push) Failing after 1m0s
Run the E2E test on kind / build (push) Has been skipped
Run the E2E test on kind / setup-test-matrix (push) Successful in 3s
Run the E2E test on kind / run-e2e-test (push) Has been skipped
Main CI / get-go-version (push) Successful in 14s
Main CI / Build (push) Failing after 29s

Trim plugin image entries during install
This commit is contained in:
lyndon-li
2026-07-23 14:45:21 +08:00
committed by GitHub
3 changed files with 14 additions and 1 deletions
@@ -0,0 +1 @@
Trim whitespace around plugin image entries during install.
+4 -1
View File
@@ -139,7 +139,10 @@ func WithPodVolumeOperationTimeout(val time.Duration) podTemplateOption {
func WithPlugins(plugins []string) podTemplateOption {
return func(c *podTemplateConfig) {
c.plugins = plugins
c.plugins = make([]string, 0, len(plugins))
for _, plugin := range plugins {
c.plugins = append(c.plugins, strings.TrimSpace(plugin))
}
}
}
+9
View File
@@ -60,6 +60,15 @@ func TestDeployment(t *testing.T) {
assert.Len(t, deploy.Spec.Template.Spec.Containers[0].Args, 2)
assert.Equal(t, "--features=EnableCSI,foo,bar,baz", deploy.Spec.Template.Spec.Containers[0].Args[1])
deploy = Deployment("velero", WithPlugins([]string{
"harbor-repo.vmware.com/harbor-ci/velero/velero-plugin-for-aws:v1.2.0",
" \n vsphereveleroplugin/velero-plugin-for-vsphere:v1.1.1 ",
}))
assert.Len(t, deploy.Spec.Template.Spec.InitContainers, 2)
assert.Equal(t, "harbor-repo.vmware.com/harbor-ci/velero/velero-plugin-for-aws:v1.2.0", deploy.Spec.Template.Spec.InitContainers[0].Image)
assert.Equal(t, "vsphereveleroplugin/velero-plugin-for-vsphere:v1.1.1", deploy.Spec.Template.Spec.InitContainers[1].Image)
assert.Equal(t, "vsphereveleroplugin-velero-plugin-for-vsphere", deploy.Spec.Template.Spec.InitContainers[1].Name)
deploy = Deployment("velero", WithUploaderType("kopia"))
assert.Len(t, deploy.Spec.Template.Spec.Containers[0].Args, 2)
assert.Equal(t, "--uploader-type=kopia", deploy.Spec.Template.Spec.Containers[0].Args[1])