diff --git a/crds/sme.sap.com_capapplications.yaml b/crds/sme.sap.com_capapplications.yaml index 75ab3d6..937a339 100644 --- a/crds/sme.sap.com_capapplications.yaml +++ b/crds/sme.sap.com_capapplications.yaml @@ -57,6 +57,21 @@ spec: type: object btpAppName: type: string + domainRefs: + items: + properties: + kind: + enum: + - Domain + - ClusterDomain + type: string + name: + type: string + required: + - kind + - name + type: object + type: array domains: properties: dnsTarget: @@ -103,6 +118,7 @@ spec: required: - btp - btpAppName + - domainRefs - domains - globalAccountId - provider diff --git a/crds/sme.sap.com_clusterdomains.yaml b/crds/sme.sap.com_clusterdomains.yaml new file mode 100644 index 0000000..97de6ff --- /dev/null +++ b/crds/sme.sap.com_clusterdomains.yaml @@ -0,0 +1,125 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.17.1 + name: clusterdomains.sme.sap.com +spec: + group: sme.sap.com + names: + kind: ClusterDomain + listKind: ClusterDomainList + plural: clusterdomains + shortNames: + - cldom + singular: clusterdomain + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + dnsMode: + enum: + - Node + - Wildcard + - Subdomain + type: string + dnsTarget: + pattern: ^[a-z0-9-.]+$ + type: string + domain: + pattern: ^[a-z0-9-.]+$ + type: string + ingressSelector: + additionalProperties: + type: string + type: object + tlsMode: + enum: + - Simple + - Mutual + type: string + required: + - dnsMode + - dnsTarget + - domain + - ingressSelector + - tlsMode + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + maxLength: 32768 + type: string + observedGeneration: + format: int64 + minimum: 0 + type: integer + reason: + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + enum: + - "True" + - "False" + - Unknown + type: string + type: + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + state: + enum: + - "" + - Ready + - Error + - Processing + - Deleting + type: string + required: + - state + type: object + required: + - metadata + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crds/sme.sap.com_domains.yaml b/crds/sme.sap.com_domains.yaml new file mode 100644 index 0000000..e4a59f3 --- /dev/null +++ b/crds/sme.sap.com_domains.yaml @@ -0,0 +1,125 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.17.1 + name: domains.sme.sap.com +spec: + group: sme.sap.com + names: + kind: Domain + listKind: DomainList + plural: domains + shortNames: + - dom + singular: domain + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + dnsMode: + enum: + - Node + - Wildcard + - Subdomain + type: string + dnsTarget: + pattern: ^[a-z0-9-.]+$ + type: string + domain: + pattern: ^[a-z0-9-.]+$ + type: string + ingressSelector: + additionalProperties: + type: string + type: object + tlsMode: + enum: + - Simple + - Mutual + type: string + required: + - dnsMode + - dnsTarget + - domain + - ingressSelector + - tlsMode + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + maxLength: 32768 + type: string + observedGeneration: + format: int64 + minimum: 0 + type: integer + reason: + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + enum: + - "True" + - "False" + - Unknown + type: string + type: + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + state: + enum: + - "" + - Ready + - Error + - Processing + - Deleting + type: string + required: + - state + type: object + required: + - metadata + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/pkg/apis/sme.sap.com/v1alpha1/types.go b/pkg/apis/sme.sap.com/v1alpha1/types.go index 9126af1..0ec2875 100644 --- a/pkg/apis/sme.sap.com/v1alpha1/types.go +++ b/pkg/apis/sme.sap.com/v1alpha1/types.go @@ -78,6 +78,8 @@ type CAPApplicationList struct { // CAPApplicationSpec defines the desired state of CAPApplication type CAPApplicationSpec struct { + // Domains used by the application (new) + DomainRefs []DomainRefs `json:"domainRefs"` // Domains used by the application Domains ApplicationDomains `json:"domains"` // SAP BTP Global Account Identifier where services are entitles for the current application @@ -90,6 +92,22 @@ type CAPApplicationSpec struct { BTP BTP `json:"btp"` } +// Domain references +type DomainRefs struct { + // +kubebuilder:validation:Enum=Domain;ClusterDomain + Kind DomainType `json:"kind"` + Name string `json:"name"` +} + +type DomainType string + +const ( + // Domain + DomainKind DomainType = "Domain" + // Cluster Domain + ClusterDomainKind DomainType = "ClusterDomain" +) + // Application domains type ApplicationDomains struct { // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ @@ -656,3 +674,105 @@ type CAPTenantOutputSpec struct { // +kubebuilder:validation:nullable SubscriptionCallbackData string `json:"subscriptionCallbackData,omitempty"` } + +// +kubebuilder:resource:shortName=dom +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// Domain is the schema for domains API +type Domain struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // Domains spec + Spec DomainSpec `json:"spec"` + // +kubebuilder:validation:Optional + // Domain status + Status DomainStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// DomainList contains a list of Domain +type DomainList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []Domain `json:"items"` +} + +type DomainSpec struct { + // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ + Domain string `json:"domain"` + IngressSelector map[string]string `json:"ingressSelector"` + // +kubebuilder:validation:Enum=Simple;Mutual + TLSMode TLSMode `json:"tlsMode"` + // +kubebuilder:validation:Enum=Node;Wildcard;Subdomain + DNSMode DNSMode `json:"dnsMode"` + // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ + DNSTarget string `json:"dnsTarget"` +} + +type TLSMode string + +const ( + // Simple TLS Mode (Default) + SimpleTLSMode TLSMode = "Simple" + // Mutual TLS Mode + MutualTLSMode TLSMode = "Mutual" +) + +type DNSMode string + +const ( + // No DNS (Default) + NoDNS DNSMode = "None" + // Wildcard DNS mode + WildCardDNS DNSMode = "Wildcard" + // Subdomain DNS mode + Subdomain DNSMode = "Subdomain" +) + +type DomainStatus struct { + GenericStatus `json:",inline"` + // +kubebuilder:validation:Enum="";Ready;Error;Processing;Deleting + // State of Domain + State DomainState `json:"state"` +} + +type DomainState string + +const ( + DomainStateProcessing DomainState = "Processing" + DomainStateError DomainState = "Error" + DomainStateDeleting DomainState = "Deleting" + DomainStateReady DomainState = "Ready" +) + +// +kubebuilder:resource:scope=Cluster,shortName=cldom +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterDomain is the schema for clusterdomains API +type ClusterDomain struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // Domains spec + Spec DomainSpec `json:"spec"` + // +kubebuilder:validation:Optional + // Domain status + Status DomainStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterDomainList contains a list of ClusterDomain +type ClusterDomainList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []ClusterDomain `json:"items"` +} diff --git a/pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go index 5bc4029..360d615 100644 --- a/pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go @@ -143,6 +143,11 @@ func (in *CAPApplicationList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAPApplicationSpec) DeepCopyInto(out *CAPApplicationSpec) { *out = *in + if in.DomainRefs != nil { + in, out := &in.DomainRefs, &out.DomainRefs + *out = make([]DomainRefs, len(*in)) + copy(*out, *in) + } in.Domains.DeepCopyInto(&out.Domains) out.Provider = in.Provider in.BTP.DeepCopyInto(&out.BTP) @@ -608,6 +613,67 @@ func (in *CAPTenantStatus) DeepCopy() *CAPTenantStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterDomain) DeepCopyInto(out *ClusterDomain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDomain. +func (in *ClusterDomain) DeepCopy() *ClusterDomain { + if in == nil { + return nil + } + out := new(ClusterDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterDomain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterDomainList) DeepCopyInto(out *ClusterDomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterDomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDomainList. +func (in *ClusterDomainList) DeepCopy() *ClusterDomainList { + if in == nil { + return nil + } + out := new(ClusterDomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterDomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CommonDetails) DeepCopyInto(out *CommonDetails) { *out = *in @@ -769,6 +835,123 @@ func (in *DeploymentDetails) DeepCopy() *DeploymentDetails { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Domain) DeepCopyInto(out *Domain) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Domain. +func (in *Domain) DeepCopy() *Domain { + if in == nil { + return nil + } + out := new(Domain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Domain) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainList) DeepCopyInto(out *DomainList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Domain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainList. +func (in *DomainList) DeepCopy() *DomainList { + if in == nil { + return nil + } + out := new(DomainList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DomainList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainRefs) DeepCopyInto(out *DomainRefs) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainRefs. +func (in *DomainRefs) DeepCopy() *DomainRefs { + if in == nil { + return nil + } + out := new(DomainRefs) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainSpec) DeepCopyInto(out *DomainSpec) { + *out = *in + if in.IngressSelector != nil { + in, out := &in.IngressSelector, &out.IngressSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainSpec. +func (in *DomainSpec) DeepCopy() *DomainSpec { + if in == nil { + return nil + } + out := new(DomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DomainStatus) DeepCopyInto(out *DomainStatus) { + *out = *in + in.GenericStatus.DeepCopyInto(&out.GenericStatus) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainStatus. +func (in *DomainStatus) DeepCopy() *DomainStatus { + if in == nil { + return nil + } + out := new(DomainStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GenericStatus) DeepCopyInto(out *GenericStatus) { *out = *in diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go index 0d20a9d..7695fbd 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go @@ -10,6 +10,7 @@ package v1alpha1 // CAPApplicationSpecApplyConfiguration represents a declarative configuration of the CAPApplicationSpec type for use // with apply. type CAPApplicationSpecApplyConfiguration struct { + DomainRefs []DomainRefsApplyConfiguration `json:"domainRefs,omitempty"` Domains *ApplicationDomainsApplyConfiguration `json:"domains,omitempty"` GlobalAccountId *string `json:"globalAccountId,omitempty"` BTPAppName *string `json:"btpAppName,omitempty"` @@ -23,6 +24,19 @@ func CAPApplicationSpec() *CAPApplicationSpecApplyConfiguration { return &CAPApplicationSpecApplyConfiguration{} } +// WithDomainRefs adds the given value to the DomainRefs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DomainRefs field. +func (b *CAPApplicationSpecApplyConfiguration) WithDomainRefs(values ...*DomainRefsApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDomainRefs") + } + b.DomainRefs = append(b.DomainRefs, *values[i]) + } + return b +} + // WithDomains sets the Domains field in the declarative configuration to the given value // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the Domains field is set to the value of the last call. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go new file mode 100644 index 0000000..e2ff4a3 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go @@ -0,0 +1,214 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ClusterDomainApplyConfiguration represents a declarative configuration of the ClusterDomain type for use +// with apply. +type ClusterDomainApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` + Status *DomainStatusApplyConfiguration `json:"status,omitempty"` +} + +// ClusterDomain constructs a declarative configuration of the ClusterDomain type for use with +// apply. +func ClusterDomain(name, namespace string) *ClusterDomainApplyConfiguration { + b := &ClusterDomainApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ClusterDomain") + b.WithAPIVersion("sme.sap.com/v1alpha1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithKind(value string) *ClusterDomainApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithAPIVersion(value string) *ClusterDomainApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithName(value string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithGenerateName(value string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithNamespace(value string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithUID(value types.UID) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithResourceVersion(value string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithGeneration(value int64) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ClusterDomainApplyConfiguration) WithLabels(entries map[string]string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ClusterDomainApplyConfiguration) WithAnnotations(entries map[string]string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ClusterDomainApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ClusterDomainApplyConfiguration) WithFinalizers(values ...string) *ClusterDomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *ClusterDomainApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithSpec(value *DomainSpecApplyConfiguration) *ClusterDomainApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ClusterDomainApplyConfiguration) WithStatus(value *DomainStatusApplyConfiguration) *ClusterDomainApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterDomainApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go new file mode 100644 index 0000000..1b1c603 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go @@ -0,0 +1,214 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DomainApplyConfiguration represents a declarative configuration of the Domain type for use +// with apply. +type DomainApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` + Status *DomainStatusApplyConfiguration `json:"status,omitempty"` +} + +// Domain constructs a declarative configuration of the Domain type for use with +// apply. +func Domain(name, namespace string) *DomainApplyConfiguration { + b := &DomainApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Domain") + b.WithAPIVersion("sme.sap.com/v1alpha1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithKind(value string) *DomainApplyConfiguration { + b.TypeMetaApplyConfiguration.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithAPIVersion(value string) *DomainApplyConfiguration { + b.TypeMetaApplyConfiguration.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithName(value string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithGenerateName(value string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithNamespace(value string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithUID(value types.UID) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithResourceVersion(value string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithGeneration(value int64) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *DomainApplyConfiguration) WithLabels(entries map[string]string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *DomainApplyConfiguration) WithAnnotations(entries map[string]string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 { + b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.ObjectMetaApplyConfiguration.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *DomainApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *DomainApplyConfiguration) WithFinalizers(values ...string) *DomainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *DomainApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithSpec(value *DomainSpecApplyConfiguration) *DomainApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *DomainApplyConfiguration) WithStatus(value *DomainStatusApplyConfiguration) *DomainApplyConfiguration { + b.Status = value + return b +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DomainApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainrefs.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainrefs.go new file mode 100644 index 0000000..33ac359 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainrefs.go @@ -0,0 +1,41 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" +) + +// DomainRefsApplyConfiguration represents a declarative configuration of the DomainRefs type for use +// with apply. +type DomainRefsApplyConfiguration struct { + Kind *smesapcomv1alpha1.DomainType `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` +} + +// DomainRefsApplyConfiguration constructs a declarative configuration of the DomainRefs type for use with +// apply. +func DomainRefs() *DomainRefsApplyConfiguration { + return &DomainRefsApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DomainRefsApplyConfiguration) WithKind(value smesapcomv1alpha1.DomainType) *DomainRefsApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *DomainRefsApplyConfiguration) WithName(value string) *DomainRefsApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainspec.go new file mode 100644 index 0000000..6799012 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainspec.go @@ -0,0 +1,74 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" +) + +// DomainSpecApplyConfiguration represents a declarative configuration of the DomainSpec type for use +// with apply. +type DomainSpecApplyConfiguration struct { + Domain *string `json:"domain,omitempty"` + IngressSelector map[string]string `json:"ingressSelector,omitempty"` + TLSMode *smesapcomv1alpha1.TLSMode `json:"tlsMode,omitempty"` + DNSMode *smesapcomv1alpha1.DNSMode `json:"dnsMode,omitempty"` + DNSTarget *string `json:"dnsTarget,omitempty"` +} + +// DomainSpecApplyConfiguration constructs a declarative configuration of the DomainSpec type for use with +// apply. +func DomainSpec() *DomainSpecApplyConfiguration { + return &DomainSpecApplyConfiguration{} +} + +// WithDomain sets the Domain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Domain field is set to the value of the last call. +func (b *DomainSpecApplyConfiguration) WithDomain(value string) *DomainSpecApplyConfiguration { + b.Domain = &value + return b +} + +// WithIngressSelector puts the entries into the IngressSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the IngressSelector field, +// overwriting an existing map entries in IngressSelector field with the same key. +func (b *DomainSpecApplyConfiguration) WithIngressSelector(entries map[string]string) *DomainSpecApplyConfiguration { + if b.IngressSelector == nil && len(entries) > 0 { + b.IngressSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.IngressSelector[k] = v + } + return b +} + +// WithTLSMode sets the TLSMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TLSMode field is set to the value of the last call. +func (b *DomainSpecApplyConfiguration) WithTLSMode(value smesapcomv1alpha1.TLSMode) *DomainSpecApplyConfiguration { + b.TLSMode = &value + return b +} + +// WithDNSMode sets the DNSMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DNSMode field is set to the value of the last call. +func (b *DomainSpecApplyConfiguration) WithDNSMode(value smesapcomv1alpha1.DNSMode) *DomainSpecApplyConfiguration { + b.DNSMode = &value + return b +} + +// WithDNSTarget sets the DNSTarget field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DNSTarget field is set to the value of the last call. +func (b *DomainSpecApplyConfiguration) WithDNSTarget(value string) *DomainSpecApplyConfiguration { + b.DNSTarget = &value + return b +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go new file mode 100644 index 0000000..622f074 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go @@ -0,0 +1,55 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// DomainStatusApplyConfiguration represents a declarative configuration of the DomainStatus type for use +// with apply. +type DomainStatusApplyConfiguration struct { + GenericStatusApplyConfiguration `json:",inline"` + State *smesapcomv1alpha1.DomainState `json:"state,omitempty"` +} + +// DomainStatusApplyConfiguration constructs a declarative configuration of the DomainStatus type for use with +// apply. +func DomainStatus() *DomainStatusApplyConfiguration { + return &DomainStatusApplyConfiguration{} +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *DomainStatusApplyConfiguration) WithObservedGeneration(value int64) *DomainStatusApplyConfiguration { + b.GenericStatusApplyConfiguration.ObservedGeneration = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *DomainStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *DomainStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.GenericStatusApplyConfiguration.Conditions = append(b.GenericStatusApplyConfiguration.Conditions, *values[i]) + } + return b +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *DomainStatusApplyConfiguration) WithState(value smesapcomv1alpha1.DomainState) *DomainStatusApplyConfiguration { + b.State = &value + return b +} diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go index be4bc17..c4b8927 100644 --- a/pkg/client/applyconfiguration/utils.go +++ b/pkg/client/applyconfiguration/utils.go @@ -57,12 +57,22 @@ func ForKind(kind schema.GroupVersionKind) interface{} { return &smesapcomv1alpha1.CAPTenantSpecApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantStatus"): return &smesapcomv1alpha1.CAPTenantStatusApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("ClusterDomain"): + return &smesapcomv1alpha1.ClusterDomainApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CommonDetails"): return &smesapcomv1alpha1.CommonDetailsApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("DeletionRules"): return &smesapcomv1alpha1.DeletionRulesApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("DeploymentDetails"): return &smesapcomv1alpha1.DeploymentDetailsApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("Domain"): + return &smesapcomv1alpha1.DomainApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("DomainRefs"): + return &smesapcomv1alpha1.DomainRefsApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("DomainSpec"): + return &smesapcomv1alpha1.DomainSpecApplyConfiguration{} + case v1alpha1.SchemeGroupVersion.WithKind("DomainStatus"): + return &smesapcomv1alpha1.DomainStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("GenericStatus"): return &smesapcomv1alpha1.GenericStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("JobDetails"): diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/clusterdomain.go new file mode 100644 index 0000000..3d3d951 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/clusterdomain.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + applyconfigurationsmesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha1" + scheme "github.com/sap/cap-operator/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// ClusterDomainsGetter has a method to return a ClusterDomainInterface. +// A group's client should implement this interface. +type ClusterDomainsGetter interface { + ClusterDomains(namespace string) ClusterDomainInterface +} + +// ClusterDomainInterface has methods to work with ClusterDomain resources. +type ClusterDomainInterface interface { + Create(ctx context.Context, clusterDomain *smesapcomv1alpha1.ClusterDomain, opts v1.CreateOptions) (*smesapcomv1alpha1.ClusterDomain, error) + Update(ctx context.Context, clusterDomain *smesapcomv1alpha1.ClusterDomain, opts v1.UpdateOptions) (*smesapcomv1alpha1.ClusterDomain, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, clusterDomain *smesapcomv1alpha1.ClusterDomain, opts v1.UpdateOptions) (*smesapcomv1alpha1.ClusterDomain, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*smesapcomv1alpha1.ClusterDomain, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha1.ClusterDomainList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *smesapcomv1alpha1.ClusterDomain, err error) + Apply(ctx context.Context, clusterDomain *applyconfigurationsmesapcomv1alpha1.ClusterDomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha1.ClusterDomain, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, clusterDomain *applyconfigurationsmesapcomv1alpha1.ClusterDomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha1.ClusterDomain, err error) + ClusterDomainExpansion +} + +// clusterDomains implements ClusterDomainInterface +type clusterDomains struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha1.ClusterDomain, *smesapcomv1alpha1.ClusterDomainList, *applyconfigurationsmesapcomv1alpha1.ClusterDomainApplyConfiguration] +} + +// newClusterDomains returns a ClusterDomains +func newClusterDomains(c *SmeV1alpha1Client, namespace string) *clusterDomains { + return &clusterDomains{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha1.ClusterDomain, *smesapcomv1alpha1.ClusterDomainList, *applyconfigurationsmesapcomv1alpha1.ClusterDomainApplyConfiguration]( + "clusterdomains", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha1.ClusterDomain { return &smesapcomv1alpha1.ClusterDomain{} }, + func() *smesapcomv1alpha1.ClusterDomainList { return &smesapcomv1alpha1.ClusterDomainList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/domain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/domain.go new file mode 100644 index 0000000..278321e --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/domain.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + applyconfigurationsmesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha1" + scheme "github.com/sap/cap-operator/pkg/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + gentype "k8s.io/client-go/gentype" +) + +// DomainsGetter has a method to return a DomainInterface. +// A group's client should implement this interface. +type DomainsGetter interface { + Domains(namespace string) DomainInterface +} + +// DomainInterface has methods to work with Domain resources. +type DomainInterface interface { + Create(ctx context.Context, domain *smesapcomv1alpha1.Domain, opts v1.CreateOptions) (*smesapcomv1alpha1.Domain, error) + Update(ctx context.Context, domain *smesapcomv1alpha1.Domain, opts v1.UpdateOptions) (*smesapcomv1alpha1.Domain, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, domain *smesapcomv1alpha1.Domain, opts v1.UpdateOptions) (*smesapcomv1alpha1.Domain, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*smesapcomv1alpha1.Domain, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha1.DomainList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *smesapcomv1alpha1.Domain, err error) + Apply(ctx context.Context, domain *applyconfigurationsmesapcomv1alpha1.DomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha1.Domain, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, domain *applyconfigurationsmesapcomv1alpha1.DomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha1.Domain, err error) + DomainExpansion +} + +// domains implements DomainInterface +type domains struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha1.Domain, *smesapcomv1alpha1.DomainList, *applyconfigurationsmesapcomv1alpha1.DomainApplyConfiguration] +} + +// newDomains returns a Domains +func newDomains(c *SmeV1alpha1Client, namespace string) *domains { + return &domains{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha1.Domain, *smesapcomv1alpha1.DomainList, *applyconfigurationsmesapcomv1alpha1.DomainApplyConfiguration]( + "domains", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha1.Domain { return &smesapcomv1alpha1.Domain{} }, + func() *smesapcomv1alpha1.DomainList { return &smesapcomv1alpha1.DomainList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_clusterdomain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_clusterdomain.go new file mode 100644 index 0000000..bc2b724 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_clusterdomain.go @@ -0,0 +1,42 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha1" + typedsmesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeClusterDomains implements ClusterDomainInterface +type fakeClusterDomains struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.ClusterDomain, *v1alpha1.ClusterDomainList, *smesapcomv1alpha1.ClusterDomainApplyConfiguration] + Fake *FakeSmeV1alpha1 +} + +func newFakeClusterDomains(fake *FakeSmeV1alpha1, namespace string) typedsmesapcomv1alpha1.ClusterDomainInterface { + return &fakeClusterDomains{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.ClusterDomain, *v1alpha1.ClusterDomainList, *smesapcomv1alpha1.ClusterDomainApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("clusterdomains"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterDomain"), + func() *v1alpha1.ClusterDomain { return &v1alpha1.ClusterDomain{} }, + func() *v1alpha1.ClusterDomainList { return &v1alpha1.ClusterDomainList{} }, + func(dst, src *v1alpha1.ClusterDomainList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClusterDomainList) []*v1alpha1.ClusterDomain { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClusterDomainList, items []*v1alpha1.ClusterDomain) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_domain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_domain.go new file mode 100644 index 0000000..f132834 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_domain.go @@ -0,0 +1,40 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha1" + typedsmesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1" + gentype "k8s.io/client-go/gentype" +) + +// fakeDomains implements DomainInterface +type fakeDomains struct { + *gentype.FakeClientWithListAndApply[*v1alpha1.Domain, *v1alpha1.DomainList, *smesapcomv1alpha1.DomainApplyConfiguration] + Fake *FakeSmeV1alpha1 +} + +func newFakeDomains(fake *FakeSmeV1alpha1, namespace string) typedsmesapcomv1alpha1.DomainInterface { + return &fakeDomains{ + gentype.NewFakeClientWithListAndApply[*v1alpha1.Domain, *v1alpha1.DomainList, *smesapcomv1alpha1.DomainApplyConfiguration]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("domains"), + v1alpha1.SchemeGroupVersion.WithKind("Domain"), + func() *v1alpha1.Domain { return &v1alpha1.Domain{} }, + func() *v1alpha1.DomainList { return &v1alpha1.DomainList{} }, + func(dst, src *v1alpha1.DomainList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.DomainList) []*v1alpha1.Domain { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.DomainList, items []*v1alpha1.Domain) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_sme.sap.com_client.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_sme.sap.com_client.go index c2b2346..deeba0f 100644 --- a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_sme.sap.com_client.go +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake/fake_sme.sap.com_client.go @@ -37,6 +37,14 @@ func (c *FakeSmeV1alpha1) CAPTenantOutputs(namespace string) v1alpha1.CAPTenantO return newFakeCAPTenantOutputs(c, namespace) } +func (c *FakeSmeV1alpha1) ClusterDomains(namespace string) v1alpha1.ClusterDomainInterface { + return newFakeClusterDomains(c, namespace) +} + +func (c *FakeSmeV1alpha1) Domains(namespace string) v1alpha1.DomainInterface { + return newFakeDomains(c, namespace) +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeSmeV1alpha1) RESTClient() rest.Interface { diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/generated_expansion.go index edb9b0c..4cf22eb 100644 --- a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/generated_expansion.go @@ -16,3 +16,7 @@ type CAPTenantExpansion interface{} type CAPTenantOperationExpansion interface{} type CAPTenantOutputExpansion interface{} + +type ClusterDomainExpansion interface{} + +type DomainExpansion interface{} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/sme.sap.com_client.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/sme.sap.com_client.go index 09117a8..f9c5afa 100644 --- a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/sme.sap.com_client.go +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/sme.sap.com_client.go @@ -22,6 +22,8 @@ type SmeV1alpha1Interface interface { CAPTenantsGetter CAPTenantOperationsGetter CAPTenantOutputsGetter + ClusterDomainsGetter + DomainsGetter } // SmeV1alpha1Client is used to interact with features provided by the sme.sap.com group. @@ -49,6 +51,14 @@ func (c *SmeV1alpha1Client) CAPTenantOutputs(namespace string) CAPTenantOutputIn return newCAPTenantOutputs(c, namespace) } +func (c *SmeV1alpha1Client) ClusterDomains(namespace string) ClusterDomainInterface { + return newClusterDomains(c, namespace) +} + +func (c *SmeV1alpha1Client) Domains(namespace string) DomainInterface { + return newDomains(c, namespace) +} + // NewForConfig creates a new SmeV1alpha1Client for the given config. // NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), // where httpClient was generated with rest.HTTPClientFor(c). diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index a45ce69..b794fff 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -52,6 +52,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha1().CAPTenantOperations().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("captenantoutputs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha1().CAPTenantOutputs().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("clusterdomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha1().ClusterDomains().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("domains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha1().Domains().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go new file mode 100644 index 0000000..9cfba8e --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/clusterdomain.go @@ -0,0 +1,79 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterDomainInformer provides access to a shared informer and lister for +// ClusterDomains. +type ClusterDomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha1.ClusterDomainLister +} + +type clusterDomainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewClusterDomainInformer constructs a new informer for ClusterDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterDomainInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterDomainInformer constructs a new informer for ClusterDomain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SmeV1alpha1().ClusterDomains(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SmeV1alpha1().ClusterDomains(namespace).Watch(context.TODO(), options) + }, + }, + &apissmesapcomv1alpha1.ClusterDomain{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterDomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterDomainInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterDomainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apissmesapcomv1alpha1.ClusterDomain{}, f.defaultInformer) +} + +func (f *clusterDomainInformer) Lister() smesapcomv1alpha1.ClusterDomainLister { + return smesapcomv1alpha1.NewClusterDomainLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go new file mode 100644 index 0000000..ba1c3a0 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/domain.go @@ -0,0 +1,79 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DomainInformer provides access to a shared informer and lister for +// Domains. +type DomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha1.DomainLister +} + +type domainInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewDomainInformer constructs a new informer for Domain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredDomainInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredDomainInformer constructs a new informer for Domain type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SmeV1alpha1().Domains(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.SmeV1alpha1().Domains(namespace).Watch(context.TODO(), options) + }, + }, + &apissmesapcomv1alpha1.Domain{}, + resyncPeriod, + indexers, + ) +} + +func (f *domainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredDomainInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *domainInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apissmesapcomv1alpha1.Domain{}, f.defaultInformer) +} + +func (f *domainInformer) Lister() smesapcomv1alpha1.DomainLister { + return smesapcomv1alpha1.NewDomainLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go index 48c8caf..6a209ac 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha1/interface.go @@ -23,6 +23,10 @@ type Interface interface { CAPTenantOperations() CAPTenantOperationInformer // CAPTenantOutputs returns a CAPTenantOutputInformer. CAPTenantOutputs() CAPTenantOutputInformer + // ClusterDomains returns a ClusterDomainInformer. + ClusterDomains() ClusterDomainInformer + // Domains returns a DomainInformer. + Domains() DomainInformer } type version struct { @@ -60,3 +64,13 @@ func (v *version) CAPTenantOperations() CAPTenantOperationInformer { func (v *version) CAPTenantOutputs() CAPTenantOutputInformer { return &cAPTenantOutputInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// ClusterDomains returns a ClusterDomainInformer. +func (v *version) ClusterDomains() ClusterDomainInformer { + return &clusterDomainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Domains returns a DomainInformer. +func (v *version) Domains() DomainInformer { + return &domainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/listers/sme.sap.com/v1alpha1/clusterdomain.go new file mode 100644 index 0000000..72390fe --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha1/clusterdomain.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterDomainLister helps list ClusterDomains. +// All objects returned here must be treated as read-only. +type ClusterDomainLister interface { + // List lists all ClusterDomains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha1.ClusterDomain, err error) + // ClusterDomains returns an object that can list and get ClusterDomains. + ClusterDomains(namespace string) ClusterDomainNamespaceLister + ClusterDomainListerExpansion +} + +// clusterDomainLister implements the ClusterDomainLister interface. +type clusterDomainLister struct { + listers.ResourceIndexer[*smesapcomv1alpha1.ClusterDomain] +} + +// NewClusterDomainLister returns a new ClusterDomainLister. +func NewClusterDomainLister(indexer cache.Indexer) ClusterDomainLister { + return &clusterDomainLister{listers.New[*smesapcomv1alpha1.ClusterDomain](indexer, smesapcomv1alpha1.Resource("clusterdomain"))} +} + +// ClusterDomains returns an object that can list and get ClusterDomains. +func (s *clusterDomainLister) ClusterDomains(namespace string) ClusterDomainNamespaceLister { + return clusterDomainNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha1.ClusterDomain](s.ResourceIndexer, namespace)} +} + +// ClusterDomainNamespaceLister helps list and get ClusterDomains. +// All objects returned here must be treated as read-only. +type ClusterDomainNamespaceLister interface { + // List lists all ClusterDomains in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha1.ClusterDomain, err error) + // Get retrieves the ClusterDomain from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha1.ClusterDomain, error) + ClusterDomainNamespaceListerExpansion +} + +// clusterDomainNamespaceLister implements the ClusterDomainNamespaceLister +// interface. +type clusterDomainNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha1.ClusterDomain] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha1/domain.go b/pkg/client/listers/sme.sap.com/v1alpha1/domain.go new file mode 100644 index 0000000..4ac47e6 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha1/domain.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// DomainLister helps list Domains. +// All objects returned here must be treated as read-only. +type DomainLister interface { + // List lists all Domains in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha1.Domain, err error) + // Domains returns an object that can list and get Domains. + Domains(namespace string) DomainNamespaceLister + DomainListerExpansion +} + +// domainLister implements the DomainLister interface. +type domainLister struct { + listers.ResourceIndexer[*smesapcomv1alpha1.Domain] +} + +// NewDomainLister returns a new DomainLister. +func NewDomainLister(indexer cache.Indexer) DomainLister { + return &domainLister{listers.New[*smesapcomv1alpha1.Domain](indexer, smesapcomv1alpha1.Resource("domain"))} +} + +// Domains returns an object that can list and get Domains. +func (s *domainLister) Domains(namespace string) DomainNamespaceLister { + return domainNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha1.Domain](s.ResourceIndexer, namespace)} +} + +// DomainNamespaceLister helps list and get Domains. +// All objects returned here must be treated as read-only. +type DomainNamespaceLister interface { + // List lists all Domains in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha1.Domain, err error) + // Get retrieves the Domain from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha1.Domain, error) + DomainNamespaceListerExpansion +} + +// domainNamespaceLister implements the DomainNamespaceLister +// interface. +type domainNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha1.Domain] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha1/expansion_generated.go b/pkg/client/listers/sme.sap.com/v1alpha1/expansion_generated.go index 4787c67..35ab759 100644 --- a/pkg/client/listers/sme.sap.com/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/sme.sap.com/v1alpha1/expansion_generated.go @@ -46,3 +46,19 @@ type CAPTenantOutputListerExpansion interface{} // CAPTenantOutputNamespaceListerExpansion allows custom methods to be added to // CAPTenantOutputNamespaceLister. type CAPTenantOutputNamespaceListerExpansion interface{} + +// ClusterDomainListerExpansion allows custom methods to be added to +// ClusterDomainLister. +type ClusterDomainListerExpansion interface{} + +// ClusterDomainNamespaceListerExpansion allows custom methods to be added to +// ClusterDomainNamespaceLister. +type ClusterDomainNamespaceListerExpansion interface{} + +// DomainListerExpansion allows custom methods to be added to +// DomainLister. +type DomainListerExpansion interface{} + +// DomainNamespaceListerExpansion allows custom methods to be added to +// DomainNamespaceLister. +type DomainNamespaceListerExpansion interface{}