Files
EninandMike Ng 3c9dc03159 Add imagePullSecrets support to cluster-manager helm chart (#1539)
* Add configurable image pull secrets to cluster-manager
Allow referencing existing pull secrets via images.imagePullSecrets in the
cluster-manager Helm chart. Propagate the configured secret name to hub
components through the operator --image-pull-secret-name flag, including
cluster importer renderers and registration controller RBAC.

Signed-off-by: Enin <enin.kaduk@docker.com>

* Require .name if imagePullSecrets is set, trim ws in normalization of imagePullSecrets

Signed-off-by: Enin <enin.kaduk@docker.com>

* update-csv

Signed-off-by: Mike Ng <ming@redhat.com>

---------

Signed-off-by: Enin <enin.kaduk@docker.com>
Signed-off-by: Mike Ng <ming@redhat.com>
Co-authored-by: Mike Ng <ming@redhat.com>
2026-07-09 06:03:57 +00:00

35 lines
702 B
Go

package clustermanager
import (
"testing"
"open-cluster-management.io/ocm/pkg/operator/helpers"
)
func TestImagePullSecretNameFromOptions(t *testing.T) {
cases := []struct {
name string
options Options
expected string
}{
{
name: "default when unset",
options: Options{},
expected: helpers.ImagePullSecret,
},
{
name: "custom secret name",
options: Options{ImagePullSecretName: "my-registry-secret"},
expected: "my-registry-secret",
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
if got := imagePullSecretNameFromOptions(&c.options); got != c.expected {
t.Fatalf("expected %q, got %q", c.expected, got)
}
})
}
}