diff --git a/api/core/v1alpha1/apiserver_types.go b/api/core/v1alpha1/apiserver_types.go index d3c3132..3a45c42 100644 --- a/api/core/v1alpha1/apiserver_types.go +++ b/api/core/v1alpha1/apiserver_types.go @@ -71,7 +71,7 @@ type APIServerStatus struct { CommonComponentStatus `json:",inline"` // ExternalAPIServerStatus contains the status of the external API server - *ExternalAPIServerStatus `json:",inline"` + ExternalAPIServerStatus `json:",inline"` // AdminAccess is an admin kubeconfig for accessing the API server. // +optional diff --git a/api/core/v1alpha1/authentication_types.go b/api/core/v1alpha1/authentication_types.go index 6c7f3ce..6bcfaf7 100644 --- a/api/core/v1alpha1/authentication_types.go +++ b/api/core/v1alpha1/authentication_types.go @@ -40,8 +40,8 @@ type ExternalAuthenticationStatus struct { // AuthenticationStatus contains the status of the authentication component type AuthenticationStatus struct { - CommonComponentStatus `json:",inline"` - *ExternalAuthenticationStatus `json:",inline"` + CommonComponentStatus `json:",inline"` + ExternalAuthenticationStatus `json:",inline"` } // IdentityProvider contains the configuration for an OpenID Connect identity provider diff --git a/api/core/v1alpha1/authorization_types.go b/api/core/v1alpha1/authorization_types.go index 6255e3e..924abc1 100644 --- a/api/core/v1alpha1/authorization_types.go +++ b/api/core/v1alpha1/authorization_types.go @@ -113,7 +113,7 @@ type ExternalAuthorizationStatus struct { type AuthorizationStatus struct { CommonComponentStatus `json:",inline"` // ExternalAuthorizationStatus contains the status of the external authorization component - *ExternalAuthorizationStatus `json:",inline"` + ExternalAuthorizationStatus `json:",inline"` // UserNamespaces is a list of namespaces that have been created by the user and // must be managed by the authorization component. diff --git a/api/core/v1alpha1/cloudorchestrator_types.go b/api/core/v1alpha1/cloudorchestrator_types.go index f37d551..2390bbc 100644 --- a/api/core/v1alpha1/cloudorchestrator_types.go +++ b/api/core/v1alpha1/cloudorchestrator_types.go @@ -38,8 +38,8 @@ type ExternalCloudOrchestratorStatus struct { // CloudOrchestratorStatus defines the observed state of CloudOrchestrator type CloudOrchestratorStatus struct { - CommonComponentStatus `json:",inline"` - *ExternalCloudOrchestratorStatus `json:",inline"` + CommonComponentStatus `json:",inline"` + ExternalCloudOrchestratorStatus `json:",inline"` // Number of enabled components. // +kubebuilder:validation:Optional diff --git a/api/core/v1alpha1/landscaper_types.go b/api/core/v1alpha1/landscaper_types.go index 9b3a842..09c1333 100644 --- a/api/core/v1alpha1/landscaper_types.go +++ b/api/core/v1alpha1/landscaper_types.go @@ -17,8 +17,8 @@ type ExternalLandscaperStatus struct { // LandscaperStatus contains the landscaper status and potentially other fields which should not be exposed to the customer. type LandscaperStatus struct { - CommonComponentStatus `json:",inline"` - *ExternalLandscaperStatus `json:",inline"` + CommonComponentStatus `json:",inline"` + ExternalLandscaperStatus `json:",inline"` // LandscaperDeploymentInfo contains information about the corresponding LandscaperDeployment resource. // +optional diff --git a/api/core/v1alpha1/zz_generated.deepcopy.go b/api/core/v1alpha1/zz_generated.deepcopy.go index e7aa341..5425de6 100644 --- a/api/core/v1alpha1/zz_generated.deepcopy.go +++ b/api/core/v1alpha1/zz_generated.deepcopy.go @@ -160,11 +160,7 @@ func (in *APIServerSpec) DeepCopy() *APIServerSpec { func (in *APIServerStatus) DeepCopyInto(out *APIServerStatus) { *out = *in in.CommonComponentStatus.DeepCopyInto(&out.CommonComponentStatus) - if in.ExternalAPIServerStatus != nil { - in, out := &in.ExternalAPIServerStatus, &out.ExternalAPIServerStatus - *out = new(ExternalAPIServerStatus) - **out = **in - } + out.ExternalAPIServerStatus = in.ExternalAPIServerStatus if in.AdminAccess != nil { in, out := &in.AdminAccess, &out.AdminAccess *out = new(APIServerAccess) @@ -310,11 +306,7 @@ func (in *AuthenticationSpec) DeepCopy() *AuthenticationSpec { func (in *AuthenticationStatus) DeepCopyInto(out *AuthenticationStatus) { *out = *in in.CommonComponentStatus.DeepCopyInto(&out.CommonComponentStatus) - if in.ExternalAuthenticationStatus != nil { - in, out := &in.ExternalAuthenticationStatus, &out.ExternalAuthenticationStatus - *out = new(ExternalAuthenticationStatus) - (*in).DeepCopyInto(*out) - } + in.ExternalAuthenticationStatus.DeepCopyInto(&out.ExternalAuthenticationStatus) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthenticationStatus. @@ -428,11 +420,7 @@ func (in *AuthorizationSpec) DeepCopy() *AuthorizationSpec { func (in *AuthorizationStatus) DeepCopyInto(out *AuthorizationStatus) { *out = *in in.CommonComponentStatus.DeepCopyInto(&out.CommonComponentStatus) - if in.ExternalAuthorizationStatus != nil { - in, out := &in.ExternalAuthorizationStatus, &out.ExternalAuthorizationStatus - *out = new(ExternalAuthorizationStatus) - **out = **in - } + out.ExternalAuthorizationStatus = in.ExternalAuthorizationStatus if in.UserNamespaces != nil { in, out := &in.UserNamespaces, &out.UserNamespaces *out = make([]string, len(*in)) @@ -611,11 +599,7 @@ func (in *CloudOrchestratorSpec) DeepCopy() *CloudOrchestratorSpec { func (in *CloudOrchestratorStatus) DeepCopyInto(out *CloudOrchestratorStatus) { *out = *in in.CommonComponentStatus.DeepCopyInto(&out.CommonComponentStatus) - if in.ExternalCloudOrchestratorStatus != nil { - in, out := &in.ExternalCloudOrchestratorStatus, &out.ExternalCloudOrchestratorStatus - *out = new(ExternalCloudOrchestratorStatus) - **out = **in - } + out.ExternalCloudOrchestratorStatus = in.ExternalCloudOrchestratorStatus } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudOrchestratorStatus. @@ -1337,11 +1321,7 @@ func (in *LandscaperSpec) DeepCopy() *LandscaperSpec { func (in *LandscaperStatus) DeepCopyInto(out *LandscaperStatus) { *out = *in in.CommonComponentStatus.DeepCopyInto(&out.CommonComponentStatus) - if in.ExternalLandscaperStatus != nil { - in, out := &in.ExternalLandscaperStatus, &out.ExternalLandscaperStatus - *out = new(ExternalLandscaperStatus) - **out = **in - } + out.ExternalLandscaperStatus = in.ExternalLandscaperStatus if in.LandscaperDeploymentInfo != nil { in, out := &in.LandscaperDeploymentInfo, &out.LandscaperDeploymentInfo *out = new(LandscaperDeploymentInfo) diff --git a/api/go.mod b/api/go.mod index a3f47a1..6ee8fb9 100644 --- a/api/go.mod +++ b/api/go.mod @@ -11,14 +11,13 @@ require ( k8s.io/apimachinery v0.34.0 k8s.io/client-go v0.34.0 k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d - sigs.k8s.io/controller-runtime v0.21.0 + sigs.k8s.io/controller-runtime v0.22.0 sigs.k8s.io/yaml v1.6.0 ) require ( github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/blang/semver/v4 v4.0.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/emicklei/go-restful/v3 v3.12.2 // indirect diff --git a/api/go.sum b/api/go.sum index d3b7235..ce47d9e 100644 --- a/api/go.sum +++ b/api/go.sum @@ -2,8 +2,6 @@ github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1 github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -186,8 +184,8 @@ k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOP k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0= k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= -sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM= +sigs.k8s.io/controller-runtime v0.22.0 h1:mTOfibb8Hxwpx3xEkR56i7xSjB+nH4hZG37SrlCY5e0= +sigs.k8s.io/controller-runtime v0.22.0/go.mod h1:FwiwRjkRPbiN+zp2QRp7wlTCzbUXxZ/D4OzuQUDwBHY= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg= sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU= diff --git a/go.mod b/go.mod index ba12a52..e67d8dd 100644 --- a/go.mod +++ b/go.mod @@ -29,7 +29,7 @@ require ( k8s.io/apimachinery v0.34.0 k8s.io/client-go v0.34.0 k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d - sigs.k8s.io/controller-runtime v0.21.0 + sigs.k8s.io/controller-runtime v0.22.0 sigs.k8s.io/yaml v1.6.0 ) diff --git a/go.sum b/go.sum index fdb562f..d50e85b 100644 --- a/go.sum +++ b/go.sum @@ -8,9 +8,6 @@ github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4t github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= @@ -266,8 +263,8 @@ k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b h1:MloQ9/bdJyIu9lb1PzujOP k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b/go.mod h1:UZ2yyWbFTpuhSbFhv24aGNOdoRdJZgsIObGBUaYVsts= k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d h1:wAhiDyZ4Tdtt7e46e9M5ZSAJ/MnPGPs+Ki1gHw4w1R0= k8s.io/utils v0.0.0-20250820121507-0af2bda4dd1d/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -sigs.k8s.io/controller-runtime v0.21.0 h1:CYfjpEuicjUecRk+KAeyYh+ouUBn4llGyDYytIGcJS8= -sigs.k8s.io/controller-runtime v0.21.0/go.mod h1:OSg14+F65eWqIu4DceX7k/+QRAbTTvxeQSNSOQpukWM= +sigs.k8s.io/controller-runtime v0.22.0 h1:mTOfibb8Hxwpx3xEkR56i7xSjB+nH4hZG37SrlCY5e0= +sigs.k8s.io/controller-runtime v0.22.0/go.mod h1:FwiwRjkRPbiN+zp2QRp7wlTCzbUXxZ/D4OzuQUDwBHY= sigs.k8s.io/controller-tools v0.16.5 h1:5k9FNRqziBPwqr17AMEPPV/En39ZBplLAdOwwQHruP4= sigs.k8s.io/controller-tools v0.16.5/go.mod h1:8vztuRVzs8IuuJqKqbXCSlXcw+lkAv/M2sTpg55qjMY= sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 h1:gBQPwqORJ8d8/YNZWEjoZs7npUVDpVXUUOFfW6CgAqE= diff --git a/internal/components/apiserver.go b/internal/components/apiserver.go index 5c80e22..6577f4c 100644 --- a/internal/components/apiserver.go +++ b/internal/components/apiserver.go @@ -45,7 +45,7 @@ func (*APIServerConverter) ConvertToResourceSpec(mcp *openmcpv1alpha1.ManagedCon // InjectStatus implements ComponentConverter. func (*APIServerConverter) InjectStatus(raw any, mcpStatus *openmcpv1alpha1.ManagedControlPlaneStatus) error { - status, ok := raw.(*openmcpv1alpha1.ExternalAPIServerStatus) + status, ok := raw.(openmcpv1alpha1.ExternalAPIServerStatus) if !ok { return openmcperrors.ErrWrongComponentStatusType } diff --git a/internal/components/apiserver_test.go b/internal/components/apiserver_test.go index 6c1de5d..0b42d4d 100644 --- a/internal/components/apiserver_test.go +++ b/internal/components/apiserver_test.go @@ -112,14 +112,14 @@ var _ = Describe("APIServerConverter", func() { Context("InjectStatus", func() { It("should inject the status", func() { conv := &components.APIServerConverter{} - status := &openmcpv1alpha1.ExternalAPIServerStatus{} + status := openmcpv1alpha1.ExternalAPIServerStatus{} mcpStatus := &openmcpv1alpha1.ManagedControlPlaneStatus{} err := conv.InjectStatus(status, mcpStatus) Expect(err).ToNot(HaveOccurred()) Expect(mcpStatus.Components.APIServer).ToNot(BeNil()) - Expect(mcpStatus.Components.APIServer).To(Equal(status)) + Expect(*mcpStatus.Components.APIServer).To(Equal(status)) }) It("should not inject an incompatible status", func() { diff --git a/internal/components/authentication.go b/internal/components/authentication.go index c28c751..005bcf8 100644 --- a/internal/components/authentication.go +++ b/internal/components/authentication.go @@ -33,7 +33,7 @@ func (ac *AuthenticationConverter) ConvertToResourceSpec(mcp *openmcpv1alpha1.Ma // InjectStatus implements ComponentConverter. func (ac *AuthenticationConverter) InjectStatus(raw any, mcpStatus *openmcpv1alpha1.ManagedControlPlaneStatus) error { - status, ok := raw.(*openmcpv1alpha1.ExternalAuthenticationStatus) + status, ok := raw.(openmcpv1alpha1.ExternalAuthenticationStatus) if !ok { return openmcperrors.ErrWrongComponentStatusType } diff --git a/internal/components/authentication_test.go b/internal/components/authentication_test.go index 1a055dc..e27b037 100644 --- a/internal/components/authentication_test.go +++ b/internal/components/authentication_test.go @@ -105,7 +105,7 @@ var _ = Describe("AuthenticationConverter", func() { Context("InjectStatus", func() { It("should inject the status", func() { conv := &components.AuthenticationConverter{} - status := &openmcpv1alpha1.ExternalAuthenticationStatus{ + status := openmcpv1alpha1.ExternalAuthenticationStatus{ UserAccess: &openmcpv1alpha1.SecretReference{ NamespacedObjectReference: openmcpv1alpha1.NamespacedObjectReference{ Name: "test", @@ -120,7 +120,7 @@ var _ = Describe("AuthenticationConverter", func() { err := conv.InjectStatus(status, mcpStatus) Expect(err).ToNot(HaveOccurred()) Expect(mcpStatus.Components.Authentication).ToNot(BeNil()) - Expect(mcpStatus.Components.Authentication).To(Equal(status)) + Expect(*mcpStatus.Components.Authentication).To(Equal(status)) }) It("should not inject an incompatible status", func() { diff --git a/internal/components/authorization.go b/internal/components/authorization.go index ba90664..c7ae916 100644 --- a/internal/components/authorization.go +++ b/internal/components/authorization.go @@ -33,7 +33,7 @@ func (ac *AuthorizationConverter) ConvertToResourceSpec(mcp *openmcpv1alpha1.Man // InjectStatus implements ComponentConverter. func (ac *AuthorizationConverter) InjectStatus(raw any, mcpStatus *openmcpv1alpha1.ManagedControlPlaneStatus) error { - status, ok := raw.(*openmcpv1alpha1.ExternalAuthorizationStatus) + status, ok := raw.(openmcpv1alpha1.ExternalAuthorizationStatus) if !ok { return openmcperrors.ErrWrongComponentStatusType } diff --git a/internal/components/authorization_test.go b/internal/components/authorization_test.go index 9e0c7f6..f9aeec4 100644 --- a/internal/components/authorization_test.go +++ b/internal/components/authorization_test.go @@ -146,11 +146,11 @@ var _ = Describe("AuthorizationConverter", func() { It("should inject the status", func() { conv := &components.AuthorizationConverter{} mcpStatus := &openmcpv1alpha1.ManagedControlPlaneStatus{} - status := &openmcpv1alpha1.ExternalAuthorizationStatus{} + status := openmcpv1alpha1.ExternalAuthorizationStatus{} err := conv.InjectStatus(status, mcpStatus) Expect(err).ToNot(HaveOccurred()) - Expect(mcpStatus.Components.Authorization).To(Equal(status)) + Expect(*mcpStatus.Components.Authorization).To(Equal(status)) }) It("should fail to inject the status", func() { diff --git a/internal/components/cloudorchestrator.go b/internal/components/cloudorchestrator.go index 7f01431..29d5e09 100644 --- a/internal/components/cloudorchestrator.go +++ b/internal/components/cloudorchestrator.go @@ -32,7 +32,7 @@ func (*CloudOrchestratorConverter) ConvertToResourceSpec(mcp *openmcpv1alpha1.Ma // InjectStatus implements ComponentConverter. func (*CloudOrchestratorConverter) InjectStatus(raw any, mcpStatus *openmcpv1alpha1.ManagedControlPlaneStatus) error { - status, ok := raw.(*openmcpv1alpha1.ExternalCloudOrchestratorStatus) + status, ok := raw.(openmcpv1alpha1.ExternalCloudOrchestratorStatus) if !ok { return openmcperrors.ErrWrongComponentStatusType } diff --git a/internal/components/cloudorchestrator_test.go b/internal/components/cloudorchestrator_test.go index 323e253..06b3e5f 100644 --- a/internal/components/cloudorchestrator_test.go +++ b/internal/components/cloudorchestrator_test.go @@ -77,11 +77,11 @@ var _ = Describe("CloudOrchestratorConverter", func() { It("should inject the status", func() { conv := &components.CloudOrchestratorConverter{} mcpStatus := &openmcpv1alpha1.ManagedControlPlaneStatus{} - status := &openmcpv1alpha1.ExternalCloudOrchestratorStatus{} + status := openmcpv1alpha1.ExternalCloudOrchestratorStatus{} err := conv.InjectStatus(status, mcpStatus) Expect(err).ToNot(HaveOccurred()) - Expect(mcpStatus.Components.CloudOrchestrator).To(Equal(status)) + Expect(*mcpStatus.Components.CloudOrchestrator).To(Equal(status)) }) It("should fail to inject the status", func() { diff --git a/internal/components/landscaper.go b/internal/components/landscaper.go index 9dfaa2d..aec5049 100644 --- a/internal/components/landscaper.go +++ b/internal/components/landscaper.go @@ -35,7 +35,7 @@ func (*LandscaperConverter) ConvertToResourceSpec(mcp *openmcpv1alpha1.ManagedCo // InjectStatus implements ComponentConverter. func (*LandscaperConverter) InjectStatus(raw any, mcpStatus *openmcpv1alpha1.ManagedControlPlaneStatus) error { - status, ok := raw.(*openmcpv1alpha1.ExternalLandscaperStatus) + status, ok := raw.(openmcpv1alpha1.ExternalLandscaperStatus) if !ok { return openmcperrors.ErrWrongComponentStatusType } diff --git a/internal/components/landscaper_test.go b/internal/components/landscaper_test.go index b130be3..88610c3 100644 --- a/internal/components/landscaper_test.go +++ b/internal/components/landscaper_test.go @@ -82,11 +82,11 @@ var _ = Describe("LandscaperConverter", func() { It("should inject the status", func() { conv := &components.LandscaperConverter{} mcpStatus := &openmcpv1alpha1.ManagedControlPlaneStatus{} - status := &openmcpv1alpha1.ExternalLandscaperStatus{} + status := openmcpv1alpha1.ExternalLandscaperStatus{} err := conv.InjectStatus(status, mcpStatus) Expect(err).ToNot(HaveOccurred()) - Expect(mcpStatus.Components.Landscaper).To(Equal(status)) + Expect(*mcpStatus.Components.Landscaper).To(Equal(status)) }) It("should not inject an incompatible status", func() { diff --git a/internal/controller/core/apiserver/controller_test.go b/internal/controller/core/apiserver/controller_test.go index 7ed4edb..b857934 100644 --- a/internal/controller/core/apiserver/controller_test.go +++ b/internal/controller/core/apiserver/controller_test.go @@ -276,7 +276,7 @@ var _ = Describe("CO-1153 APIServer Controller", func() { Raw: []byte(`{"apiVersion":"garden.sapcloud.io/v1beta1","kind":"Shoot","metadata":{"name":"foo","namespace":"bar"}}`), }, } - dps.ExternalAPIServerStatus = &openmcpv1alpha1.ExternalAPIServerStatus{ + dps.ExternalAPIServerStatus = openmcpv1alpha1.ExternalAPIServerStatus{ Endpoint: "https://k8s-external.ondemand.com", ServiceAccountIssuer: "https://k8s-sa.ondemand.com", } @@ -311,7 +311,7 @@ var _ = Describe("CO-1153 APIServer Controller", func() { Raw: []byte(`{"apiVersion":"garden.sapcloud.io/v1beta1","kind":"Shoot","metadata":{"name":"foo","namespace":"bar"}}`), }, } - dps.ExternalAPIServerStatus = &openmcpv1alpha1.ExternalAPIServerStatus{ + dps.ExternalAPIServerStatus = openmcpv1alpha1.ExternalAPIServerStatus{ Endpoint: "https://k8s-external.ondemand.com", ServiceAccountIssuer: "https://k8s-sa.ondemand.com", } diff --git a/internal/controller/core/apiserver/handler/gardener/connector.go b/internal/controller/core/apiserver/handler/gardener/connector.go index c0c7903..7b018e9 100644 --- a/internal/controller/core/apiserver/handler/gardener/connector.go +++ b/internal/controller/core/apiserver/handler/gardener/connector.go @@ -204,9 +204,6 @@ func (gc *GardenerConnector) HandleCreateOrUpdate(ctx context.Context, as *openm } } - if status.ExternalAPIServerStatus == nil { - status.ExternalAPIServerStatus = &openmcpv1alpha1.ExternalAPIServerStatus{} - } for _, endpoint := range sh.Status.AdvertisedAddresses { switch endpoint.Name { case constants.AdvertisedAddressExternal: diff --git a/internal/controller/core/apiserver/handler/gardener/connector_test.go b/internal/controller/core/apiserver/handler/gardener/connector_test.go index d7c8f6b..2e8f08e 100644 --- a/internal/controller/core/apiserver/handler/gardener/connector_test.go +++ b/internal/controller/core/apiserver/handler/gardener/connector_test.go @@ -154,10 +154,8 @@ var _ = Describe("APIServer Gardener Conversion", func() { _, usf, _, err := gc.HandleCreateOrUpdate(env.Ctx, as, nil) Expect(err).ToNot(HaveOccurred()) Expect(usf).ToNot(BeNil()) - if as.Status.ExternalAPIServerStatus != nil { - Expect(as.Status.ExternalAPIServerStatus.Endpoint).To(BeEmpty()) - Expect(as.Status.ExternalAPIServerStatus.ServiceAccountIssuer).To(BeEmpty()) - } + Expect(as.Status.ExternalAPIServerStatus.Endpoint).To(BeEmpty()) + Expect(as.Status.ExternalAPIServerStatus.ServiceAccountIssuer).To(BeEmpty()) Expect(usf(&as.Status)).To(Succeed()) Expect(as.Status.ExternalAPIServerStatus.Endpoint).To(Equal(expectedEndpoint)) Expect(as.Status.ExternalAPIServerStatus.ServiceAccountIssuer).To(Equal(expectedServiceAccountIssuer)) diff --git a/internal/controller/core/apiserver/v2.go b/internal/controller/core/apiserver/v2.go index 7df0c8c..d252ad7 100644 --- a/internal/controller/core/apiserver/v2.go +++ b/internal/controller/core/apiserver/v2.go @@ -185,9 +185,6 @@ func v2HandleCreateOrUpdate(ctx context.Context, as *openmcpv1alpha1.APIServer, // build the UpdateStatusFunc apiAccess := &openmcpv1alpha1.APIServerAccess{} var usf handler.UpdateStatusFunc = func(status *openmcpv1alpha1.APIServerStatus) error { - if status.ExternalAPIServerStatus == nil { - status.ExternalAPIServerStatus = &openmcpv1alpha1.ExternalAPIServerStatus{} - } if setShootInStatus != nil { if err := setShootInStatus(status); err != nil { return fmt.Errorf("error setting shoot in status: %w", err) diff --git a/internal/controller/core/authentication/controller.go b/internal/controller/core/authentication/controller.go index f83244e..2eba463 100644 --- a/internal/controller/core/authentication/controller.go +++ b/internal/controller/core/authentication/controller.go @@ -479,10 +479,6 @@ func (ar *AuthenticationReconciler) ensureAccessSecret(ctx context.Context, expe // updateExternalStatus updates the external status of the Authentication resource // by creating a kubeconfig for the user access to the APIServer func (ar *AuthenticationReconciler) updateExternalStatus(ctx context.Context, auth *openmcpv1alpha1.Authentication) error { - if auth.Status.ExternalAuthenticationStatus == nil { - auth.Status.ExternalAuthenticationStatus = &openmcpv1alpha1.ExternalAuthenticationStatus{} - } - // try to get access secret accessSecret := getSecretAccessor(auth) diff --git a/internal/controller/core/managedcontrolplane/controller_test.go b/internal/controller/core/managedcontrolplane/controller_test.go index 34a2144..4145051 100644 --- a/internal/controller/core/managedcontrolplane/controller_test.go +++ b/internal/controller/core/managedcontrolplane/controller_test.go @@ -362,7 +362,7 @@ var _ = Describe("CO-1153 ManagedControlPlane Controller", func() { time.Sleep(1 * time.Second) // without this, it cannot be verified that the lastTransitionTime is not updated if nothing changes, because the test is too fast for the second precision of the timestamps // verify status - Expect(mcp.Status.Components.Authentication).To(Equal(auth.Status.ExternalAuthenticationStatus)) + Expect(*mcp.Status.Components.Authentication).To(Equal(auth.Status.ExternalAuthenticationStatus)) // verify conditions Expect(mcp.Status.Conditions).To(ConsistOf(