From bd7b2ed690bbd725e48661e70deaff03597aa86a Mon Sep 17 00:00:00 2001 From: AmirHossein HajiMohammadi Date: Sat, 18 Jul 2026 17:13:54 +0330 Subject: [PATCH 1/2] Trim plugin image entries during install Signed-off-by: AmirHossein HajiMohammadi --- pkg/install/deployment.go | 5 ++++- pkg/install/deployment_test.go | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/install/deployment.go b/pkg/install/deployment.go index 4ce4b5a4f..e9474f1fe 100644 --- a/pkg/install/deployment.go +++ b/pkg/install/deployment.go @@ -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)) + } } } diff --git a/pkg/install/deployment_test.go b/pkg/install/deployment_test.go index 53b696f72..0cfcb65dd 100644 --- a/pkg/install/deployment_test.go +++ b/pkg/install/deployment_test.go @@ -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]) From 10c238ab5ab624820efec86587b95274ec6eaea6 Mon Sep 17 00:00:00 2001 From: AmirHossein HajiMohammadi Date: Sat, 18 Jul 2026 17:14:43 +0330 Subject: [PATCH 2/2] Add changelog for plugin install spacing Signed-off-by: AmirHossein HajiMohammadi --- changelogs/unreleased/10035-HajimohammadiNet | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/10035-HajimohammadiNet diff --git a/changelogs/unreleased/10035-HajimohammadiNet b/changelogs/unreleased/10035-HajimohammadiNet new file mode 100644 index 000000000..2905938ab --- /dev/null +++ b/changelogs/unreleased/10035-HajimohammadiNet @@ -0,0 +1 @@ +Trim whitespace around plugin image entries during install.