Skip to content

Commit 958ff9b

Browse files
authored
Trim spaces when processing pull secrets (#844)
* Use DecodeStringToList helper in pull secret validation * Pull RCO/OLO main changes
1 parent 347171c commit 958ff9b

3 files changed

Lines changed: 7 additions & 14 deletions

File tree

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module github.com/WASdev/websphere-liberty-operator
33
go 1.26
44

55
require (
6-
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260306042107-9a3cb814041b
7-
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260306040218-27cdcb5746cc
6+
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260318175607-71d13b9b323b
7+
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260318005646-e267e0c1cb83
88
github.com/cert-manager/cert-manager v1.19.4
99
github.com/go-logr/logr v1.4.3
1010
github.com/openshift/api v0.0.0-20260304172252-b0658d22beea

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25
22
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
33
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
44
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
5-
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260306042107-9a3cb814041b h1:o5unu1VvLiU5nWBpAM6OQK4pbXWtituF4fQOU54j42M=
6-
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260306042107-9a3cb814041b/go.mod h1:tSb//wAqjTxjaIgyOWvFzgcqK9sMrAmb/S+kKVhM6Pc=
5+
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260318175607-71d13b9b323b h1:JUGDXCIxlOv3W1uok+HtrAP/Cv2u72s4Gg1g3lXBWfo=
6+
github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260318175607-71d13b9b323b/go.mod h1:9GqB6Xd1fcN2fg4Rp1pVUfxaUMZwaYJGKy+aHxAlGJE=
77
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
88
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
9-
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260306040218-27cdcb5746cc h1:fJrVk29GiL/ByZojqoNpx3tM9SkS1lu9PMAv24nunDM=
10-
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260306040218-27cdcb5746cc/go.mod h1:rTQgc/5LX8KQLlKezkrMTTyRA8puWTiccXCDxaPa8AM=
9+
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260318005646-e267e0c1cb83 h1:3klPsgrcfp52ZV8oIfof+40B6tym9PKAFstQupORB8o=
10+
github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260318005646-e267e0c1cb83/go.mod h1:rTQgc/5LX8KQLlKezkrMTTyRA8puWTiccXCDxaPa8AM=
1111
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
1212
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
1313
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=

internal/controller/webspherelibertyapplication_controller.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,15 +1160,8 @@ func (r *ReconcileWebSphereLiberty) getContainerImageMetadata(reqLogger logr.Log
11601160
wlappSecrets := []corev1.Secret{}
11611161
var pullSecret *corev1.Secret
11621162
if wlapp.GetPullSecret() != nil {
1163-
pullSecretString := strings.TrimSpace(*wlapp.GetPullSecret())
1164-
pullSecretNames := []string{}
1165-
if strings.Contains(pullSecretString, ",") {
1166-
pullSecretNames = strings.Split(pullSecretString, ",")
1167-
} else {
1168-
pullSecretNames = append(pullSecretNames, pullSecretString)
1169-
}
1163+
pullSecretNames := oputils.DecodeStringToList(*wlapp.GetPullSecret())
11701164
for _, pullSecretName := range pullSecretNames {
1171-
pullSecretName = strings.TrimSpace(pullSecretName)
11721165
pullSecret = &corev1.Secret{}
11731166
if err := r.GetClient().Get(context.TODO(), types.NamespacedName{Name: pullSecretName, Namespace: wlapp.GetNamespace()}, pullSecret); err != nil {
11741167
if kerrors.IsNotFound(err) {

0 commit comments

Comments
 (0)