From 22a464af0fdbd688de0d7360dff8325a01bee1a5 Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Thu, 4 Dec 2025 13:07:02 -0500 Subject: [PATCH 1/4] Pull runtime-component-operator@host-alias --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e6d9b528..6a2af7a4 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25 require ( github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251124214343-4fee1b0d8d1e - github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36 + github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589 github.com/cert-manager/cert-manager v1.16.5 github.com/go-logr/logr v1.4.3 github.com/openshift/api v0.0.0-20250710004639-926605d3338b diff --git a/go.sum b/go.sum index 3f989cd0..f9fdb6e7 100644 --- a/go.sum +++ b/go.sum @@ -8,6 +8,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36 h1:fweyU4TX3vSrbWecLy6FYjIgnoybPdoJbOiZsoV+iDw= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589 h1:oURgG664at9aK0yhgarnQVWwo7Sw9uGjnoN9LsA9b2Y= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= From cff299a475fdd7e00dd0a7b4cbb23dcaf7997d64 Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Thu, 4 Dec 2025 16:43:38 -0500 Subject: [PATCH 2/4] Pull open-liberty-operator@host-alias --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6a2af7a4..10064a2e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/WASdev/websphere-liberty-operator go 1.25 require ( - github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251124214343-4fee1b0d8d1e + github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251204214137-5ca60f4cd9b2 github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589 github.com/cert-manager/cert-manager v1.16.5 github.com/go-logr/logr v1.4.3 From 1d1c80d73a0117c380e9f06dc9cf7fac33c23deb Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Thu, 4 Dec 2025 16:44:15 -0500 Subject: [PATCH 3/4] Implement .spec.hostAliases --- api/v1/webspherelibertyapplication_types.go | 8 +++++++ api/v1/zz_generated.deepcopy.go | 7 +++++++ ...bsphere-liberty.clusterserviceversion.yaml | 6 +++++- ....ibm.com_webspherelibertyapplications.yaml | 21 +++++++++++++++++++ ....ibm.com_webspherelibertyapplications.yaml | 21 +++++++++++++++++++ ...bsphere-liberty.clusterserviceversion.yaml | 4 ++++ go.sum | 2 ++ .../kubectl/websphereliberty-app-crd.yaml | 21 +++++++++++++++++++ .../daily/base/websphere-liberty-crd.yaml | 21 +++++++++++++++++++ 9 files changed, 110 insertions(+), 1 deletion(-) diff --git a/api/v1/webspherelibertyapplication_types.go b/api/v1/webspherelibertyapplication_types.go index a3eb7551..bd0b1547 100644 --- a/api/v1/webspherelibertyapplication_types.go +++ b/api/v1/webspherelibertyapplication_types.go @@ -185,6 +185,10 @@ type WebSphereLibertyApplicationSpec struct { // DNS settings for the application pod. // +operator-sdk:csv:customresourcedefinitions:order=36,type=spec,displayName="DNS" DNS *WebSphereLibertyApplicationDNS `json:"dns,omitempty"` + + // The list of hosts and IPs that will be inejcted into the application pod's hosts file + // +operator-sdk:csv:customresourcedefinitions:order=37,type=spec,displayName="Host Aliases" + HostAliases []corev1.HostAlias `json:"hostAliases,omitempty"` } // Defines the DNS @@ -1417,6 +1421,10 @@ func (d *WebSphereLibertyApplicationDNS) GetConfig() *corev1.PodDNSConfig { return d.PodDNSConfig } +func (cr *WebSphereLibertyApplication) GetHostAliases() []corev1.HostAlias { + return cr.Spec.HostAliases +} + // Initialize sets default values func (cr *WebSphereLibertyApplication) Initialize() { if cr.Spec.PullPolicy == nil { diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 6d58e270..1da14817 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1036,6 +1036,13 @@ func (in *WebSphereLibertyApplicationSpec) DeepCopyInto(out *WebSphereLibertyApp *out = new(WebSphereLibertyApplicationDNS) (*in).DeepCopyInto(*out) } + if in.HostAliases != nil { + in, out := &in.HostAliases, &out.HostAliases + *out = make([]corev1.HostAlias, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebSphereLibertyApplicationSpec. diff --git a/bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml b/bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml index 35759a40..47d32a9e 100644 --- a/bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml +++ b/bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml @@ -67,7 +67,7 @@ metadata: capabilities: Auto Pilot categories: Application Runtime containerImage: icr.io/cpopen/websphere-liberty-operator:daily - createdAt: "2025-12-03T04:52:57Z" + createdAt: "2025-12-04T21:43:47Z" description: Deploy and manage containerized Liberty applications features.operators.openshift.io/disconnected: "true" olm.skipRange: '>=1.0.0 <1.5.2' @@ -496,6 +496,10 @@ spec: path: affinity.nodeAffinity x-descriptors: - urn:alm:descriptor:com.tectonic.ui:nodeAffinity + - description: The list of hosts and IPs that will be inejcted into the application + pod's hosts file + displayName: Host Aliases + path: hostAliases - description: Controls the nodes the pod are scheduled to run on, based on labels on the pods that are already running on the node. displayName: Pod Affinity diff --git a/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml b/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml index f58e99f4..ea27ad02 100644 --- a/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml +++ b/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml @@ -1986,6 +1986,27 @@ spec: description: Expose the application externally via a Route, a Knative Route or an Ingress resource. type: boolean + hostAliases: + description: The list of hosts and IPs that will be inejcted into + the application pod's hosts file + items: + description: |- + HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the + pod's hosts file. + properties: + hostnames: + description: Hostnames for the above IP address. + items: + type: string + type: array + x-kubernetes-list-type: atomic + ip: + description: IP address of the host file entry. + type: string + required: + - ip + type: object + type: array initContainers: description: List of containers to run before other containers in a pod. diff --git a/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml b/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml index 434ae40f..7e221918 100644 --- a/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml +++ b/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml @@ -1982,6 +1982,27 @@ spec: description: Expose the application externally via a Route, a Knative Route or an Ingress resource. type: boolean + hostAliases: + description: The list of hosts and IPs that will be inejcted into + the application pod's hosts file + items: + description: |- + HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the + pod's hosts file. + properties: + hostnames: + description: Hostnames for the above IP address. + items: + type: string + type: array + x-kubernetes-list-type: atomic + ip: + description: IP address of the host file entry. + type: string + required: + - ip + type: object + type: array initContainers: description: List of containers to run before other containers in a pod. diff --git a/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml b/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml index c99b2283..e48a65c0 100644 --- a/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml +++ b/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml @@ -432,6 +432,10 @@ spec: path: affinity.nodeAffinity x-descriptors: - urn:alm:descriptor:com.tectonic.ui:nodeAffinity + - description: The list of hosts and IPs that will be inejcted into the application + pod's hosts file + displayName: Host Aliases + path: hostAliases - description: Controls the nodes the pod are scheduled to run on, based on labels on the pods that are already running on the node. displayName: Pod Affinity diff --git a/go.sum b/go.sum index f9fdb6e7..5c441f0b 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251124214343-4fee1b0d8d1e h1:7pCncY3KcsAge1E1E9tYo1ZM2bcfsg7dJ4XLKraVmkI= github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251124214343-4fee1b0d8d1e/go.mod h1:ghwA2Fvfq6YphR93lp8vKEJ7mLYT1+sEvI6re16Kn0c= +github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251204214137-5ca60f4cd9b2 h1:ilDDB59Pg5LbvCJie1ngYlA5b5E2rgvXUrqqxOj3Yxw= +github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251204214137-5ca60f4cd9b2/go.mod h1:EhcP2pLDj4DYAfmIkEbr58G8TWoMjjiGnym1SRWPjEo= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36 h1:fweyU4TX3vSrbWecLy6FYjIgnoybPdoJbOiZsoV+iDw= diff --git a/internal/deploy/kubectl/websphereliberty-app-crd.yaml b/internal/deploy/kubectl/websphereliberty-app-crd.yaml index bebf6299..fd2ba4b6 100644 --- a/internal/deploy/kubectl/websphereliberty-app-crd.yaml +++ b/internal/deploy/kubectl/websphereliberty-app-crd.yaml @@ -1985,6 +1985,27 @@ spec: description: Expose the application externally via a Route, a Knative Route or an Ingress resource. type: boolean + hostAliases: + description: The list of hosts and IPs that will be inejcted into + the application pod's hosts file + items: + description: |- + HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the + pod's hosts file. + properties: + hostnames: + description: Hostnames for the above IP address. + items: + type: string + type: array + x-kubernetes-list-type: atomic + ip: + description: IP address of the host file entry. + type: string + required: + - ip + type: object + type: array initContainers: description: List of containers to run before other containers in a pod. diff --git a/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml b/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml index bebf6299..fd2ba4b6 100644 --- a/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml +++ b/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml @@ -1985,6 +1985,27 @@ spec: description: Expose the application externally via a Route, a Knative Route or an Ingress resource. type: boolean + hostAliases: + description: The list of hosts and IPs that will be inejcted into + the application pod's hosts file + items: + description: |- + HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the + pod's hosts file. + properties: + hostnames: + description: Hostnames for the above IP address. + items: + type: string + type: array + x-kubernetes-list-type: atomic + ip: + description: IP address of the host file entry. + type: string + required: + - ip + type: object + type: array initContainers: description: List of containers to run before other containers in a pod. From c5380ed5de368553f223dff6c8e0e5dc970c8c87 Mon Sep 17 00:00:00 2001 From: Kirby Chin <37311900+kabicin@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:24:21 -0500 Subject: [PATCH 4/4] Set pointer to host aliases --- api/v1/webspherelibertyapplication_types.go | 4 ++-- api/v1/zz_generated.deepcopy.go | 10 +++++++--- go.mod | 4 ++-- go.sum | 4 ++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/api/v1/webspherelibertyapplication_types.go b/api/v1/webspherelibertyapplication_types.go index bd0b1547..7676e592 100644 --- a/api/v1/webspherelibertyapplication_types.go +++ b/api/v1/webspherelibertyapplication_types.go @@ -188,7 +188,7 @@ type WebSphereLibertyApplicationSpec struct { // The list of hosts and IPs that will be inejcted into the application pod's hosts file // +operator-sdk:csv:customresourcedefinitions:order=37,type=spec,displayName="Host Aliases" - HostAliases []corev1.HostAlias `json:"hostAliases,omitempty"` + HostAliases *[]corev1.HostAlias `json:"hostAliases,omitempty"` } // Defines the DNS @@ -1421,7 +1421,7 @@ func (d *WebSphereLibertyApplicationDNS) GetConfig() *corev1.PodDNSConfig { return d.PodDNSConfig } -func (cr *WebSphereLibertyApplication) GetHostAliases() []corev1.HostAlias { +func (cr *WebSphereLibertyApplication) GetHostAliases() *[]corev1.HostAlias { return cr.Spec.HostAliases } diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 1da14817..51139e67 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1038,9 +1038,13 @@ func (in *WebSphereLibertyApplicationSpec) DeepCopyInto(out *WebSphereLibertyApp } if in.HostAliases != nil { in, out := &in.HostAliases, &out.HostAliases - *out = make([]corev1.HostAlias, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + *out = new([]corev1.HostAlias) + if **in != nil { + in, out := *in, *out + *out = make([]corev1.HostAlias, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } } } diff --git a/go.mod b/go.mod index 10064a2e..18117b40 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/WASdev/websphere-liberty-operator go 1.25 require ( - github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251204214137-5ca60f4cd9b2 - github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589 + github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251205192201-a970b41cd059 + github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251205191742-7d2acc4b2262 github.com/cert-manager/cert-manager v1.16.5 github.com/go-logr/logr v1.4.3 github.com/openshift/api v0.0.0-20250710004639-926605d3338b diff --git a/go.sum b/go.sum index 5c441f0b..0955c0bd 100644 --- a/go.sum +++ b/go.sum @@ -6,12 +6,16 @@ github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251124214343-4fee1b0d8d1 github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251124214343-4fee1b0d8d1e/go.mod h1:ghwA2Fvfq6YphR93lp8vKEJ7mLYT1+sEvI6re16Kn0c= github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251204214137-5ca60f4cd9b2 h1:ilDDB59Pg5LbvCJie1ngYlA5b5E2rgvXUrqqxOj3Yxw= github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251204214137-5ca60f4cd9b2/go.mod h1:EhcP2pLDj4DYAfmIkEbr58G8TWoMjjiGnym1SRWPjEo= +github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251205192201-a970b41cd059 h1:gOlnFOcC6kwV91hoUhYERYLF6o+pZd048WZgMvK05vc= +github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20251205192201-a970b41cd059/go.mod h1:NSTbyXbAcZws1HiAaShAnJRhAkZeowXXXGZ6008GyRk= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36 h1:fweyU4TX3vSrbWecLy6FYjIgnoybPdoJbOiZsoV+iDw= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589 h1:oURgG664at9aK0yhgarnQVWwo7Sw9uGjnoN9LsA9b2Y= github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251204180254-1ccb32f60589/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251205191742-7d2acc4b2262 h1:EIG09vyeKaj4v3WjOvc+xRvvmeo4OLyWyOyYACT+oEE= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251205191742-7d2acc4b2262/go.mod h1:Hs5AbE9J+rLM34IAc75X7dtxnrzFg2AvG1XYLcX/ApU= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=