diff --git a/api/v1/webspherelibertyapplication_types.go b/api/v1/webspherelibertyapplication_types.go index a3eb7551..d3a02bf7 100644 --- a/api/v1/webspherelibertyapplication_types.go +++ b/api/v1/webspherelibertyapplication_types.go @@ -419,6 +419,10 @@ type WebSphereLibertyApplicationService struct { // Configure service session affinity. // +operator-sdk:csv:customresourcedefinitions:order=19,type=spec SessionAffinity *WebSphereLibertyApplicationServiceSessionAffinity `json:"sessionAffinity,omitempty"` + + // Disables topology aware annotations from being added to the Service. Defaults to false. + // +operator-sdk:csv:customresourcedefinitions:order=20,type=spec,displayName="Disable Topology",xDescriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch" + DisableTopology *bool `json:"disableTopology,omitempty"` } // Configure service session affinity @@ -929,6 +933,14 @@ func (cr *WebSphereLibertyApplication) GetManageTLS() *bool { return cr.Spec.ManageTLS } +// GetDisableTopology returns whether topology annotations are disabled for the service +func (cr *WebSphereLibertyApplication) GetDisableTopology() *bool { + if cr.Spec.Service != nil { + return cr.Spec.Service.DisableTopology + } + return nil +} + // GetEnv returns slice of environment variables func (cr *WebSphereLibertyApplication) GetEnv() []corev1.EnvVar { return cr.Spec.Env diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 6d58e270..3330dcaa 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -771,6 +771,11 @@ func (in *WebSphereLibertyApplicationService) DeepCopyInto(out *WebSphereLiberty *out = new(WebSphereLibertyApplicationServiceSessionAffinity) (*in).DeepCopyInto(*out) } + if in.DisableTopology != nil { + in, out := &in.DisableTopology, &out.DisableTopology + *out = new(bool) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebSphereLibertyApplicationService. diff --git a/bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml b/bundle/manifests/ibm-websphere-liberty.clusterserviceversion.yaml index 35759a40..bfab607a 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: "2026-02-24T19:17:00Z" description: Deploy and manage containerized Liberty applications features.operators.openshift.io/disconnected: "true" olm.skipRange: '>=1.0.0 <1.5.2' @@ -386,6 +386,12 @@ spec: compilation requests from the application. displayName: Semeru Cloud Compiler path: semeruCloudCompiler + - description: Disables topology aware annotations from being added to the Service. + Defaults to false. + displayName: Disable Topology + path: service.disableTopology + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - description: Setting to maintain session affinity. Must be ClientIP or None. Defaults to None. displayName: Session Affinity Type diff --git a/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml b/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml index f58e99f4..1aa5e90a 100644 --- a/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml +++ b/bundle/manifests/liberty.websphere.ibm.com_webspherelibertyapplications.yaml @@ -5321,6 +5321,10 @@ spec: certificate and CA to be mounted in the pod. The following keys are valid in the secret: ca.crt, tls.crt, and tls.key.' type: string + disableTopology: + description: Disables topology aware annotations from being added + to the Service. Defaults to false. + type: boolean nodePort: description: Node proxies this port into your service. format: int32 diff --git a/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml b/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml index 434ae40f..f04e0897 100644 --- a/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml +++ b/config/crd/bases/liberty.websphere.ibm.com_webspherelibertyapplications.yaml @@ -5317,6 +5317,10 @@ spec: certificate and CA to be mounted in the pod. The following keys are valid in the secret: ca.crt, tls.crt, and tls.key.' type: string + disableTopology: + description: Disables topology aware annotations from being added + to the Service. Defaults to false. + type: boolean nodePort: description: Node proxies this port into your service. format: int32 diff --git a/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml b/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml index c99b2283..7580d403 100644 --- a/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml +++ b/config/manifests/bases/ibm-websphere-liberty.clusterserviceversion.yaml @@ -322,6 +322,12 @@ spec: compilation requests from the application. displayName: Semeru Cloud Compiler path: semeruCloudCompiler + - description: Disables topology aware annotations from being added to the Service. + Defaults to false. + displayName: Disable Topology + path: service.disableTopology + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:booleanSwitch - description: Setting to maintain session affinity. Must be ClientIP or None. Defaults to None. displayName: Session Affinity Type diff --git a/go.mod b/go.mod index e6d9b528..38aa4c54 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.20251124214343-4fee1b0d8d1e - github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20251120112423-05f65c81aa36 + github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260219153907-af11c5cbb3c1 + github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260219135930-1ec2ade9b9fe 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..4ae70e34 100644 --- a/go.sum +++ b/go.sum @@ -4,10 +4,14 @@ 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.20260219153907-af11c5cbb3c1 h1:NBjUzphdFgTZif5vqE5ywoN9sBy25JhL3vAg/jYJL+A= +github.com/OpenLiberty/open-liberty-operator v0.8.1-0.20260219153907-af11c5cbb3c1/go.mod h1:CB+RG8pXFsfQ9kYzbCyDDBmLekY1KDvyqOzDvRtDoU0= 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.20260219135930-1ec2ade9b9fe h1:m4tVFVOSveGaJpPi39n6cwvZvZcypEj2lNhRd5CiviU= +github.com/application-stacks/runtime-component-operator v1.0.0-20220602-0850.0.20260219135930-1ec2ade9b9fe/go.mod h1:pmfannSJv1Tby0uSPXLPg3A+mC1WahsMJTNa2oU3SHk= 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= diff --git a/internal/controller/semeru_compiler.go b/internal/controller/semeru_compiler.go index 795c0590..df42e4a5 100644 --- a/internal/controller/semeru_compiler.go +++ b/internal/controller/semeru_compiler.go @@ -416,7 +416,7 @@ func reconcileSemeruService(svc *corev1.Service, wlva *wlv1.WebSphereLibertyAppl var timeout int32 = 86400 svc.Labels = getLabels(wlva) svc.Spec.Selector = getSelectors(wlva) - utils.CustomizeServiceAnnotations(svc) + utils.CustomizeServiceAnnotations(svc, wlva.GetDisableTopology()) if len(svc.Spec.Ports) == 0 { svc.Spec.Ports = append(svc.Spec.Ports, corev1.ServicePort{}) } diff --git a/internal/deploy/kubectl/websphereliberty-app-crd.yaml b/internal/deploy/kubectl/websphereliberty-app-crd.yaml index bebf6299..a44becc8 100644 --- a/internal/deploy/kubectl/websphereliberty-app-crd.yaml +++ b/internal/deploy/kubectl/websphereliberty-app-crd.yaml @@ -5320,6 +5320,10 @@ spec: certificate and CA to be mounted in the pod. The following keys are valid in the secret: ca.crt, tls.crt, and tls.key.' type: string + disableTopology: + description: Disables topology aware annotations from being added + to the Service. Defaults to false. + type: boolean nodePort: description: Node proxies this port into your service. format: int32 diff --git a/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml b/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml index bebf6299..a44becc8 100644 --- a/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml +++ b/internal/deploy/kustomize/daily/base/websphere-liberty-crd.yaml @@ -5320,6 +5320,10 @@ spec: certificate and CA to be mounted in the pod. The following keys are valid in the secret: ca.crt, tls.crt, and tls.key.' type: string + disableTopology: + description: Disables topology aware annotations from being added + to the Service. Defaults to false. + type: boolean nodePort: description: Node proxies this port into your service. format: int32