diff --git a/cmd/controller/tmp.go b/cmd/controller/tmp.go index 9991b1ba..d782bcda 100644 --- a/cmd/controller/tmp.go +++ b/cmd/controller/tmp.go @@ -12,7 +12,7 @@ import ( "strings" "github.com/sap/cap-operator/internal/controller" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "github.com/sap/cap-operator/pkg/client/clientset/versioned" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -50,7 +50,7 @@ func ownerIdSelector(ownerNamespace, ownerName string) string { } func migrateCAPApplicationVersions(crdClient versioned.Interface, namespace, caName, appIdHash, appId string) { - cavs, err := crdClient.SmeV1alpha1().CAPApplicationVersions(namespace).List(context.TODO(), metav1.ListOptions{ + cavs, err := crdClient.SmeV1alpha2().CAPApplicationVersions(namespace).List(context.TODO(), metav1.ListOptions{ LabelSelector: ownerIdSelector(namespace, caName), }) if err != nil { @@ -60,14 +60,14 @@ func migrateCAPApplicationVersions(crdClient versioned.Interface, namespace, caN for _, cav := range cavs.Items { cavCopy := cav.DeepCopy() migrateAppIdLabels(&cavCopy.ObjectMeta, appIdHash, appId) - if _, err := crdClient.SmeV1alpha1().CAPApplicationVersions(cav.Namespace).Update(context.TODO(), cavCopy, metav1.UpdateOptions{}); err != nil { + if _, err := crdClient.SmeV1alpha2().CAPApplicationVersions(cav.Namespace).Update(context.TODO(), cavCopy, metav1.UpdateOptions{}); err != nil { klog.ErrorS(err, "Failed to update CAPApplicationVersion", "name", cav.Name, "namespace", namespace) } } } func migrateCAPTenants(crdClient versioned.Interface, namespace, caName, appIdHash, appId string) { - cats, err := crdClient.SmeV1alpha1().CAPTenants(namespace).List(context.TODO(), metav1.ListOptions{ + cats, err := crdClient.SmeV1alpha2().CAPTenants(namespace).List(context.TODO(), metav1.ListOptions{ LabelSelector: ownerIdSelector(namespace, caName), }) if err != nil { @@ -77,7 +77,7 @@ func migrateCAPTenants(crdClient versioned.Interface, namespace, caName, appIdHa for _, cat := range cats.Items { catCopy := cat.DeepCopy() migrateAppIdLabels(&catCopy.ObjectMeta, appIdHash, appId) - if _, err := crdClient.SmeV1alpha1().CAPTenants(cat.Namespace).Update(context.TODO(), catCopy, metav1.UpdateOptions{}); err != nil { + if _, err := crdClient.SmeV1alpha2().CAPTenants(cat.Namespace).Update(context.TODO(), catCopy, metav1.UpdateOptions{}); err != nil { klog.ErrorS(err, "Failed to update CAPTenant", "name", cat.Name, "namespace", namespace) } migrateCAPTenantOperations(crdClient, cat.Namespace, cat.Name, appIdHash, appId) @@ -85,7 +85,7 @@ func migrateCAPTenants(crdClient versioned.Interface, namespace, caName, appIdHa } func migrateCAPTenantOperations(crdClient versioned.Interface, namespace, catName, appIdHash, appId string) { - ctops, err := crdClient.SmeV1alpha1().CAPTenantOperations(namespace).List(context.TODO(), metav1.ListOptions{ + ctops, err := crdClient.SmeV1alpha2().CAPTenantOperations(namespace).List(context.TODO(), metav1.ListOptions{ LabelSelector: ownerIdSelector(namespace, catName), }) if err != nil { @@ -95,13 +95,13 @@ func migrateCAPTenantOperations(crdClient versioned.Interface, namespace, catNam for _, ctop := range ctops.Items { ctopCopy := ctop.DeepCopy() migrateAppIdLabels(&ctopCopy.ObjectMeta, appIdHash, appId) - if _, err := crdClient.SmeV1alpha1().CAPTenantOperations(ctop.Namespace).Update(context.TODO(), ctopCopy, metav1.UpdateOptions{}); err != nil { + if _, err := crdClient.SmeV1alpha2().CAPTenantOperations(ctop.Namespace).Update(context.TODO(), ctopCopy, metav1.UpdateOptions{}); err != nil { klog.ErrorS(err, "Failed to update CAPTenantOperation", "name", ctop.Name, "namespace", ctop.Namespace) } } } -func needsMigration(ca *v1alpha1.CAPApplication, appIdHash string) bool { +func needsMigration(ca *v1alpha2.CAPApplication, appIdHash string) bool { if ca.Labels[controller.LabelAppIdHash] != appIdHash { return true } @@ -118,7 +118,7 @@ func migrateAppsAndSecrets(migrationDone chan bool, crdClient versioned.Interfac }() // Go over all CAP applications and check if spec has ProviderSubaccountId set, if so trigger update after setting LabelAppIdHash and AnnotationAppId and remove LabelBTPApplicationIdentifierHash & AnnotationBTPApplicationIdentifier from all CAs. - apps, err := crdClient.SmeV1alpha1().CAPApplications(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) + apps, err := crdClient.SmeV1alpha2().CAPApplications(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) if err != nil { klog.ErrorS(err, "Failed to list CAP applications") return @@ -136,7 +136,7 @@ func migrateAppsAndSecrets(migrationDone chan bool, crdClient versioned.Interfac if needsMigration(&ca, appIdHash) { caCopy := ca.DeepCopy() migrateAppIdLabels(&caCopy.ObjectMeta, appIdHash, appId) - if _, err := crdClient.SmeV1alpha1().CAPApplications(ca.Namespace).Update(context.TODO(), caCopy, metav1.UpdateOptions{}); err != nil { + if _, err := crdClient.SmeV1alpha2().CAPApplications(ca.Namespace).Update(context.TODO(), caCopy, metav1.UpdateOptions{}); err != nil { klog.ErrorS(err, "Failed to update CAPApplication", "name", ca.Name, "namespace", ca.Namespace) continue } @@ -152,12 +152,12 @@ func migrateAppsAndSecrets(migrationDone chan bool, crdClient versioned.Interfac annotateAllTenants(crdClient) } -func missingProviderSubaccountID(crdClient versioned.Interface, ca *v1alpha1.CAPApplication) bool { +func missingProviderSubaccountID(crdClient versioned.Interface, ca *v1alpha2.CAPApplication) bool { missing := ca.Spec.ProviderSubaccountId == "" if missing { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "MissingProviderSubaccountId", "set providerSubaccountId and restart CAP Operator controller to be able to use this app") - _, err := crdClient.SmeV1alpha1().CAPApplications(ca.Namespace).UpdateStatus(context.TODO(), ca, metav1.UpdateOptions{}) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "MissingProviderSubaccountId", "set providerSubaccountId and restart CAP Operator controller to be able to use this app") + _, err := crdClient.SmeV1alpha2().CAPApplications(ca.Namespace).UpdateStatus(context.TODO(), ca, metav1.UpdateOptions{}) if err != nil { klog.ErrorS(err, "Failed to update CAPApplication status", "name", ca.Name, "namespace", ca.Namespace) } @@ -205,7 +205,7 @@ func removeFinalizer(finalizers *[]string, finalizerType string) bool { func annotateAllTenants(crdClient versioned.Interface) { count := 0 // Get all CAPTenants and check if they have the new subscription-guid annotation set, if not set it based on the existing label - tenants, err := crdClient.SmeV1alpha1().CAPTenants(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) + tenants, err := crdClient.SmeV1alpha2().CAPTenants(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) if err != nil { klog.ErrorS(err, "Failed to list CAPTenants") return @@ -218,7 +218,7 @@ func annotateAllTenants(crdClient versioned.Interface) { } if tenant.Annotations[controller.MetadataSubscriptionGUID] != subscriptionGUID { tenant.Annotations[controller.MetadataSubscriptionGUID] = subscriptionGUID - if _, err := crdClient.SmeV1alpha1().CAPTenants(tenant.Namespace).Update(context.TODO(), &tenant, metav1.UpdateOptions{}); err != nil { + if _, err := crdClient.SmeV1alpha2().CAPTenants(tenant.Namespace).Update(context.TODO(), &tenant, metav1.UpdateOptions{}); err != nil { klog.ErrorS(err, "Failed to update CAPTenant annotation", "name", tenant.Name, "namespace", tenant.Namespace) continue } diff --git a/cmd/server/internal/handler.go b/cmd/server/internal/handler.go index 35c62178..e0f34ab8 100644 --- a/cmd/server/internal/handler.go +++ b/cmd/server/internal/handler.go @@ -30,7 +30,7 @@ import ( "k8s.io/klog/v2" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "github.com/sap/cap-operator/pkg/client/clientset/versioned" ) @@ -115,7 +115,7 @@ type requestHeaderDetails struct { } type Result struct { - Tenant *v1alpha1.CAPTenant + Tenant *v1alpha2.CAPTenant Message string } @@ -252,7 +252,7 @@ func getMessage(isCreated, isUpdated bool) string { } } -func (s *SubscriptionHandler) createTenant(reqInfo *RequestInfo, ca *v1alpha1.CAPApplication) (tenant *v1alpha1.CAPTenant, err error) { +func (s *SubscriptionHandler) createTenant(reqInfo *RequestInfo, ca *v1alpha2.CAPApplication) (tenant *v1alpha2.CAPTenant, err error) { subscriptionGUID := reqInfo.payload.subscriptionGUID jsonReqByte, _ := json.Marshal(reqInfo.payload.raw) // Create a secret to store the subscription context (payload from the request) @@ -276,7 +276,7 @@ func (s *SubscriptionHandler) createTenant(reqInfo *RequestInfo, ca *v1alpha1.CA } util.LogInfo("Creating tenant", TenantProvisioning, ca, nil) - tenant, err = s.Clientset.SmeV1alpha1().CAPTenants(ca.Namespace).Create(context.TODO(), &v1alpha1.CAPTenant{ + tenant, err = s.Clientset.SmeV1alpha2().CAPTenants(ca.Namespace).Create(context.TODO(), &v1alpha2.CAPTenant{ ObjectMeta: metav1.ObjectMeta{ GenerateName: ca.Name + "-", Namespace: ca.Namespace, @@ -290,9 +290,9 @@ func (s *SubscriptionHandler) createTenant(reqInfo *RequestInfo, ca *v1alpha1.CA LabelTenantType: "consumer", // Default tenant type for consumer tenants }, }, - Spec: v1alpha1.CAPTenantSpec{ + Spec: v1alpha2.CAPTenantSpec{ CAPApplicationInstance: ca.Name, - BTPTenantIdentification: v1alpha1.BTPTenantIdentification{ + BTPTenantIdentification: v1alpha2.BTPTenantIdentification{ SubDomain: reqInfo.payload.subdomain, TenantId: reqInfo.payload.tenantId, }, @@ -308,7 +308,7 @@ func (s *SubscriptionHandler) createTenant(reqInfo *RequestInfo, ca *v1alpha1.CA return tenant, s.updateSecret(tenant, secret) } -func (s *SubscriptionHandler) updateTenant(reqInfo *RequestInfo, ca *v1alpha1.CAPApplication, tenant *v1alpha1.CAPTenant) (bool, error) { +func (s *SubscriptionHandler) updateTenant(reqInfo *RequestInfo, ca *v1alpha2.CAPApplication, tenant *v1alpha2.CAPTenant) (bool, error) { updated := false // Update the tenant labels if needed @@ -316,7 +316,7 @@ func (s *SubscriptionHandler) updateTenant(reqInfo *RequestInfo, ca *v1alpha1.CA tenant.Labels[MetadataSubscriptionGUID] = reqInfo.payload.subscriptionGUID tenant.Annotations[MetadataSubscriptionGUID] = reqInfo.payload.subscriptionGUID util.LogInfo("Updating tenant subscriptionGUID label", TenantProvisioning, tenant, nil) - if _, err := s.Clientset.SmeV1alpha1().CAPTenants(ca.Namespace).Update(context.TODO(), tenant, metav1.UpdateOptions{}); err != nil { + if _, err := s.Clientset.SmeV1alpha2().CAPTenants(ca.Namespace).Update(context.TODO(), tenant, metav1.UpdateOptions{}); err != nil { util.LogError(err, "Error updating tenant labels", TenantProvisioning, tenant, nil) return false, err } @@ -423,9 +423,9 @@ func (s *SubscriptionHandler) getCallbackReqInfo(subscriptionType subscriptionTy return callbackReqInfo } -func (s *SubscriptionHandler) updateSecret(tenant *v1alpha1.CAPTenant, secret *corev1.Secret) error { +func (s *SubscriptionHandler) updateSecret(tenant *v1alpha2.CAPTenant, secret *corev1.Secret) error { secret.OwnerReferences = []metav1.OwnerReference{ - *metav1.NewControllerRef(tenant, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantKind)), + *metav1.NewControllerRef(tenant, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantKind)), } _, err := s.KubeClientset.CoreV1().Secrets(tenant.Namespace).Update(context.TODO(), secret, metav1.UpdateOptions{}) if err != nil { @@ -460,7 +460,7 @@ func (s *SubscriptionHandler) getTenantByLabels(labelsMap map[string]string, nam return &Result{Tenant: nil, Message: err.Error()} } - ctList, err := s.Clientset.SmeV1alpha1().CAPTenants(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) + ctList, err := s.Clientset.SmeV1alpha2().CAPTenants(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) if err != nil { util.LogError(err, "Error in "+methodName, step, methodName, nil, flattenLabels(labelsMap)...) return &Result{Tenant: nil, Message: err.Error()} @@ -488,8 +488,8 @@ func flattenLabels(labelsMap map[string]string, args ...any) []any { func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result { var saasData *util.SaasRegistryCredentials var smsData *util.SmsCredentials - var tenant *v1alpha1.CAPTenant - var ca *v1alpha1.CAPApplication + var tenant *v1alpha2.CAPTenant + var ca *v1alpha2.CAPApplication var err error util.LogInfo("Delete Tenant triggered", TenantDeprovisioning, "DeleteTenant", nil) @@ -497,7 +497,7 @@ func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result { // Check if tenant exists by subscriptionGUID and tenantId tenant = s.getTenantBySubscriptionGUID(reqInfo.payload.subscriptionGUID, reqInfo.payload.tenantId, TenantDeprovisioning).Tenant if tenant != nil { - ca, err = s.Clientset.SmeV1alpha1().CAPApplications(tenant.Namespace).Get(context.TODO(), tenant.Spec.CAPApplicationInstance, metav1.GetOptions{}) + ca, err = s.Clientset.SmeV1alpha2().CAPApplications(tenant.Namespace).Get(context.TODO(), tenant.Spec.CAPApplicationInstance, metav1.GetOptions{}) if err != nil { util.LogError(err, "CAPApplication not found", TenantDeprovisioning, tenant, nil) return &Result{Tenant: nil, Message: err.Error()} @@ -525,7 +525,7 @@ func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result { } util.LogInfo("Tenant found", TenantDeprovisioning, ca, tenant) - err = s.Clientset.SmeV1alpha1().CAPTenants(tenant.Namespace).Delete(context.TODO(), tenant.Name, metav1.DeleteOptions{}) + err = s.Clientset.SmeV1alpha2().CAPTenants(tenant.Namespace).Delete(context.TODO(), tenant.Name, metav1.DeleteOptions{}) if err != nil { util.LogError(err, "Error deleting tenant", TenantDeprovisioning, ca, tenant) return &Result{Tenant: nil, Message: err.Error()} @@ -538,7 +538,7 @@ func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result { return &Result{Tenant: tenant, Message: ResourceDeleted} } -func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDetails, ca *v1alpha1.CAPApplication, subscription subscriptionType, step string) (saasData *util.SaasRegistryCredentials, smsData *util.SmsCredentials, err error) { +func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDetails, ca *v1alpha2.CAPApplication, subscription subscriptionType, step string) (saasData *util.SaasRegistryCredentials, smsData *util.SmsCredentials, err error) { switch subscription { case SMS: // fetch SMS information @@ -564,7 +564,7 @@ func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDet return } -func (s *SubscriptionHandler) checkCAPApp(providerSubaccountId, btpAppName string) (*v1alpha1.CAPApplication, error) { +func (s *SubscriptionHandler) checkCAPApp(providerSubaccountId, btpAppName string) (*v1alpha2.CAPApplication, error) { // First try to find CAPApplication by providerSubaccountId (appIdHash) labelSelector, _ := labels.ValidatedSelectorFromSet(map[string]string{ LabelAppIdHash: sha1Sum(providerSubaccountId, btpAppName), @@ -573,8 +573,8 @@ func (s *SubscriptionHandler) checkCAPApp(providerSubaccountId, btpAppName strin return s.getAppByLabelSelector(labelSelector) } -func (s *SubscriptionHandler) getAppByLabelSelector(labelSelector labels.Selector) (*v1alpha1.CAPApplication, error) { - capAppsList, err := s.Clientset.SmeV1alpha1().CAPApplications(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) +func (s *SubscriptionHandler) getAppByLabelSelector(labelSelector labels.Selector) (*v1alpha2.CAPApplication, error) { + capAppsList, err := s.Clientset.SmeV1alpha2().CAPApplications(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) if err != nil { return nil, err } @@ -615,7 +615,7 @@ func (s *SubscriptionHandler) checkCertIssuerAndSubject(xForwardedClientCert str return nil } -func (s *SubscriptionHandler) initializeCallback(appUrl, tenantName string, ca *v1alpha1.CAPApplication, callbackReqInfo *CallbackReqInfo, tenantIn tenantInfo, isProvisioning bool) { +func (s *SubscriptionHandler) initializeCallback(appUrl, tenantName string, ca *v1alpha2.CAPApplication, callbackReqInfo *CallbackReqInfo, tenantIn tenantInfo, isProvisioning bool) { step := TenantProvisioning if !isProvisioning { step = TenantDeprovisioning @@ -656,7 +656,7 @@ func (s *SubscriptionHandler) initializeCallback(appUrl, tenantName string, ca * }() } -func (s *SubscriptionHandler) getAppURL(payloadSubscriptionDomain, tenantSubdomain string, ca *v1alpha1.CAPApplication) (string, error) { +func (s *SubscriptionHandler) getAppURL(payloadSubscriptionDomain, tenantSubdomain string, ca *v1alpha2.CAPApplication) (string, error) { needsValidation := true var subscriptionDomain string // Check if subscription domain is provided in the request payload. @@ -688,7 +688,7 @@ func (s *SubscriptionHandler) getAppURL(payloadSubscriptionDomain, tenantSubdoma func (s *SubscriptionHandler) validateDomain(domain, namespace string) error { // First check for Domains in the apps namespace - domainsList, err := s.Clientset.SmeV1alpha1().Domains(namespace).List(context.TODO(), metav1.ListOptions{}) + domainsList, err := s.Clientset.SmeV1alpha2().Domains(namespace).List(context.TODO(), metav1.ListOptions{}) if err != nil { return err } @@ -699,7 +699,7 @@ func (s *SubscriptionHandler) validateDomain(domain, namespace string) error { } // Check for ClusterDomains if not found in the namespace - clusterDomainsList, err := s.Clientset.SmeV1alpha1().ClusterDomains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) + clusterDomainsList, err := s.Clientset.SmeV1alpha2().ClusterDomains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) if err != nil { return err } @@ -712,7 +712,7 @@ func (s *SubscriptionHandler) validateDomain(domain, namespace string) error { return fmt.Errorf("domain %s not found in Domains or ClusterDomains", domain) } -func (s *SubscriptionHandler) getPrimaryDomain(ca *v1alpha1.CAPApplication) string { +func (s *SubscriptionHandler) getPrimaryDomain(ca *v1alpha2.CAPApplication) string { // If no domainRefs are specified, return an empty string if len(ca.Spec.DomainRefs) == 0 { return "" @@ -720,15 +720,15 @@ func (s *SubscriptionHandler) getPrimaryDomain(ca *v1alpha1.CAPApplication) stri // Return the first domain as the primary domain primaryDomainRef := ca.Spec.DomainRefs[0] domain := "" - if primaryDomainRef.Kind == v1alpha1.DomainKind { - primaryDom, err := s.Clientset.SmeV1alpha1().Domains(ca.Namespace).Get(context.TODO(), primaryDomainRef.Name, metav1.GetOptions{}) + if primaryDomainRef.Kind == v1alpha2.DomainKind { + primaryDom, err := s.Clientset.SmeV1alpha2().Domains(ca.Namespace).Get(context.TODO(), primaryDomainRef.Name, metav1.GetOptions{}) if err != nil { util.LogError(err, "Error getting primary domain", TenantProvisioning, ca, nil, "domainRef", primaryDomainRef.Name) } else if primaryDom != nil { domain = primaryDom.Spec.Domain } } else { - primaryDom, err := s.Clientset.SmeV1alpha1().ClusterDomains(metav1.NamespaceAll).Get(context.TODO(), primaryDomainRef.Name, metav1.GetOptions{}) + primaryDom, err := s.Clientset.SmeV1alpha2().ClusterDomains(metav1.NamespaceAll).Get(context.TODO(), primaryDomainRef.Name, metav1.GetOptions{}) if err != nil { util.LogError(err, "Error getting primary cluster domain", TenantProvisioning, ca, nil, "domainRef", primaryDomainRef.Name) } else if primaryDom != nil { @@ -747,7 +747,7 @@ func (s *SubscriptionHandler) enrichAdditionalOutput(namespace string, tenantId return err } - tenantDataList, err := s.Clientset.SmeV1alpha1().CAPTenantOutputs(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) + tenantDataList, err := s.Clientset.SmeV1alpha2().CAPTenantOutputs(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) if err != nil { return err } @@ -785,7 +785,7 @@ func (s *SubscriptionHandler) checkCAPTenantStatus(ctx context.Context, tenantNa klog.Warningf("tenant status check: %s", timedCtx.Err().Error()) return false default: - capTenant, err := s.Clientset.SmeV1alpha1().CAPTenants(tenantNamespace).Get(context.TODO(), tenantName, metav1.GetOptions{}) + capTenant, err := s.Clientset.SmeV1alpha2().CAPTenants(tenantNamespace).Get(context.TODO(), tenantName, metav1.GetOptions{}) if k8sErrors.IsNotFound(err) { util.LogInfo("No tenant found.. Exiting CAPTenant status check.", step, "Tenant Status Check", nil, "tenantName", tenantName, "namespace", tenantNamespace) if !provisioning { @@ -794,9 +794,9 @@ func (s *SubscriptionHandler) checkCAPTenantStatus(ctx context.Context, tenantNa } if capTenant != nil { util.LogInfo("CAPTenant found", step, capTenant, nil, "tenantid", capTenant.Spec.TenantId, "status", capTenant.Status.State) - if provisioning && (capTenant.Status.State == v1alpha1.CAPTenantStateReady || capTenant.Status.State == v1alpha1.CAPTenantStateProvisioningError) { + if provisioning && (capTenant.Status.State == v1alpha2.CAPTenantStateReady || capTenant.Status.State == v1alpha2.CAPTenantStateProvisioningError) { util.LogInfo("Exiting CAPTenant status check", step, capTenant, nil, "tenantid", capTenant.Spec.TenantId, "status", capTenant.Status.State) - return capTenant.Status.State == v1alpha1.CAPTenantStateReady + return capTenant.Status.State == v1alpha2.CAPTenantStateReady } } time.Sleep(5 * time.Second) @@ -804,7 +804,7 @@ func (s *SubscriptionHandler) checkCAPTenantStatus(ctx context.Context, tenantNa } } -func (s *SubscriptionHandler) getServiceDetails(ca *v1alpha1.CAPApplication, step string) (saasData *util.SaasRegistryCredentials, uaaData *util.XSUAACredentials) { +func (s *SubscriptionHandler) getServiceDetails(ca *v1alpha2.CAPApplication, step string) (saasData *util.SaasRegistryCredentials, uaaData *util.XSUAACredentials) { var wg sync.WaitGroup wg.Go(func() { @@ -818,11 +818,11 @@ func (s *SubscriptionHandler) getServiceDetails(ca *v1alpha1.CAPApplication, ste return saasData, uaaData } -func (s *SubscriptionHandler) getSaasDetails(capApp *v1alpha1.CAPApplication, step string) *util.SaasRegistryCredentials { +func (s *SubscriptionHandler) getSaasDetails(capApp *v1alpha2.CAPApplication, step string) *util.SaasRegistryCredentials { var ( result *util.SaasRegistryCredentials = nil err error - info *v1alpha1.ServiceInfo + info *v1alpha2.ServiceInfo ) if info, err = s.getServiceInfo(capApp, "saas-registry"); err == nil { result, err = util.ReadServiceCredentialsFromSecret[util.SaasRegistryCredentials](info, capApp.Namespace, s.KubeClientset, false) @@ -833,11 +833,11 @@ func (s *SubscriptionHandler) getSaasDetails(capApp *v1alpha1.CAPApplication, st return result } -func (s *SubscriptionHandler) getXSUAADetails(capApp *v1alpha1.CAPApplication, step string) *util.XSUAACredentials { +func (s *SubscriptionHandler) getXSUAADetails(capApp *v1alpha2.CAPApplication, step string) *util.XSUAACredentials { var ( result *util.XSUAACredentials = nil err error - info *v1alpha1.ServiceInfo + info *v1alpha2.ServiceInfo ) info = util.GetXSUAAInfo(capApp.Spec.BTP.Services, capApp) @@ -853,11 +853,11 @@ func (s *SubscriptionHandler) getXSUAADetails(capApp *v1alpha1.CAPApplication, s return result } -func (s *SubscriptionHandler) getSmsDetails(capApp *v1alpha1.CAPApplication, step string) *util.SmsCredentials { +func (s *SubscriptionHandler) getSmsDetails(capApp *v1alpha2.CAPApplication, step string) *util.SmsCredentials { var ( result *util.SmsCredentials = nil err error - info *v1alpha1.ServiceInfo + info *v1alpha2.ServiceInfo ) if info, err = s.getServiceInfo(capApp, "subscription-manager"); err == nil { result, err = util.ReadServiceCredentialsFromSecret[util.SmsCredentials](info, capApp.Namespace, s.KubeClientset, false) @@ -868,7 +868,7 @@ func (s *SubscriptionHandler) getSmsDetails(capApp *v1alpha1.CAPApplication, ste return result } -func (s *SubscriptionHandler) getServiceInfo(ca *v1alpha1.CAPApplication, serviceClass string) (*v1alpha1.ServiceInfo, error) { +func (s *SubscriptionHandler) getServiceInfo(ca *v1alpha2.CAPApplication, serviceClass string) (*v1alpha2.ServiceInfo, error) { for i := range ca.Spec.BTP.Services { if ca.Spec.BTP.Services[i].Class == serviceClass { return &ca.Spec.BTP.Services[i], nil @@ -1145,7 +1145,7 @@ func (c *serviceCredentials) xsAppName() string { return "" } -func (s *SubscriptionHandler) getServiceDependencies(capApp *v1alpha1.CAPApplication, service v1alpha1.ServiceInfo) map[string]string { +func (s *SubscriptionHandler) getServiceDependencies(capApp *v1alpha2.CAPApplication, service v1alpha2.ServiceInfo) map[string]string { // Read credentials with metadata (as we need a check based on the plan serviceCredInfo, err := util.ReadServiceCredentialsFromSecret[serviceMetaInfo](&service, capApp.Namespace, s.KubeClientset, true) if err != nil { @@ -1169,12 +1169,12 @@ func (s *SubscriptionHandler) getServiceDependencies(capApp *v1alpha1.CAPApplica return nil } -func isServiceRelevantForDependencies(serviceInfo v1alpha1.ServiceInfo, creds *serviceMetaInfo) bool { - if serviceInfo.GetSubscriptionDependency() == v1alpha1.SubscriptionDependencyAlways { +func isServiceRelevantForDependencies(serviceInfo v1alpha2.ServiceInfo, creds *serviceMetaInfo) bool { + if serviceInfo.GetSubscriptionDependency() == v1alpha2.SubscriptionDependencyAlways { return true } - if serviceInfo.GetSubscriptionDependency() == v1alpha1.SubscriptionDependencyAuto { + if serviceInfo.GetSubscriptionDependency() == v1alpha2.SubscriptionDependencyAuto { return isSpecialDependency(serviceInfo, creds) || creds.Credentials.SaasRegistryEnabled } @@ -1183,7 +1183,7 @@ func isServiceRelevantForDependencies(serviceInfo v1alpha1.ServiceInfo, creds *s } // These services might need some special handling for now, until there is some clarity from BTP as to how saas-registry differentiates b/w xsappname and appId/appName dependencies. -func isSpecialDependency(serviceInfo v1alpha1.ServiceInfo, creds *serviceMetaInfo) bool { +func isSpecialDependency(serviceInfo v1alpha2.ServiceInfo, creds *serviceMetaInfo) bool { return serviceInfo.Class == "destination" || serviceInfo.Class == "connectivity" || (serviceInfo.Class == "auditlog" && creds.Plan == "oauth2") diff --git a/cmd/server/internal/handler_test.go b/cmd/server/internal/handler_test.go index 1b3940de..54f28236 100644 --- a/cmd/server/internal/handler_test.go +++ b/cmd/server/internal/handler_test.go @@ -26,7 +26,7 @@ import ( k8sfake "k8s.io/client-go/kubernetes/fake" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "github.com/sap/cap-operator/pkg/client/clientset/versioned/fake" ) @@ -221,8 +221,8 @@ func createTenantSubscriptionContextSecret(subscriptionContext string) runtime.O } } -func createCA() *v1alpha1.CAPApplication { - return &v1alpha1.CAPApplication{ +func createCA() *v1alpha2.CAPApplication { + return &v1alpha2.CAPApplication{ ObjectMeta: v1.ObjectMeta{ Name: caName, Namespace: v1.NamespaceDefault, @@ -230,15 +230,15 @@ func createCA() *v1alpha1.CAPApplication { LabelAppIdHash: sha1Sum(providerSubaccountId, appName), }, }, - Spec: v1alpha1.CAPApplicationSpec{ + Spec: v1alpha2.CAPApplicationSpec{ ProviderSubaccountId: providerSubaccountId, BTPAppName: appName, - Provider: &v1alpha1.BTPTenantIdentification{ + Provider: &v1alpha2.BTPTenantIdentification{ SubDomain: subDomain, TenantId: tenantId, }, - BTP: v1alpha1.BTP{ - Services: []v1alpha1.ServiceInfo{ + BTP: v1alpha2.BTP{ + Services: []v1alpha2.ServiceInfo{ { Class: "xsuaa", Name: "test-xsuaa", @@ -285,8 +285,8 @@ func createCA() *v1alpha1.CAPApplication { } } -func createCAT(ready bool, withProviderSubaccountId ...bool) *v1alpha1.CAPTenant { - cat := &v1alpha1.CAPTenant{ +func createCAT(ready bool, withProviderSubaccountId ...bool) *v1alpha2.CAPTenant { + cat := &v1alpha2.CAPTenant{ ObjectMeta: v1.ObjectMeta{ Name: catName, Namespace: v1.NamespaceDefault, @@ -298,9 +298,9 @@ func createCAT(ready bool, withProviderSubaccountId ...bool) *v1alpha1.CAPTenant AnnotationSubscriptionContextSecret: subscriptionContextSecretName, }, }, - Spec: v1alpha1.CAPTenantSpec{ + Spec: v1alpha2.CAPTenantSpec{ CAPApplicationInstance: caName, - BTPTenantIdentification: v1alpha1.BTPTenantIdentification{ + BTPTenantIdentification: v1alpha2.BTPTenantIdentification{ SubDomain: subDomain, TenantId: tenantId, }, @@ -311,12 +311,12 @@ func createCAT(ready bool, withProviderSubaccountId ...bool) *v1alpha1.CAPTenant cat.ObjectMeta.Annotations[MetadataSubscriptionGUID] = subscriptionGUID } if ready { - cat.Status = v1alpha1.CAPTenantStatus{ - State: v1alpha1.CAPTenantStateReady, + cat.Status = v1alpha2.CAPTenantStatus{ + State: v1alpha2.CAPTenantStateReady, CurrentCAPApplicationVersionInstance: "cap-version", - GenericStatus: v1alpha1.GenericStatus{ + GenericStatus: v1alpha2.GenericStatus{ Conditions: []v1.Condition{{ - Type: string(v1alpha1.ConditionTypeReady), + Type: string(v1alpha2.ConditionTypeReady), Status: "True", Reason: "TenantReady", }}, @@ -326,36 +326,36 @@ func createCAT(ready bool, withProviderSubaccountId ...bool) *v1alpha1.CAPTenant return cat } -func createDomain() *v1alpha1.Domain { - return &v1alpha1.Domain{ +func createDomain() *v1alpha2.Domain { + return &v1alpha2.Domain{ ObjectMeta: v1.ObjectMeta{ Name: "primary-domain", Namespace: v1.NamespaceDefault, }, - Spec: v1alpha1.DomainSpec{ + Spec: v1alpha2.DomainSpec{ Domain: "auth.service.local", IngressSelector: map[string]string{ "istio": "ingressgateway", "app": "istio-ingressgateway", }, - TLSMode: v1alpha1.TlsModeSimple, + TLSMode: v1alpha2.TlsModeSimple, DNSTarget: "in.service.local", }, } } -func createClusterDomain() *v1alpha1.ClusterDomain { - return &v1alpha1.ClusterDomain{ +func createClusterDomain() *v1alpha2.ClusterDomain { + return &v1alpha2.ClusterDomain{ ObjectMeta: v1.ObjectMeta{ Name: "external-domain", }, - Spec: v1alpha1.DomainSpec{ + Spec: v1alpha2.DomainSpec{ Domain: "external.service.sap", IngressSelector: map[string]string{ "istio": "ingressgateway", "app": "istio-ingressgateway", }, - TLSMode: v1alpha1.TlsModeSimple, + TLSMode: v1alpha2.TlsModeSimple, DNSTarget: "in.service.sap", }, } @@ -575,9 +575,9 @@ func Test_provisioning(t *testing.T) { for _, testData := range tests { t.Run(testData.name, func(t *testing.T) { - var ca *v1alpha1.CAPApplication - var cat *v1alpha1.CAPTenant - var ctout *v1alpha1.CAPTenantOutput + var ca *v1alpha2.CAPApplication + var cat *v1alpha2.CAPTenant + var ctout *v1alpha2.CAPTenantOutput runtimeObjs := []runtime.Object{} if testData.existingDomain { runtimeObjs = append(runtimeObjs, createDomain()) @@ -595,13 +595,13 @@ func Test_provisioning(t *testing.T) { } // Update the CA with the correct domainRefs if needed if testData.existingDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "Domain", Name: "primary-domain"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "Domain", Name: "primary-domain"}} } else if testData.existingClusterDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "ClusterDomain", Name: "external-domain"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "ClusterDomain", Name: "external-domain"}} } else if testData.invalidDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "Domain", Name: "foo"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "Domain", Name: "foo"}} } else if testData.invalidClusterDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "ClusterDomain", Name: "foo"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "ClusterDomain", Name: "foo"}} } runtimeObjs = append(runtimeObjs, ca) } @@ -610,7 +610,7 @@ func Test_provisioning(t *testing.T) { runtimeObjs = append(runtimeObjs, cat) } if testData.existingTenantOutput { - ctout = &v1alpha1.CAPTenantOutput{ObjectMeta: v1.ObjectMeta{Name: catName, Namespace: v1.NamespaceDefault, Labels: map[string]string{LabelTenantId: tenantId}}, Spec: v1alpha1.CAPTenantOutputSpec{SubscriptionCallbackData: "{\"foo3\":\"bar3\"}"}} + ctout = &v1alpha2.CAPTenantOutput{ObjectMeta: v1.ObjectMeta{Name: catName, Namespace: v1.NamespaceDefault, Labels: map[string]string{LabelTenantId: tenantId}}, Spec: v1alpha2.CAPTenantOutputSpec{SubscriptionCallbackData: "{\"foo3\":\"bar3\"}"}} runtimeObjs = append(runtimeObjs, ctout) } @@ -835,9 +835,9 @@ func Test_sms_provisioning(t *testing.T) { for _, testData := range tests { t.Run(testData.name, func(t *testing.T) { - var ca *v1alpha1.CAPApplication - var cat *v1alpha1.CAPTenant - var ctout *v1alpha1.CAPTenantOutput + var ca *v1alpha2.CAPApplication + var cat *v1alpha2.CAPTenant + var ctout *v1alpha2.CAPTenantOutput runtimeObjs := []runtime.Object{} if testData.existingDomain { runtimeObjs = append(runtimeObjs, createDomain()) @@ -855,13 +855,13 @@ func Test_sms_provisioning(t *testing.T) { } // Update the CA with the correct domainRefs if needed if testData.existingDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "Domain", Name: "primary-domain"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "Domain", Name: "primary-domain"}} } else if testData.existingClusterDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "ClusterDomain", Name: "external-domain"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "ClusterDomain", Name: "external-domain"}} } else if testData.invalidDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "Domain", Name: "foo"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "Domain", Name: "foo"}} } else if testData.invalidClusterDomain { - ca.Spec.DomainRefs = []v1alpha1.DomainRef{{Kind: "ClusterDomain", Name: "foo"}} + ca.Spec.DomainRefs = []v1alpha2.DomainRef{{Kind: "ClusterDomain", Name: "foo"}} } runtimeObjs = append(runtimeObjs, ca) } @@ -870,7 +870,7 @@ func Test_sms_provisioning(t *testing.T) { runtimeObjs = append(runtimeObjs, cat) } if testData.existingTenantOutput { - ctout = &v1alpha1.CAPTenantOutput{ObjectMeta: v1.ObjectMeta{Name: catName, Namespace: v1.NamespaceDefault, Labels: map[string]string{LabelTenantId: tenantId}}, Spec: v1alpha1.CAPTenantOutputSpec{SubscriptionCallbackData: "{\"foo3\":\"bar3\"}"}} + ctout = &v1alpha2.CAPTenantOutput{ObjectMeta: v1.ObjectMeta{Name: catName, Namespace: v1.NamespaceDefault, Labels: map[string]string{LabelTenantId: tenantId}}, Spec: v1alpha2.CAPTenantOutputSpec{SubscriptionCallbackData: "{\"foo3\":\"bar3\"}"}} runtimeObjs = append(runtimeObjs, ctout) } @@ -977,8 +977,8 @@ func Test_deprovisioning(t *testing.T) { for _, testData := range tests { t.Run(testData.name, func(t *testing.T) { - var ca *v1alpha1.CAPApplication - var cat *v1alpha1.CAPTenant + var ca *v1alpha2.CAPApplication + var cat *v1alpha2.CAPTenant runtimeObjs := []runtime.Object{} if testData.createCROs { ca = createCA() @@ -1075,8 +1075,8 @@ func Test_sms_deprovisioning(t *testing.T) { for _, testData := range tests { t.Run(testData.name, func(t *testing.T) { - var ca *v1alpha1.CAPApplication - var cat *v1alpha1.CAPTenant + var ca *v1alpha2.CAPApplication + var cat *v1alpha2.CAPTenant runtimeObjs := []runtime.Object{} if testData.createCROs { ca = createCA() @@ -1445,7 +1445,7 @@ func TestAppURL(t *testing.T) { payloadSubscriptionDomain string tenantSubdomain string caAnnotations map[string]string - domainRefs []v1alpha1.DomainRef + domainRefs []v1alpha2.DomainRef createDomain bool createClusterDomain bool expectedURL string @@ -1490,7 +1490,7 @@ func TestAppURL(t *testing.T) { name: "fallback to primary domain calculation (Domain ref)", payloadSubscriptionDomain: "", tenantSubdomain: subDomain, - domainRefs: []v1alpha1.DomainRef{{Kind: "Domain", Name: "primary-domain"}}, + domainRefs: []v1alpha2.DomainRef{{Kind: "Domain", Name: "primary-domain"}}, createDomain: true, expectedURL: "https://" + subDomain + ".auth.service.local", }, @@ -1498,7 +1498,7 @@ func TestAppURL(t *testing.T) { name: "fallback to primary domain calculation (ClusterDomain ref)", payloadSubscriptionDomain: "", tenantSubdomain: subDomain, - domainRefs: []v1alpha1.DomainRef{{Kind: "ClusterDomain", Name: "external-domain"}}, + domainRefs: []v1alpha2.DomainRef{{Kind: "ClusterDomain", Name: "external-domain"}}, createClusterDomain: true, expectedURL: "https://" + subDomain + ".external.service.sap", }, @@ -1614,7 +1614,7 @@ func TestGetDependencies(t *testing.T) { invalidURI bool expectedStatusCode int expectedResponse []map[string]string - caModifier func(*v1alpha1.CAPApplication) + caModifier func(*v1alpha2.CAPApplication) }{ { name: "Invalid get dependency request - wrong method", @@ -1651,8 +1651,8 @@ func TestGetDependencies(t *testing.T) { name: "SubscriptionDependency Always - service included regardless of class", method: http.MethodGet, expectedStatusCode: http.StatusOK, - caModifier: func(ca *v1alpha1.CAPApplication) { - dep := v1alpha1.SubscriptionDependencyAlways + caModifier: func(ca *v1alpha2.CAPApplication) { + dep := v1alpha2.SubscriptionDependencyAlways ca.Spec.BTP.Services[0].SubscriptionDependency = &dep // xsuaa: not auto-qualified, but Always forces inclusion }, expectedResponse: []map[string]string{ @@ -1667,8 +1667,8 @@ func TestGetDependencies(t *testing.T) { name: "SubscriptionDependency Auto - non-qualifying service excluded", method: http.MethodGet, expectedStatusCode: http.StatusOK, - caModifier: func(ca *v1alpha1.CAPApplication) { - dep := v1alpha1.SubscriptionDependencyAuto + caModifier: func(ca *v1alpha2.CAPApplication) { + dep := v1alpha2.SubscriptionDependencyAuto ca.Spec.BTP.Services[0].SubscriptionDependency = &dep // xsuaa: explicit Auto, still not qualified by class/credentials }, expectedResponse: []map[string]string{ @@ -1682,8 +1682,8 @@ func TestGetDependencies(t *testing.T) { name: "SubscriptionDependency Never - service excluded regardless of credentials", method: http.MethodGet, expectedStatusCode: http.StatusOK, - caModifier: func(ca *v1alpha1.CAPApplication) { - dep := v1alpha1.SubscriptionDependencyNever + caModifier: func(ca *v1alpha2.CAPApplication) { + dep := v1alpha2.SubscriptionDependencyNever ca.Spec.BTP.Services[4].SubscriptionDependency = &dep // destination: auto-qualified by class, but Never prevents inclusion }, expectedResponse: []map[string]string{ @@ -1749,7 +1749,7 @@ func TestGetSMSDependencies(t *testing.T) { invalidURI bool expectedStatusCode int expectedResponse []map[string]string - caModifier func(*v1alpha1.CAPApplication) + caModifier func(*v1alpha2.CAPApplication) }{ { name: "Invalid get SMS dependency request - wrong method", @@ -1786,8 +1786,8 @@ func TestGetSMSDependencies(t *testing.T) { name: "SubscriptionDependency Always - service included regardless of class", method: http.MethodGet, expectedStatusCode: http.StatusOK, - caModifier: func(ca *v1alpha1.CAPApplication) { - dep := v1alpha1.SubscriptionDependencyAlways + caModifier: func(ca *v1alpha2.CAPApplication) { + dep := v1alpha2.SubscriptionDependencyAlways ca.Spec.BTP.Services[0].SubscriptionDependency = &dep // xsuaa: not auto-qualified, but Always forces inclusion }, expectedResponse: []map[string]string{ @@ -1802,8 +1802,8 @@ func TestGetSMSDependencies(t *testing.T) { name: "SubscriptionDependency Auto - non-qualifying service excluded", method: http.MethodGet, expectedStatusCode: http.StatusOK, - caModifier: func(ca *v1alpha1.CAPApplication) { - dep := v1alpha1.SubscriptionDependencyAuto + caModifier: func(ca *v1alpha2.CAPApplication) { + dep := v1alpha2.SubscriptionDependencyAuto ca.Spec.BTP.Services[0].SubscriptionDependency = &dep // xsuaa: explicit Auto, still not qualified by class/credentials }, expectedResponse: []map[string]string{ @@ -1817,8 +1817,8 @@ func TestGetSMSDependencies(t *testing.T) { name: "SubscriptionDependency Never - service excluded regardless of credentials", method: http.MethodGet, expectedStatusCode: http.StatusOK, - caModifier: func(ca *v1alpha1.CAPApplication) { - dep := v1alpha1.SubscriptionDependencyNever + caModifier: func(ca *v1alpha2.CAPApplication) { + dep := v1alpha2.SubscriptionDependencyNever ca.Spec.BTP.Services[4].SubscriptionDependency = &dep // destination: auto-qualified by class, but Never prevents inclusion }, expectedResponse: []map[string]string{ diff --git a/cmd/web-hooks/internal/handler/handler.go b/cmd/web-hooks/internal/handler/handler.go index bce72777..398445f8 100644 --- a/cmd/web-hooks/internal/handler/handler.go +++ b/cmd/web-hooks/internal/handler/handler.go @@ -16,7 +16,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "github.com/sap/cap-operator/pkg/client/clientset/versioned" admissionv1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -64,7 +64,7 @@ type WebhookHandler struct { CrdClient versioned.Interface } -func checkWorkloadPort(workload *v1alpha1.WorkloadDetails) validateResource { +func checkWorkloadPort(workload *v1alpha2.WorkloadDetails) validateResource { if workload.DeploymentDefinition == nil { return validAdmissionReviewObj() } @@ -83,30 +83,30 @@ func checkWorkloadPort(workload *v1alpha1.WorkloadDetails) validateResource { if _, dup := seenPortNames[port.Name]; dup { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s duplicate port name: %s in workload - %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, port.Name, workload.Name), + message: fmt.Sprintf("%s %s duplicate port name: %s in workload - %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, port.Name, workload.Name), } } seenPortNames[port.Name] = struct{}{} if _, dup := seenPortNums[port.Port]; dup { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s duplicate port number: %d in workload - %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, port.Port, workload.Name), + message: fmt.Sprintf("%s %s duplicate port number: %d in workload - %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, port.Port, workload.Name), } } seenPortNums[port.Port] = struct{}{} } - if !routerDestinationNameFound && workload.DeploymentDefinition.Type == v1alpha1.DeploymentCAP { // workloads of type Additional need not have a router destination + if !routerDestinationNameFound && workload.DeploymentDefinition.Type == v1alpha2.DeploymentCAP { // workloads of type Additional need not have a router destination return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s routerDestinationName not defined in port configuration of workload - %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, workload.Name), + message: fmt.Sprintf("%s %s routerDestinationName not defined in port configuration of workload - %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, workload.Name), } } - if routerDestinationNameFound && workload.DeploymentDefinition.Type == v1alpha1.DeploymentRouter { + if routerDestinationNameFound && workload.DeploymentDefinition.Type == v1alpha2.DeploymentRouter { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s routerDestinationName should not be defined for workload of type Router - %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, workload.Name), + message: fmt.Sprintf("%s %s routerDestinationName should not be defined for workload of type Router - %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, workload.Name), } } @@ -114,22 +114,22 @@ func checkWorkloadPort(workload *v1alpha1.WorkloadDetails) validateResource { } var ( - validDeploymentTypes = []v1alpha1.DeploymentType{v1alpha1.DeploymentCAP, v1alpha1.DeploymentRouter, v1alpha1.DeploymentAdditional, v1alpha1.DeploymentService} - validJobTypes = []v1alpha1.JobType{v1alpha1.JobContent, v1alpha1.JobTenantOperation, v1alpha1.JobCustomTenantOperation} + validDeploymentTypes = []v1alpha2.DeploymentType{v1alpha2.DeploymentCAP, v1alpha2.DeploymentRouter, v1alpha2.DeploymentAdditional, v1alpha2.DeploymentService} + validJobTypes = []v1alpha2.JobType{v1alpha2.JobContent, v1alpha2.JobTenantOperation, v1alpha2.JobCustomTenantOperation} ) -func checkWorkloadType(workload *v1alpha1.WorkloadDetails) validateResource { +func checkWorkloadType(workload *v1alpha2.WorkloadDetails) validateResource { if workload.DeploymentDefinition != nil && !slices.Contains(validDeploymentTypes, workload.DeploymentDefinition.Type) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s invalid deployment definition type. Only supported - CAP, Router, Additional and Service", InvalidationMessage, v1alpha1.CAPApplicationVersionKind), + message: fmt.Sprintf("%s %s invalid deployment definition type. Only supported - CAP, Router, Additional and Service", InvalidationMessage, v1alpha2.CAPApplicationVersionKind), } } if workload.JobDefinition != nil && !slices.Contains(validJobTypes, workload.JobDefinition.Type) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s invalid job definition type. Only supported - Content, TenantOperation and CustomTenantOperation", InvalidationMessage, v1alpha1.CAPApplicationVersionKind), + message: fmt.Sprintf("%s %s invalid job definition type. Only supported - Content, TenantOperation and CustomTenantOperation", InvalidationMessage, v1alpha2.CAPApplicationVersionKind), } } @@ -144,7 +144,7 @@ func checkDerivedNameLength(cavName, workloadName, suffix, noun string) validate allowed: false, message: fmt.Sprintf( "%s %s Derived %s '%s' (length %d) exceeds max limit of %d characters. Please shorten CAPApplicationVersion name '%s' or workload name '%s'.", - InvalidationMessage, v1alpha1.CAPApplicationVersionKind, + InvalidationMessage, v1alpha2.CAPApplicationVersionKind, noun, derived, len(derived), maxNameLength, cavName, workloadName, ), } @@ -152,7 +152,7 @@ func checkDerivedNameLength(cavName, workloadName, suffix, noun string) validate return validAdmissionReviewObj() } -func checkWorkloadNameLength(cavObjNew *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails) validateResource { +func checkWorkloadNameLength(cavObjNew *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails) validateResource { if workload.DeploymentDefinition != nil { if v := checkDerivedNameLength(cavObjNew.Name, workload.Name, "svc", "service name"); !v.allowed { return v @@ -160,7 +160,7 @@ func checkWorkloadNameLength(cavObjNew *v1alpha1.CAPApplicationVersion, workload } // Content job length should not exceed 63 characters considering the generated pod name (final pod name => cavName-workloadName-q4m9c) - if workload.JobDefinition != nil && workload.JobDefinition.Type == v1alpha1.JobContent { + if workload.JobDefinition != nil && workload.JobDefinition.Type == v1alpha2.JobContent { if v := checkDerivedNameLength(cavObjNew.Name, workload.Name, "q4m9c", "content job pod name"); !v.allowed { return v } @@ -169,7 +169,7 @@ func checkWorkloadNameLength(cavObjNew *v1alpha1.CAPApplicationVersion, workload return validAdmissionReviewObj() } -func getWorkloadTypeCount(workloads []v1alpha1.WorkloadDetails) map[string]int { +func getWorkloadTypeCount(workloads []v1alpha2.WorkloadDetails) map[string]int { workloadTypeCount := make(map[string]int) for _, workload := range workloads { @@ -184,49 +184,49 @@ func getWorkloadTypeCount(workloads []v1alpha1.WorkloadDetails) map[string]int { return workloadTypeCount } -func IsServicesOnly(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) bool { +func IsServicesOnly(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) bool { // When CA isn't marked as ServicesOnly yet (reconcile hasn't fully completed) --> Determine ServicesOnly looking into tenant job workloads if ca.Status.ServicesOnly == nil { - return !slices.ContainsFunc(cav.Spec.Workloads, func(wd v1alpha1.WorkloadDetails) bool { - return wd.JobDefinition != nil && wd.JobDefinition.Type != v1alpha1.JobContent + return !slices.ContainsFunc(cav.Spec.Workloads, func(wd v1alpha2.WorkloadDetails) bool { + return wd.JobDefinition != nil && wd.JobDefinition.Type != v1alpha2.JobContent }) && ca.IsProviderEmpty() } return ca.IsServicesOnly() } -func checkWorkloadTypeCount(ca *v1alpha1.CAPApplication, cavObjNew *v1alpha1.CAPApplicationVersion) validateResource { +func checkWorkloadTypeCount(ca *v1alpha2.CAPApplication, cavObjNew *v1alpha2.CAPApplicationVersion) validateResource { workloadTypeCount := getWorkloadTypeCount(cavObjNew.Spec.Workloads) if !IsServicesOnly(ca, cavObjNew) { // tenant dependent scenario - if workloadTypeCount[string(v1alpha1.DeploymentCAP)] != 1 { + if workloadTypeCount[string(v1alpha2.DeploymentCAP)] != 1 { return validateResource{ allowed: false, - message: fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.DeploymentCAP, workloadTypeCount[string(v1alpha1.DeploymentCAP)], v1alpha1.DeploymentCAP), + message: fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.DeploymentCAP, workloadTypeCount[string(v1alpha2.DeploymentCAP)], v1alpha2.DeploymentCAP), } } - if workloadTypeCount[string(v1alpha1.DeploymentRouter)] != 1 { + if workloadTypeCount[string(v1alpha2.DeploymentRouter)] != 1 { return validateResource{ allowed: false, - message: fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.DeploymentRouter, workloadTypeCount[string(v1alpha1.DeploymentRouter)], v1alpha1.DeploymentRouter), + message: fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.DeploymentRouter, workloadTypeCount[string(v1alpha2.DeploymentRouter)], v1alpha2.DeploymentRouter), } } - if workloadTypeCount[string(v1alpha1.JobTenantOperation)] == 0 { + if workloadTypeCount[string(v1alpha2.JobTenantOperation)] == 0 { return validateResource{ allowed: false, - message: fmt.Sprintf(TenantOpMissingErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind), + message: fmt.Sprintf(TenantOpMissingErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind), } } } else { // tenant independent scenario - no tenant operations / custom tenant operation allowed - if workloadTypeCount[string(v1alpha1.JobTenantOperation)] != 0 || workloadTypeCount[string(v1alpha1.JobCustomTenantOperation)] != 0 { + if workloadTypeCount[string(v1alpha2.JobTenantOperation)] != 0 || workloadTypeCount[string(v1alpha2.JobCustomTenantOperation)] != 0 { return validateResource{ allowed: false, - message: fmt.Sprintf(TenantOpJobWorkloadCountErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.JobTenantOperation, v1alpha1.JobCustomTenantOperation), + message: fmt.Sprintf(TenantOpJobWorkloadCountErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.JobTenantOperation, v1alpha2.JobCustomTenantOperation), } } } @@ -234,24 +234,24 @@ func checkWorkloadTypeCount(ca *v1alpha1.CAPApplication, cavObjNew *v1alpha1.CAP return validAdmissionReviewObj() } -func getContentWorkloadNames(cavObjNew *v1alpha1.CAPApplicationVersion) []string { +func getContentWorkloadNames(cavObjNew *v1alpha2.CAPApplicationVersion) []string { contentJobWorkloads := []string{} for _, workload := range cavObjNew.Spec.Workloads { - if workload.JobDefinition != nil && workload.JobDefinition.Type == v1alpha1.JobContent { + if workload.JobDefinition != nil && workload.JobDefinition.Type == v1alpha2.JobContent { contentJobWorkloads = append(contentJobWorkloads, workload.Name) } } return contentJobWorkloads } -func checkWorkloadContentJob(cavObjNew *v1alpha1.CAPApplicationVersion) validateResource { +func checkWorkloadContentJob(cavObjNew *v1alpha2.CAPApplicationVersion) validateResource { contentJobWorkloads := getContentWorkloadNames(cavObjNew) if len(contentJobWorkloads) > 1 && cavObjNew.Spec.ContentJobs == nil { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s if there are more than one content job, contentJobs should be defined", InvalidationMessage, v1alpha1.CAPApplicationVersionKind), + message: fmt.Sprintf("%s %s if there are more than one content job, contentJobs should be defined", InvalidationMessage, v1alpha2.CAPApplicationVersionKind), } } @@ -261,7 +261,7 @@ func checkWorkloadContentJob(cavObjNew *v1alpha1.CAPApplicationVersion) validate if !slices.Contains(cavObjNew.Spec.ContentJobs, name) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s content job %s is not specified as part of ContentJobs", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, name), + message: fmt.Sprintf("%s %s content job %s is not specified as part of ContentJobs", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, name), } } } @@ -273,7 +273,7 @@ func checkWorkloadContentJob(cavObjNew *v1alpha1.CAPApplicationVersion) validate if !slices.Contains(contentJobWorkloads, job) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s job %s specified as part of ContentJobs is not a valid content job", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, job), + message: fmt.Sprintf("%s %s job %s specified as part of ContentJobs is not a valid content job", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, job), } } } @@ -282,7 +282,7 @@ func checkWorkloadContentJob(cavObjNew *v1alpha1.CAPApplicationVersion) validate return validAdmissionReviewObj() } -func getDeploymentPorts(cavObjNew *v1alpha1.CAPApplicationVersion) map[string][]int32 { +func getDeploymentPorts(cavObjNew *v1alpha2.CAPApplicationVersion) map[string][]int32 { deploymentPorts := make(map[string][]int32) for _, workload := range cavObjNew.Spec.Workloads { @@ -293,9 +293,9 @@ func getDeploymentPorts(cavObjNew *v1alpha1.CAPApplicationVersion) map[string][] ports := []int32{} if len(workload.DeploymentDefinition.Ports) == 0 { switch workload.DeploymentDefinition.Type { - case v1alpha1.DeploymentCAP: + case v1alpha2.DeploymentCAP: ports = append(ports, defaultServerPort) // adding default CAP port - case v1alpha1.DeploymentRouter: + case v1alpha2.DeploymentRouter: ports = append(ports, defaultRouterPort) // adding default Router port } } else { @@ -310,7 +310,7 @@ func getDeploymentPorts(cavObjNew *v1alpha1.CAPApplicationVersion) map[string][] return deploymentPorts } -func checkServiceExposure(cavObjNew *v1alpha1.CAPApplicationVersion) validateResource { +func checkServiceExposure(cavObjNew *v1alpha2.CAPApplicationVersion) validateResource { // check that all the workload names and ports mentioned in service exposures are valid // check that there are no duplicate subdomains in service exposures @@ -321,7 +321,7 @@ func checkServiceExposure(cavObjNew *v1alpha1.CAPApplicationVersion) validateRes if _, ok := seenSubdomains[serviceExposure.SubDomain]; ok { return validateResource{ allowed: false, - message: fmt.Sprintf(DuplicateServiceExposureSubDomainErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, serviceExposure.SubDomain), + message: fmt.Sprintf(DuplicateServiceExposureSubDomainErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, serviceExposure.SubDomain), } } @@ -332,13 +332,13 @@ func checkServiceExposure(cavObjNew *v1alpha1.CAPApplicationVersion) validateRes if !ok { return validateResource{ allowed: false, - message: fmt.Sprintf(ServiceExposureWorkloadNameErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, route.WorkloadName, serviceExposure.SubDomain), + message: fmt.Sprintf(ServiceExposureWorkloadNameErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, route.WorkloadName, serviceExposure.SubDomain), } } if !slices.Contains(ports, route.Port) { return validateResource{ allowed: false, - message: fmt.Sprintf(ServiceExposurePortErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, route.Port, route.WorkloadName, serviceExposure.SubDomain), + message: fmt.Sprintf(ServiceExposurePortErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, route.Port, route.WorkloadName, serviceExposure.SubDomain), } } } @@ -347,14 +347,14 @@ func checkServiceExposure(cavObjNew *v1alpha1.CAPApplicationVersion) validateRes return validAdmissionReviewObj() } -func validateWorkloads(ca *v1alpha1.CAPApplication, cavObjNew *v1alpha1.CAPApplicationVersion) validateResource { +func validateWorkloads(ca *v1alpha2.CAPApplication, cavObjNew *v1alpha2.CAPApplicationVersion) validateResource { seenWorkloadNames := make(map[string]struct{}) for _, workload := range cavObjNew.Spec.Workloads { if !workloadNameRegex.MatchString(workload.Name) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s Invalid workload name: %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, workload.Name), + message: fmt.Sprintf("%s %s Invalid workload name: %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, workload.Name), } } @@ -377,7 +377,7 @@ func validateWorkloads(ca *v1alpha1.CAPApplication, cavObjNew *v1alpha1.CAPAppli if _, ok := seenWorkloadNames[workload.Name]; ok { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s duplicate workload name: %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, workload.Name), + message: fmt.Sprintf("%s %s duplicate workload name: %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, workload.Name), } } @@ -395,34 +395,34 @@ func validateWorkloads(ca *v1alpha1.CAPApplication, cavObjNew *v1alpha1.CAPAppli return validAdmissionReviewObj() } -func checkWorkloadPodDistruptionBudget(workloadDetails *v1alpha1.WorkloadDetails) validateResource { +func checkWorkloadPodDistruptionBudget(workloadDetails *v1alpha2.WorkloadDetails) validateResource { // Invalidate configurations that specify a selector for PDB --> This is done exclusively by Operator as the configuration is workload specific. if workloadDetails.DeploymentDefinition != nil && workloadDetails.DeploymentDefinition.PodDisruptionBudget != nil && workloadDetails.DeploymentDefinition.PodDisruptionBudget.Selector != nil { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s selector must not be specified for podDisrptionBudget config in workload - %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, workloadDetails.Name), + message: fmt.Sprintf("%s %s selector must not be specified for podDisrptionBudget config in workload - %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, workloadDetails.Name), } } return validAdmissionReviewObj() } -func getTenantOperationsFromSpec(cavObjNew *v1alpha1.CAPApplicationVersion) map[string]int { +func getTenantOperationsFromSpec(cavObjNew *v1alpha2.CAPApplicationVersion) map[string]int { specTenantOperationsCntMap := make(map[string]int) ops := cavObjNew.Spec.TenantOperations - for _, ref := range append(append(append([]v1alpha1.TenantOperationWorkloadReference{}, ops.Provisioning...), ops.Deprovisioning...), ops.Upgrade...) { + for _, ref := range append(append(append([]v1alpha2.TenantOperationWorkloadReference{}, ops.Provisioning...), ops.Deprovisioning...), ops.Upgrade...) { specTenantOperationsCntMap[ref.WorkloadName]++ } return specTenantOperationsCntMap } -func checkForTenantOpJob(tenantOperations []v1alpha1.TenantOperationWorkloadReference, tenantOperationWorkloadCntMap map[string]int) bool { - return slices.ContainsFunc(tenantOperations, func(tenantOp v1alpha1.TenantOperationWorkloadReference) bool { +func checkForTenantOpJob(tenantOperations []v1alpha2.TenantOperationWorkloadReference, tenantOperationWorkloadCntMap map[string]int) bool { + return slices.ContainsFunc(tenantOperations, func(tenantOp v1alpha2.TenantOperationWorkloadReference) bool { return tenantOperationWorkloadCntMap[tenantOp.WorkloadName] > 0 }) } -func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[string]int, tenantOperationWorkloadCntMap map[string]int, cavObjNew *v1alpha1.CAPApplicationVersion) validateResource { +func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[string]int, tenantOperationWorkloadCntMap map[string]int, cavObjNew *v1alpha2.CAPApplicationVersion) validateResource { specTenantOperationsCntMap := getTenantOperationsFromSpec(cavObjNew) @@ -431,7 +431,7 @@ func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[s if specTenantOperationsCntMap[workloadTenantOperation] == 0 { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s workload tenant operation %s is not specified in spec.tenantOperations", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, workloadTenantOperation), + message: fmt.Sprintf("%s %s workload tenant operation %s is not specified in spec.tenantOperations", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, workloadTenantOperation), } } } @@ -441,7 +441,7 @@ func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[s if allTenantOperationsWorkloadCntMap[specTenantOperation] == 0 { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s %s specified in spec.tenantOperations is not a valid workload of type TenantOperation or CustomTenantOperation", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, specTenantOperation), + message: fmt.Sprintf("%s %s %s specified in spec.tenantOperations is not a valid workload of type TenantOperation or CustomTenantOperation", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, specTenantOperation), } } } @@ -449,7 +449,7 @@ func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[s // If spec.tenantOperations are defined for provisioning, upgrade or deprovisioning, one of the operation must be a tenant operation ops := cavObjNew.Spec.TenantOperations for _, phase := range []struct { - refs []v1alpha1.TenantOperationWorkloadReference + refs []v1alpha2.TenantOperationWorkloadReference name string }{ {ops.Provisioning, "provisioning"}, @@ -459,7 +459,7 @@ func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[s if phase.refs != nil && !checkForTenantOpJob(phase.refs, tenantOperationWorkloadCntMap) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.%s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, phase.name), + message: fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.%s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, phase.name), } } } @@ -467,7 +467,7 @@ func validateWorkloadsinTenantOperations(allTenantOperationsWorkloadCntMap map[s return validAdmissionReviewObj() } -func validateTenantOperations(cavObjNew *v1alpha1.CAPApplicationVersion) validateResource { +func validateTenantOperations(cavObjNew *v1alpha2.CAPApplicationVersion) validateResource { // Check: If a jobDefinition of type CustomTenantOperation is part of the workloads, spec.tenantOperations must be specified. It is possible to omit spec.tenantOperations when there are no jobs of type CustomTenantOperation and only one job of type TenantOperation // If spec.tenantOperations is specified, the entries (for provisioning, upgrade and deprovisioning) must include all spec.workloads.jobDefinitions of type TenantOperation // All the entries specified in spec.tenantOperations should be a valid workload of type TenantOperation or CustomTenantOperation @@ -479,10 +479,10 @@ func validateTenantOperations(cavObjNew *v1alpha1.CAPApplicationVersion) validat continue } switch workload.JobDefinition.Type { - case v1alpha1.JobTenantOperation: + case v1alpha2.JobTenantOperation: tenantOperationWorkloadCntMap[workload.Name]++ allTenantOperationsWorkloadCntMap[workload.Name]++ - case v1alpha1.JobCustomTenantOperation: + case v1alpha2.JobCustomTenantOperation: hasCustomTenantOp = true allTenantOperationsWorkloadCntMap[workload.Name]++ } @@ -497,7 +497,7 @@ func validateTenantOperations(cavObjNew *v1alpha1.CAPApplicationVersion) validat if hasCustomTenantOp && cavObjNew.Spec.TenantOperations == nil { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s - If a jobDefinition of type CustomTenantOperation is part of the workloads, then spec.tenantOperations must be specified", InvalidationMessage, v1alpha1.CAPApplicationVersionKind), + message: fmt.Sprintf("%s %s - If a jobDefinition of type CustomTenantOperation is part of the workloads, then spec.tenantOperations must be specified", InvalidationMessage, v1alpha2.CAPApplicationVersionKind), } } @@ -508,12 +508,12 @@ func validateTenantOperations(cavObjNew *v1alpha1.CAPApplicationVersion) validat return validAdmissionReviewObj() } -func (wh *WebhookHandler) checkCAPAppExists(cavObjNew *v1alpha1.CAPApplicationVersion) (ca *v1alpha1.CAPApplication, validateRes validateResource) { - app, err := wh.CrdClient.SmeV1alpha1().CAPApplications(cavObjNew.GetNamespace()).Get(context.TODO(), cavObjNew.Spec.CAPApplicationInstance, metav1.GetOptions{}) +func (wh *WebhookHandler) checkCAPAppExists(cavObjNew *v1alpha2.CAPApplicationVersion) (ca *v1alpha2.CAPApplication, validateRes validateResource) { + app, err := wh.CrdClient.SmeV1alpha2().CAPApplications(cavObjNew.GetNamespace()).Get(context.TODO(), cavObjNew.Spec.CAPApplicationInstance, metav1.GetOptions{}) if app == nil || err != nil { return nil, validateResource{ allowed: false, - message: fmt.Sprintf("%s %s no valid %s found for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPApplicationKind, cavObjNew.GetNamespace(), cavObjNew.GetName()), + message: fmt.Sprintf("%s %s no valid %s found for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.CAPApplicationKind, cavObjNew.GetNamespace(), cavObjNew.GetName()), } } @@ -521,19 +521,19 @@ func (wh *WebhookHandler) checkCAPAppExists(cavObjNew *v1alpha1.CAPApplicationVe } func (wh *WebhookHandler) validateCAPApplicationVersion(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) validateResource { - cavObjOld := v1alpha1.CAPApplicationVersion{} - cavObjNew := v1alpha1.CAPApplicationVersion{} + cavObjOld := v1alpha2.CAPApplicationVersion{} + cavObjNew := v1alpha2.CAPApplicationVersion{} // Note: Object is nil for "DELETE" operation if admissionReview.Request.Operation == admissionv1.Create || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &cavObjNew, v1alpha1.CAPApplicationVersionKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &cavObjNew, v1alpha2.CAPApplicationVersionKind); !validatedResource.allowed { return validatedResource } } // Note: OldObject is nil for "CONNECT" and "CREATE" operations if admissionReview.Request.Operation == admissionv1.Delete || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.OldObject.Raw, &cavObjOld, v1alpha1.CAPApplicationVersionKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.OldObject.Raw, &cavObjOld, v1alpha2.CAPApplicationVersionKind); !validatedResource.allowed { return validatedResource } } @@ -548,13 +548,13 @@ func (wh *WebhookHandler) validateCAPApplicationVersion(w http.ResponseWriter, a if admissionReview.Request.Operation == admissionv1.Update && !cmp.Equal(cavObjOld.Spec, cavObjNew.Spec, cmpopts.EquateEmpty()) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s spec cannot be modified for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, cavObjNew.GetNamespace(), cavObjNew.GetName()), + message: fmt.Sprintf("%s %s spec cannot be modified for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, cavObjNew.GetNamespace(), cavObjNew.GetName()), } } return validAdmissionReviewObj() } -func (wh *WebhookHandler) checkCAVCreate(cav *v1alpha1.CAPApplicationVersion) validateResource { +func (wh *WebhookHandler) checkCAVCreate(cav *v1alpha2.CAPApplicationVersion) validateResource { // Check: CAPApplication exists ca, capAppExistsValidate := wh.checkCAPAppExists(cav) if !capAppExistsValidate.allowed { @@ -572,36 +572,36 @@ func (wh *WebhookHandler) checkCAVCreate(cav *v1alpha1.CAPApplicationVersion) va return validateTenantOperations(cav) } -func (wh *WebhookHandler) checkCaIsConsistent(catObjOld v1alpha1.CAPTenant) validateResource { +func (wh *WebhookHandler) checkCaIsConsistent(catObjOld v1alpha2.CAPTenant) validateResource { - ca, err := wh.CrdClient.SmeV1alpha1().CAPApplications(catObjOld.GetNamespace()).Get(context.TODO(), catObjOld.Spec.CAPApplicationInstance, metav1.GetOptions{}) + ca, err := wh.CrdClient.SmeV1alpha2().CAPApplications(catObjOld.GetNamespace()).Get(context.TODO(), catObjOld.Spec.CAPApplicationInstance, metav1.GetOptions{}) - if ca != nil && err == nil && !ca.IsProviderEmpty() && ca.Status.State == v1alpha1.CAPApplicationStateConsistent && catObjOld.GetLabels()[LabelTenantType] == ProviderTenantType && catObjOld.Status.State == v1alpha1.CAPTenantStateReady { + if ca != nil && err == nil && !ca.IsProviderEmpty() && ca.Status.State == v1alpha2.CAPApplicationStateConsistent && catObjOld.GetLabels()[LabelTenantType] == ProviderTenantType && catObjOld.Status.State == v1alpha2.CAPTenantStateReady { return validateResource{ allowed: false, - message: fmt.Sprintf("%s provider %s %s cannot be deleted when a consistent %s %s exists. Delete the %s or remove it's provider section instead to delete this tenant", InvalidationMessage, v1alpha1.CAPTenantKind, catObjOld.Name, v1alpha1.CAPApplicationKind, ca.Name, v1alpha1.CAPApplicationKind), + message: fmt.Sprintf("%s provider %s %s cannot be deleted when a consistent %s %s exists. Delete the %s or remove it's provider section instead to delete this tenant", InvalidationMessage, v1alpha2.CAPTenantKind, catObjOld.Name, v1alpha2.CAPApplicationKind, ca.Name, v1alpha2.CAPApplicationKind), } } return validAdmissionReviewObj() } func (wh *WebhookHandler) checkForDuplicateDomains(domain, name string) validateResource { - clusterDoms, _ := wh.CrdClient.SmeV1alpha1().ClusterDomains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) + clusterDoms, _ := wh.CrdClient.SmeV1alpha2().ClusterDomains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) for _, clusterDom := range clusterDoms.Items { if clusterDom.Spec.Domain == domain && clusterDom.Name != name { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s %s already exist with domain %s", InvalidationMessage, v1alpha1.ClusterDomainKind, clusterDom.Name, domain), + message: fmt.Sprintf("%s %s %s already exist with domain %s", InvalidationMessage, v1alpha2.ClusterDomainKind, clusterDom.Name, domain), } } } - doms, _ := wh.CrdClient.SmeV1alpha1().Domains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) + doms, _ := wh.CrdClient.SmeV1alpha2().Domains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) for _, dom := range doms.Items { if dom.Spec.Domain == domain && dom.Name != name { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s %s already exist in namespace %s with domain %s", InvalidationMessage, v1alpha1.DomainKind, dom.Name, dom.Namespace, domain), + message: fmt.Sprintf("%s %s %s already exist in namespace %s with domain %s", InvalidationMessage, v1alpha2.DomainKind, dom.Name, dom.Namespace, domain), } } } @@ -610,9 +610,9 @@ func (wh *WebhookHandler) checkForDuplicateDomains(domain, name string) validate } func (wh *WebhookHandler) validateClusterDomain(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) validateResource { - clusterDomObjNew := v1alpha1.ClusterDomain{} + clusterDomObjNew := v1alpha2.ClusterDomain{} if admissionReview.Request.Operation == admissionv1.Create || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &clusterDomObjNew, v1alpha1.ClusterDomainKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &clusterDomObjNew, v1alpha2.ClusterDomainKind); !validatedResource.allowed { return validatedResource } @@ -624,9 +624,9 @@ func (wh *WebhookHandler) validateClusterDomain(w http.ResponseWriter, admission } func (wh *WebhookHandler) validateDomain(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) validateResource { - domObjNew := v1alpha1.Domain{} + domObjNew := v1alpha2.Domain{} if admissionReview.Request.Operation == admissionv1.Create || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &domObjNew, v1alpha1.DomainKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &domObjNew, v1alpha2.DomainKind); !validatedResource.allowed { return validatedResource } @@ -638,28 +638,28 @@ func (wh *WebhookHandler) validateDomain(w http.ResponseWriter, admissionReview } func (wh *WebhookHandler) validateCAPTenant(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) validateResource { - catObjOld := v1alpha1.CAPTenant{} - catObjNew := v1alpha1.CAPTenant{} + catObjOld := v1alpha2.CAPTenant{} + catObjNew := v1alpha2.CAPTenant{} // Note: Object is nil for "DELETE" operation if admissionReview.Request.Operation == admissionv1.Create || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &catObjNew, v1alpha1.CAPTenantKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &catObjNew, v1alpha2.CAPTenantKind); !validatedResource.allowed { return validatedResource } } // Note: OldObject is nil for "CONNECT" and "CREATE" operations if admissionReview.Request.Operation == admissionv1.Delete || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.OldObject.Raw, &catObjOld, v1alpha1.CAPTenantKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.OldObject.Raw, &catObjOld, v1alpha2.CAPTenantKind); !validatedResource.allowed { return validatedResource } } // check: CAPApplication exists on create if admissionReview.Request.Operation == admissionv1.Create { - if app, err := wh.CrdClient.SmeV1alpha1().CAPApplications(catObjNew.GetNamespace()).Get(context.TODO(), catObjNew.Spec.CAPApplicationInstance, metav1.GetOptions{}); app == nil || err != nil { + if app, err := wh.CrdClient.SmeV1alpha2().CAPApplications(catObjNew.GetNamespace()).Get(context.TODO(), catObjNew.Spec.CAPApplicationInstance, metav1.GetOptions{}); app == nil || err != nil { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s no valid %s found for: %s.%s", InvalidationMessage, v1alpha1.CAPTenantKind, v1alpha1.CAPApplicationKind, catObjNew.GetNamespace(), catObjNew.GetName()), + message: fmt.Sprintf("%s %s no valid %s found for: %s.%s", InvalidationMessage, v1alpha2.CAPTenantKind, v1alpha2.CAPApplicationKind, catObjNew.GetNamespace(), catObjNew.GetName()), } } } @@ -667,7 +667,7 @@ func (wh *WebhookHandler) validateCAPTenant(w http.ResponseWriter, admissionRevi if admissionReview.Request.Operation == admissionv1.Update && catObjOld.Spec.CAPApplicationInstance != catObjNew.Spec.CAPApplicationInstance { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s capApplicationInstance value cannot be modified for: %s.%s", InvalidationMessage, v1alpha1.CAPTenantKind, catObjNew.GetNamespace(), catObjNew.GetName()), + message: fmt.Sprintf("%s %s capApplicationInstance value cannot be modified for: %s.%s", InvalidationMessage, v1alpha2.CAPTenantKind, catObjNew.GetNamespace(), catObjNew.GetName()), } } @@ -680,13 +680,13 @@ func (wh *WebhookHandler) validateCAPTenant(w http.ResponseWriter, admissionRevi } func (wh *WebhookHandler) validateCAPTenantOutput(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) validateResource { - ctoutObjNew := v1alpha1.CAPTenantOutput{} + ctoutObjNew := v1alpha2.CAPTenantOutput{} if admissionReview.Request.Operation == admissionv1.Delete { return validAdmissionReviewObj() } - if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &ctoutObjNew, v1alpha1.CAPTenantOutputKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &ctoutObjNew, v1alpha2.CAPTenantOutputKind); !validatedResource.allowed { return validatedResource } @@ -694,16 +694,16 @@ func (wh *WebhookHandler) validateCAPTenantOutput(w http.ResponseWriter, admissi if !exists { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s label %s missing on CAP tenant output %s", InvalidationMessage, v1alpha1.CAPTenantOutputKind, LabelTenantId, ctoutObjNew.Name), + message: fmt.Sprintf("%s %s label %s missing on CAP tenant output %s", InvalidationMessage, v1alpha2.CAPTenantOutputKind, LabelTenantId, ctoutObjNew.Name), } } labelSelector, _ := labels.ValidatedSelectorFromSet(map[string]string{LabelTenantId: tenantId}) - ctList, err := wh.CrdClient.SmeV1alpha1().CAPTenants(ctoutObjNew.Namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) + ctList, err := wh.CrdClient.SmeV1alpha2().CAPTenants(ctoutObjNew.Namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: labelSelector.String()}) if err != nil || len(ctList.Items) == 0 { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s label %s on CAP tenant output %s does not contain a valid tenant ID", InvalidationMessage, v1alpha1.CAPTenantOutputKind, LabelTenantId, ctoutObjNew.Name), + message: fmt.Sprintf("%s %s label %s on CAP tenant output %s does not contain a valid tenant ID", InvalidationMessage, v1alpha2.CAPTenantOutputKind, LabelTenantId, ctoutObjNew.Name), } } @@ -711,18 +711,18 @@ func (wh *WebhookHandler) validateCAPTenantOutput(w http.ResponseWriter, admissi } func (wh *WebhookHandler) validateCAPApplication(w http.ResponseWriter, admissionReview *admissionv1.AdmissionReview) validateResource { - caObjOld := v1alpha1.CAPApplication{} - caObjNew := v1alpha1.CAPApplication{} + caObjOld := v1alpha2.CAPApplication{} + caObjNew := v1alpha2.CAPApplication{} // Note: OldObject is nil for "CONNECT" and "CREATE" operations if admissionReview.Request.Operation == admissionv1.Delete || admissionReview.Request.Operation == admissionv1.Update { - if validatedResource := unmarshalRawObj(w, admissionReview.Request.OldObject.Raw, &caObjOld, v1alpha1.CAPApplicationKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.OldObject.Raw, &caObjOld, v1alpha2.CAPApplicationKind); !validatedResource.allowed { return validatedResource } } if admissionReview.Request.Operation == admissionv1.Update || admissionReview.Request.Operation == admissionv1.Create { // Note: Object is nil for "DELETE" operation - if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &caObjNew, v1alpha1.CAPApplicationKind); !validatedResource.allowed { + if validatedResource := unmarshalRawObj(w, admissionReview.Request.Object.Raw, &caObjNew, v1alpha2.CAPApplicationKind); !validatedResource.allowed { return validatedResource } } @@ -731,23 +731,7 @@ func (wh *WebhookHandler) validateCAPApplication(w http.ResponseWriter, admissio if admissionReview.Request.Operation == admissionv1.Update && !caObjNew.IsProviderEmpty() && !cmp.Equal(caObjNew.Spec.Provider, caObjOld.Spec.Provider) { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s provider details cannot be changed for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), - } - } - - // Domains are DEPRECATED - if admissionReview.Request.Operation == admissionv1.Create && !cmp.Equal(caObjNew.Spec.Domains, v1alpha1.ApplicationDomains{}) { - return validateResource{ - allowed: false, - message: fmt.Sprintf(DomainsDeprecated, InvalidationMessage, v1alpha1.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), - } - } - - // check: cannot switch from domainRefs to domains - if admissionReview.Request.Operation == admissionv1.Update && (len(caObjOld.Spec.DomainRefs) > 0 && !cmp.Equal(caObjNew.Spec.Domains, v1alpha1.ApplicationDomains{})) { - return validateResource{ - allowed: false, - message: fmt.Sprintf(DomainsDeprecated, InvalidationMessage, v1alpha1.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), + message: fmt.Sprintf("%s %s provider details cannot be changed for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), } } @@ -759,19 +743,19 @@ func (wh *WebhookHandler) validateCAPApplication(w http.ResponseWriter, admissio } // ensures providerSubaccountId and btpAppName are immutable once set and that their combination is unique -func (wh *WebhookHandler) validateCAPApplicationIdentifiers(operation admissionv1.Operation, caObjOld, caObjNew v1alpha1.CAPApplication) validateResource { +func (wh *WebhookHandler) validateCAPApplicationIdentifiers(operation admissionv1.Operation, caObjOld, caObjNew v1alpha2.CAPApplication) validateResource { // providerSubaccountId and btpAppName are required and cannot be updated if operation == admissionv1.Update { if caObjNew.Spec.ProviderSubaccountId != caObjOld.Spec.ProviderSubaccountId { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s providerSubaccountId cannot be changed for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), + message: fmt.Sprintf("%s %s providerSubaccountId cannot be changed for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), } } if caObjNew.Spec.BTPAppName != caObjOld.Spec.BTPAppName { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s btpAppName cannot be changed for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), + message: fmt.Sprintf("%s %s btpAppName cannot be changed for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationKind, caObjNew.GetNamespace(), caObjNew.GetName()), } } } @@ -784,8 +768,8 @@ func (wh *WebhookHandler) validateCAPApplicationIdentifiers(operation admissionv return validAdmissionReviewObj() } -func (wh *WebhookHandler) checkForDuplicateCAPApplication(ca v1alpha1.CAPApplication) validateResource { - caList, _ := wh.CrdClient.SmeV1alpha1().CAPApplications(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) +func (wh *WebhookHandler) checkForDuplicateCAPApplication(ca v1alpha2.CAPApplication) validateResource { + caList, _ := wh.CrdClient.SmeV1alpha2().CAPApplications(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) for _, existingCa := range caList.Items { // skip the same object (identified by namespace and name) if existingCa.Namespace == ca.Namespace && existingCa.Name == ca.Name { @@ -794,7 +778,7 @@ func (wh *WebhookHandler) checkForDuplicateCAPApplication(ca v1alpha1.CAPApplica if existingCa.Spec.ProviderSubaccountId == ca.Spec.ProviderSubaccountId && existingCa.Spec.BTPAppName == ca.Spec.BTPAppName { return validateResource{ allowed: false, - message: fmt.Sprintf("%s %s %s already exists in namespace %s with the same providerSubaccountId %s and btpAppName %s", InvalidationMessage, v1alpha1.CAPApplicationKind, existingCa.Name, existingCa.Namespace, ca.Spec.ProviderSubaccountId, ca.Spec.BTPAppName), + message: fmt.Sprintf("%s %s %s already exists in namespace %s with the same providerSubaccountId %s and btpAppName %s", InvalidationMessage, v1alpha2.CAPApplicationKind, existingCa.Name, existingCa.Namespace, ca.Spec.ProviderSubaccountId, ca.Spec.BTPAppName), } } } @@ -828,17 +812,17 @@ func (wh *WebhookHandler) Validate(w http.ResponseWriter, r *http.Request) { validation := validAdmissionReviewObj() switch admissionReview.Request.Kind.Kind { - case v1alpha1.CAPApplicationVersionKind: + case v1alpha2.CAPApplicationVersionKind: validation = wh.validateCAPApplicationVersion(w, admissionReview) - case v1alpha1.CAPTenantKind: + case v1alpha2.CAPTenantKind: validation = wh.validateCAPTenant(w, admissionReview) - case v1alpha1.CAPApplicationKind: + case v1alpha2.CAPApplicationKind: validation = wh.validateCAPApplication(w, admissionReview) - case v1alpha1.CAPTenantOutputKind: + case v1alpha2.CAPTenantOutputKind: validation = wh.validateCAPTenantOutput(w, admissionReview) - case v1alpha1.ClusterDomainKind: + case v1alpha2.ClusterDomainKind: validation = wh.validateClusterDomain(w, admissionReview) - case v1alpha1.DomainKind: + case v1alpha2.DomainKind: validation = wh.validateDomain(w, admissionReview) } diff --git a/cmd/web-hooks/internal/handler/handler_test.go b/cmd/web-hooks/internal/handler/handler_test.go index ea1d5af2..166b3529 100644 --- a/cmd/web-hooks/internal/handler/handler_test.go +++ b/cmd/web-hooks/internal/handler/handler_test.go @@ -8,6 +8,7 @@ package handler import ( "bytes" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -15,7 +16,7 @@ import ( "strings" "testing" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" fakeCrdClient "github.com/sap/cap-operator/pkg/client/clientset/versioned/fake" admissionv1 "k8s.io/api/admission/v1" policyv1 "k8s.io/api/policy/v1" @@ -46,31 +47,35 @@ const ( consumedBTPServicesUpdate versionUpdate imageUpdate - domainsUpdate - useDomains providerSubaccountIdUpdate btpAppNameUpdate duplicateAppIdentifier ) -func createCaCRO(serviceOnlyScenario ...bool) *v1alpha1.CAPApplication { - provider := &v1alpha1.BTPTenantIdentification{} +type testReader struct{} + +func (tr *testReader) Read(_ []byte) (n int, err error) { + return 0, errors.New("test error") +} + +func createCaCRO(serviceOnlyScenario ...bool) *v1alpha2.CAPApplication { + provider := &v1alpha2.BTPTenantIdentification{} isServicesOnly := false if serviceOnlyScenario == nil || !serviceOnlyScenario[0] { - provider = &v1alpha1.BTPTenantIdentification{ + provider = &v1alpha2.BTPTenantIdentification{ SubDomain: subDomain, TenantId: tenantId, } } else { isServicesOnly = serviceOnlyScenario[0] } - return &v1alpha1.CAPApplication{ + return &v1alpha2.CAPApplication{ ObjectMeta: metav1.ObjectMeta{ Name: caName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationSpec{ - DomainRefs: []v1alpha1.DomainRef{ + Spec: v1alpha2.CAPApplicationSpec{ + DomainRefs: []v1alpha2.DomainRef{ { Kind: "Domain", Name: "primaryDomain", @@ -83,8 +88,8 @@ func createCaCRO(serviceOnlyScenario ...bool) *v1alpha1.CAPApplication { ProviderSubaccountId: "providerSubaccountId", BTPAppName: "btpApplicationName", Provider: provider, - BTP: v1alpha1.BTP{ - Services: []v1alpha1.ServiceInfo{ + BTP: v1alpha2.BTP{ + Services: []v1alpha2.ServiceInfo{ { Class: "xsuaa", Name: "test-xsuaa", @@ -118,8 +123,8 @@ func createCaCRO(serviceOnlyScenario ...bool) *v1alpha1.CAPApplication { }, }, }, - Status: v1alpha1.CAPApplicationStatus{ - State: v1alpha1.CAPApplicationStateConsistent, + Status: v1alpha2.CAPApplicationStatus{ + State: v1alpha2.CAPApplicationStateConsistent, ServicesOnly: &isServicesOnly, }, } @@ -141,10 +146,8 @@ func getHttpRequest(operation admissionv1.Operation, crdType string, crdName str func createAdmissionRequest(operation admissionv1.Operation, crdType string, crdName string, change updateType) (*admissionv1.AdmissionReview, error) { admissionReview := &admissionv1.AdmissionReview{ - TypeMeta: metav1.TypeMeta{ - Kind: crdType, - APIVersion: apiVersion, - }, + Kind: crdType, + APIVersion: apiVersion, Request: &admissionv1.AdmissionRequest{ Name: crdName, Kind: metav1.GroupVersionKind{ @@ -161,23 +164,19 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd switch crdType { - case v1alpha1.CAPApplicationKind: - crd := &v1alpha1.CAPApplication{} - crd = &v1alpha1.CAPApplication{ - TypeMeta: metav1.TypeMeta{ - Kind: crdType, - }, - ObjectMeta: metav1.ObjectMeta{ - Name: caName, - Namespace: metav1.NamespaceDefault, - }, - Spec: v1alpha1.CAPApplicationSpec{ - Provider: &v1alpha1.BTPTenantIdentification{ + case v1alpha2.CAPApplicationKind: + crd := &v1alpha2.CAPApplication{} + crd = &v1alpha2.CAPApplication{ + Kind: crdType, + Name: caName, + Namespace: metav1.NamespaceDefault, + Spec: v1alpha2.CAPApplicationSpec{ + Provider: &v1alpha2.BTPTenantIdentification{ SubDomain: subDomain, TenantId: tenantId, }, - BTP: v1alpha1.BTP{}, - DomainRefs: []v1alpha1.DomainRef{ + BTP: v1alpha2.BTP{}, + DomainRefs: []v1alpha2.DomainRef{ { Kind: "Domain", Name: "primaryDomain", @@ -207,10 +206,6 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd // new object has no provider, old object has provider crd.Spec.Provider = nil rawBytes, err = json.Marshal(crd) - case domainsUpdate: - crd.Spec.DomainRefs = []v1alpha1.DomainRef{} - crd.Spec.Domains = v1alpha1.ApplicationDomains{Primary: "primaryDomain", IstioIngressGatewayLabels: []v1alpha1.NameValue{{Name: "foo", Value: "bar"}}} - rawBytes, err = json.Marshal(crd) case providerSubaccountIdUpdate: // old and new both have the identifiers set, but providerSubaccountId differs crd.Spec.ProviderSubaccountId = "providerSubaccountId" @@ -239,21 +234,15 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd } } - if operation == admissionv1.Create && change == useDomains && err == nil { - crd.Spec.DomainRefs = []v1alpha1.DomainRef{} - crd.Spec.Domains = v1alpha1.ApplicationDomains{Primary: "primaryDomain", IstioIngressGatewayLabels: []v1alpha1.NameValue{{Name: "foo", Value: "bar"}}} - rawBytes, err = json.Marshal(crd) - } - if operation == admissionv1.Create && change == duplicateAppIdentifier && err == nil { crd.Spec.ProviderSubaccountId = "providerSubaccountId" crd.Spec.BTPAppName = "btpApplicationName" rawBytes, err = json.Marshal(crd) } - case v1alpha1.CAPApplicationVersionKind: - crd := &v1alpha1.CAPApplicationVersion{} + case v1alpha2.CAPApplicationVersionKind: + crd := &v1alpha2.CAPApplicationVersion{} - crd = &v1alpha1.CAPApplicationVersion{ + crd = &v1alpha2.CAPApplicationVersion{ TypeMeta: metav1.TypeMeta{ Kind: crdType, }, @@ -261,15 +250,15 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd Name: crdName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -277,9 +266,9 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd { Name: "cap-router", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -287,9 +276,9 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd { Name: "content", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -297,9 +286,9 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd { Name: "tenant-op", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -327,9 +316,9 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd } rawBytesOld, err = json.Marshal(crdOld) } - case v1alpha1.CAPTenantKind: - crd := &v1alpha1.CAPTenant{} - crd = &v1alpha1.CAPTenant{ + case v1alpha2.CAPTenantKind: + crd := &v1alpha2.CAPTenant{} + crd = &v1alpha2.CAPTenant{ TypeMeta: metav1.TypeMeta{ Kind: crdType, }, @@ -340,11 +329,11 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd LabelTenantType: ProviderTenantType, }, }, - Spec: v1alpha1.CAPTenantSpec{ + Spec: v1alpha2.CAPTenantSpec{ CAPApplicationInstance: caName, }, - Status: v1alpha1.CAPTenantStatus{ - State: v1alpha1.CAPTenantStateReady, + Status: v1alpha2.CAPTenantStatus{ + State: v1alpha2.CAPTenantStateReady, }, } @@ -358,8 +347,8 @@ func createAdmissionRequest(operation admissionv1.Operation, crdType string, crd } } case "Dummy": - admissionReview.Kind = v1alpha1.CAPApplicationVersionKind - admissionReview.Request.Kind.Kind = v1alpha1.CAPApplicationVersionKind + admissionReview.Kind = v1alpha2.CAPApplicationVersionKind + admissionReview.Request.Kind.Kind = v1alpha2.CAPApplicationVersionKind rawBytes, err = json.Marshal(`{}`) } @@ -464,36 +453,36 @@ func TestCavAndCatValidity(t *testing.T) { }{ { operation: admissionv1.Update, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, }, { operation: admissionv1.Create, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, }, { operation: admissionv1.Delete, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, }, { operation: admissionv1.Connect, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, }, { operation: admissionv1.Update, - crdType: v1alpha1.CAPTenantKind, + crdType: v1alpha2.CAPTenantKind, }, { operation: admissionv1.Create, - crdType: v1alpha1.CAPTenantKind, + crdType: v1alpha2.CAPTenantKind, }, { operation: admissionv1.Delete, - crdType: v1alpha1.CAPTenantKind, + crdType: v1alpha2.CAPTenantKind, backlogItems: []string{"ERP4SMEPREPWORKAPPPLAT-2520"}, }, { operation: admissionv1.Connect, - crdType: v1alpha1.CAPTenantKind, + crdType: v1alpha2.CAPTenantKind, }, } for _, test := range tests { @@ -501,7 +490,7 @@ func TestCavAndCatValidity(t *testing.T) { testName := strings.Join(append(nameParts, test.backlogItems...), " ") t.Run(testName, func(t *testing.T) { crdName := cavName - if test.crdType == v1alpha1.CAPTenantKind { + if test.crdType == v1alpha2.CAPTenantKind { crdName = catName } @@ -518,8 +507,8 @@ func TestCavAndCatValidity(t *testing.T) { universalDeserializer.Decode(bytes, nil, &admissionReview) var errorMessage string - if test.operation == admissionv1.Delete && test.crdType == v1alpha1.CAPTenantKind { - errorMessage = fmt.Sprintf("%s provider %s %s cannot be deleted when a consistent %s %s exists. Delete the %s or remove it's provider section instead to delete this tenant", InvalidationMessage, v1alpha1.CAPTenantKind, catName, v1alpha1.CAPApplicationKind, Ca.Name, v1alpha1.CAPApplicationKind) + if test.operation == admissionv1.Delete && test.crdType == v1alpha2.CAPTenantKind { + errorMessage = fmt.Sprintf("%s provider %s %s cannot be deleted when a consistent %s %s exists. Delete the %s or remove it's provider section instead to delete this tenant", InvalidationMessage, v1alpha2.CAPTenantKind, catName, v1alpha2.CAPApplicationKind, Ca.Name, v1alpha2.CAPApplicationKind) if admissionReview.Response.Allowed || admissionReview.Response.UID != uid || admissionReview.APIVersion != apiVersion || @@ -548,17 +537,17 @@ func TestCavAndCatInvalidityNoApp(t *testing.T) { }{ { operation: admissionv1.Create, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, }, { operation: admissionv1.Create, - crdType: v1alpha1.CAPTenantKind, + crdType: v1alpha2.CAPTenantKind, }, } for _, test := range tests { t.Run("Testing "+test.crdType+" invalidity with no CAPApp for operation "+string(test.operation), func(t *testing.T) { crdName := cavName - if test.crdType == v1alpha1.CAPTenantKind { + if test.crdType == v1alpha2.CAPTenantKind { crdName = catName } @@ -575,7 +564,7 @@ func TestCavAndCatInvalidityNoApp(t *testing.T) { if admissionReview.Response.Allowed || admissionReview.Response.UID != uid || admissionReview.APIVersion != apiVersion || - admissionReview.Response.Result.Message != fmt.Sprintf("%s %s no valid %s found for: %s.%s", InvalidationMessage, admissionReview.Kind, v1alpha1.CAPApplicationKind, metav1.NamespaceDefault, crdName) { + admissionReview.Response.Result.Message != fmt.Sprintf("%s %s no valid %s found for: %s.%s", InvalidationMessage, admissionReview.Kind, v1alpha2.CAPApplicationKind, metav1.NamespaceDefault, crdName) { t.Fatal("validation response error") } }) @@ -596,39 +585,39 @@ func TestCavAndCatInvaliditySpecChange(t *testing.T) { }{ { operation: admissionv1.Update, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, changeType: appInstanceUpdate, }, { operation: admissionv1.Update, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, changeType: registrySecretsUpdate, }, { operation: admissionv1.Update, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, changeType: consumedBTPServicesUpdate, }, { operation: admissionv1.Update, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, changeType: versionUpdate, }, { operation: admissionv1.Update, - crdType: v1alpha1.CAPApplicationVersionKind, + crdType: v1alpha2.CAPApplicationVersionKind, changeType: imageUpdate, }, { operation: admissionv1.Update, - crdType: v1alpha1.CAPTenantKind, + crdType: v1alpha2.CAPTenantKind, changeType: appInstanceUpdate, }, } for _, test := range tests { t.Run("Testing "+test.crdType+" invalidity with CAPApp instance change for operation "+string(test.operation), func(t *testing.T) { crdName := cavName - if test.crdType == v1alpha1.CAPTenantKind { + if test.crdType == v1alpha2.CAPTenantKind { crdName = catName } @@ -645,7 +634,7 @@ func TestCavAndCatInvaliditySpecChange(t *testing.T) { universalDeserializer.Decode(bytes, nil, &admissionReview) expectedMessage := fmt.Sprintf("%s %s spec cannot be modified for: %s.%s", InvalidationMessage, admissionReview.Kind, metav1.NamespaceDefault, crdName) - if test.crdType == v1alpha1.CAPTenantKind { + if test.crdType == v1alpha2.CAPTenantKind { expectedMessage = fmt.Sprintf("%s %s capApplicationInstance value cannot be modified for: %s.%s", InvalidationMessage, admissionReview.Kind, metav1.NamespaceDefault, crdName) } @@ -682,7 +671,7 @@ func TestCaValidity(t *testing.T) { } for _, test := range tests { t.Run("Testing CAPApplication validity for operation "+string(test.operation), func(t *testing.T) { - request, recorder := getHttpRequest(test.operation, v1alpha1.CAPApplicationKind, caName, noUpdate, t) + request, recorder := getHttpRequest(test.operation, v1alpha2.CAPApplicationKind, caName, noUpdate, t) wh.Validate(recorder, request) @@ -730,7 +719,7 @@ func TestCaProviderUpdateValidity(t *testing.T) { wh := &WebhookHandler{ CrdClient: fakeCrdClient.NewSimpleClientset(), } - request, recorder := getHttpRequest(admissionv1.Update, v1alpha1.CAPApplicationKind, caName, test.update, t) + request, recorder := getHttpRequest(admissionv1.Update, v1alpha2.CAPApplicationKind, caName, test.update, t) wh.Validate(recorder, request) @@ -747,70 +736,20 @@ func TestCaProviderUpdateValidity(t *testing.T) { t.Fatal("validation response error") } if !test.allowed { - expectedMessage := fmt.Sprintf("%s %s provider details cannot be changed for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationKind, metav1.NamespaceDefault, caName) + expectedMessage := fmt.Sprintf("%s %s provider details cannot be changed for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationKind, metav1.NamespaceDefault, caName) if admissionReview.Response.Result.Message != expectedMessage { - t.Fatal("unexpected error message: ", admissionReview.Response.Result.Message) + t.Fatal("unexpected error message: ", admissionReview.Response.Result.Message, "expected: ", expectedMessage) } } }) } } -func TestCaInvalidity(t *testing.T) { - tests := []struct { - operation admissionv1.Operation - update updateType - }{ - { - operation: admissionv1.Update, - update: domainsUpdate, - }, - { - operation: admissionv1.Create, - update: useDomains, - }, - } - for _, test := range tests { - t.Run("Testing CAPApplication invalidity for operation "+string(test.operation), func(t *testing.T) { - var crdObjects []runtime.Object - - wh := &WebhookHandler{ - CrdClient: fakeCrdClient.NewSimpleClientset(crdObjects...), - } - - request, recorder := getHttpRequest(test.operation, v1alpha1.CAPApplicationKind, caName, test.update, t) - - wh.Validate(recorder, request) - - admissionReview := admissionv1.AdmissionReview{} - bytes, err := io.ReadAll(recorder.Body) - if err != nil { - t.Fatal("io read error") - } - universalDeserializer.Decode(bytes, nil, &admissionReview) - - var errorMessage string - if test.update == domainsUpdate || test.update == useDomains { - errorMessage = fmt.Sprintf("%s %s domains are deprecated. Use domainRefs instead in: %s.%s", InvalidationMessage, admissionReview.Kind, metav1.NamespaceDefault, caName) - } - - if admissionReview.Response.Allowed || - admissionReview.Response.UID != uid || - admissionReview.APIVersion != apiVersion || - admissionReview.Response.Result.Message != errorMessage { - t.Fatal("validation response error") - } - }) - } -} - -func createExistingCa(name string) *v1alpha1.CAPApplication { - return &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: metav1.NamespaceDefault, - }, - Spec: v1alpha1.CAPApplicationSpec{ +func createExistingCa(name string) *v1alpha2.CAPApplication { + return &v1alpha2.CAPApplication{ + Name: name, + Namespace: metav1.NamespaceDefault, + Spec: v1alpha2.CAPApplicationSpec{ ProviderSubaccountId: "providerSubaccountId", BTPAppName: "btpApplicationName", }, @@ -822,7 +761,7 @@ func TestCaAppIdentifierValidity(t *testing.T) { name string operation admissionv1.Operation update updateType - existingCa *v1alpha1.CAPApplication + existingCa *v1alpha2.CAPApplication allowed bool expectedMessage string }{ @@ -831,14 +770,14 @@ func TestCaAppIdentifierValidity(t *testing.T) { operation: admissionv1.Update, update: providerSubaccountIdUpdate, allowed: false, - expectedMessage: fmt.Sprintf("%s %s providerSubaccountId cannot be changed for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationKind, metav1.NamespaceDefault, caName), + expectedMessage: fmt.Sprintf("%s %s providerSubaccountId cannot be changed for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationKind, metav1.NamespaceDefault, caName), }, { name: "changing btpAppName once set is not allowed", operation: admissionv1.Update, update: btpAppNameUpdate, allowed: false, - expectedMessage: fmt.Sprintf("%s %s btpAppName cannot be changed for: %s.%s", InvalidationMessage, v1alpha1.CAPApplicationKind, metav1.NamespaceDefault, caName), + expectedMessage: fmt.Sprintf("%s %s btpAppName cannot be changed for: %s.%s", InvalidationMessage, v1alpha2.CAPApplicationKind, metav1.NamespaceDefault, caName), }, { name: "creating an app with an already existing providerSubaccountId and btpAppName combination is not allowed", @@ -846,7 +785,7 @@ func TestCaAppIdentifierValidity(t *testing.T) { update: duplicateAppIdentifier, existingCa: createExistingCa("otherCa"), allowed: false, - expectedMessage: fmt.Sprintf("%s %s %s already exists in namespace %s with the same providerSubaccountId %s and btpAppName %s", InvalidationMessage, v1alpha1.CAPApplicationKind, "otherCa", metav1.NamespaceDefault, "providerSubaccountId", "btpApplicationName"), + expectedMessage: fmt.Sprintf("%s %s %s already exists in namespace %s with the same providerSubaccountId %s and btpAppName %s", InvalidationMessage, v1alpha2.CAPApplicationKind, "otherCa", metav1.NamespaceDefault, "providerSubaccountId", "btpApplicationName"), }, { name: "creating an app with a unique providerSubaccountId and btpAppName combination is allowed", @@ -873,7 +812,7 @@ func TestCaAppIdentifierValidity(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(crdObjects...), } - request, recorder := getHttpRequest(test.operation, v1alpha1.CAPApplicationKind, caName, test.update, t) + request, recorder := getHttpRequest(test.operation, v1alpha2.CAPApplicationKind, caName, test.update, t) wh.Validate(recorder, request) @@ -1036,28 +975,28 @@ func TestCavInvalidity(t *testing.T) { nameParts := []string{"Testing CAPApplicationVersion invalidity for operation " + string(test.operation) + "; "} testName := strings.Join(append(nameParts, test.backlogItems...), " ") t.Run(testName, func(t *testing.T) { - admissionReview, err := createAdmissionRequest(test.operation, v1alpha1.CAPApplicationVersionKind, caName, noUpdate) + admissionReview, err := createAdmissionRequest(test.operation, v1alpha2.CAPApplicationVersionKind, caName, noUpdate) if err != nil { t.Fatal("admission review error") } - crd := &v1alpha1.CAPApplicationVersion{ + crd := &v1alpha2.CAPApplicationVersion{ TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.CAPApplicationVersionKind, + Kind: v1alpha2.CAPApplicationVersionKind, }, ObjectMeta: metav1.ObjectMeta{ Name: cavName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1065,9 +1004,9 @@ func TestCavInvalidity(t *testing.T) { { Name: "cap-router", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1075,9 +1014,9 @@ func TestCavInvalidity(t *testing.T) { { Name: "content", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1085,9 +1024,9 @@ func TestCavInvalidity(t *testing.T) { { Name: "tenant-op", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1097,12 +1036,12 @@ func TestCavInvalidity(t *testing.T) { } if test.duplicateWorkloadName == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "cap-backend", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentAdditional, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentAdditional, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1113,171 +1052,171 @@ func TestCavInvalidity(t *testing.T) { crd.Spec.Workloads[2].JobDefinition.Type = "invalid" } else if test.onlyOneCAPTypeAllowed == true { // add additional workload of type CAP - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "cap-backend-2", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) } else if test.onlyOneRouterTypeAllowed == true { // add additional workload of type Router - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "cap-router-2", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) } else if test.duplicatePortName == true { - crd.Spec.Workloads[0].DeploymentDefinition.Ports = []v1alpha1.Ports{ + crd.Spec.Workloads[0].DeploymentDefinition.Ports = []v1alpha2.Ports{ {Name: "port-1", RouterDestinationName: "port-1-dest", Port: 4000}, {Name: "port-1", Port: 4004}, } } else if test.duplicatePortNumber == true { - crd.Spec.Workloads[0].DeploymentDefinition.Ports = []v1alpha1.Ports{ + crd.Spec.Workloads[0].DeploymentDefinition.Ports = []v1alpha2.Ports{ {Name: "port-1", RouterDestinationName: "port-1-dest", Port: 4000}, {Name: "port-2", Port: 4000}, } } else if test.routerDestNameCAPChk == true { - crd.Spec.Workloads[0].DeploymentDefinition.Ports = []v1alpha1.Ports{ + crd.Spec.Workloads[0].DeploymentDefinition.Ports = []v1alpha2.Ports{ {Name: "port-1", Port: 4000}, {Name: "port-2", Port: 4004}, } } else if test.routerDestNameRouterChk == true { - crd.Spec.Workloads[1].DeploymentDefinition.Ports = []v1alpha1.Ports{ + crd.Spec.Workloads[1].DeploymentDefinition.Ports = []v1alpha2.Ports{ {Name: "port-1", RouterDestinationName: "port-1-dest", Port: 4000}, {Name: "port-2", Port: 4004}, } } else if test.customTenantOpWithoutSequence == true { // add workload of type custom tenant operation - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "custom-tenant-operation", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobCustomTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobCustomTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) } else if test.tenantOperationSequenceInvalid == true { // add workload of type custom tenant operation - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "custom-tenant-operation", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobCustomTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobCustomTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) - crd.Spec.TenantOperations = &v1alpha1.TenantOperations{ - Provisioning: []v1alpha1.TenantOperationWorkloadReference{ + crd.Spec.TenantOperations = &v1alpha2.TenantOperations{ + Provisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "custom-tenant-operation"}, }, - Deprovisioning: []v1alpha1.TenantOperationWorkloadReference{ + Deprovisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "custom-tenant-operation"}, }, - Upgrade: []v1alpha1.TenantOperationWorkloadReference{ + Upgrade: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "custom-tenant-operation"}, }, } } else if test.invalidWorkloadInTenantOpSeq == true { - crd.Spec.TenantOperations = &v1alpha1.TenantOperations{ - Provisioning: []v1alpha1.TenantOperationWorkloadReference{ + crd.Spec.TenantOperations = &v1alpha2.TenantOperations{ + Provisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, - Deprovisioning: []v1alpha1.TenantOperationWorkloadReference{ + Deprovisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, }, - Upgrade: []v1alpha1.TenantOperationWorkloadReference{ + Upgrade: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, } } else if test.missingTenantOpInSeqProvisioning == true || test.missingTenantOpInSeqUpgrade == true || test.missingTenantOpInSeqDeprovisioning == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "custom-tenant-operation", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobCustomTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobCustomTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) if test.missingTenantOpInSeqProvisioning == true { - crd.Spec.TenantOperations = &v1alpha1.TenantOperations{ - Provisioning: []v1alpha1.TenantOperationWorkloadReference{ + crd.Spec.TenantOperations = &v1alpha2.TenantOperations{ + Provisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "custom-tenant-operation"}, }, - Deprovisioning: []v1alpha1.TenantOperationWorkloadReference{ + Deprovisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, - Upgrade: []v1alpha1.TenantOperationWorkloadReference{ + Upgrade: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, } } else if test.missingTenantOpInSeqUpgrade == true { - crd.Spec.TenantOperations = &v1alpha1.TenantOperations{ - Provisioning: []v1alpha1.TenantOperationWorkloadReference{ + crd.Spec.TenantOperations = &v1alpha2.TenantOperations{ + Provisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, - Deprovisioning: []v1alpha1.TenantOperationWorkloadReference{ + Deprovisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, - Upgrade: []v1alpha1.TenantOperationWorkloadReference{ + Upgrade: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "custom-tenant-operation"}, }, } } else if test.missingTenantOpInSeqDeprovisioning == true { - crd.Spec.TenantOperations = &v1alpha1.TenantOperations{ - Provisioning: []v1alpha1.TenantOperationWorkloadReference{ + crd.Spec.TenantOperations = &v1alpha2.TenantOperations{ + Provisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, - Deprovisioning: []v1alpha1.TenantOperationWorkloadReference{ + Deprovisioning: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "custom-tenant-operation"}, }, - Upgrade: []v1alpha1.TenantOperationWorkloadReference{ + Upgrade: []v1alpha2.TenantOperationWorkloadReference{ {WorkloadName: "tenant-op"}, {WorkloadName: "custom-tenant-operation"}, }, } } } else if test.multipleContentJobsWithNoOrder == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "content-2", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) } else if test.missingContentJobinContentJobs == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "content-2", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) crd.Spec.ContentJobs = append(crd.Spec.ContentJobs, "content") } else if test.invalidJobinContentJobs == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "content-2", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1311,48 +1250,48 @@ func TestCavInvalidity(t *testing.T) { var errorMessage string if test.duplicateWorkloadName == true { - errorMessage = fmt.Sprintf("%s %s duplicate workload name: cap-backend", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s duplicate workload name: cap-backend", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.invalidDeploymentType == true { - errorMessage = fmt.Sprintf("%s %s invalid deployment definition type. Only supported - CAP, Router, Additional and Service", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s invalid deployment definition type. Only supported - CAP, Router, Additional and Service", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.invalidJobType == true { - errorMessage = fmt.Sprintf("%s %s invalid job definition type. Only supported - Content, TenantOperation and CustomTenantOperation", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s invalid job definition type. Only supported - Content, TenantOperation and CustomTenantOperation", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.onlyOneCAPTypeAllowed == true { - errorMessage = fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.DeploymentCAP, 2, v1alpha1.DeploymentCAP) + errorMessage = fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.DeploymentCAP, 2, v1alpha2.DeploymentCAP) } else if test.onlyOneRouterTypeAllowed == true { - errorMessage = fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.DeploymentRouter, 2, v1alpha1.DeploymentRouter) + errorMessage = fmt.Sprintf(DeploymentWorkloadCountErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.DeploymentRouter, 2, v1alpha2.DeploymentRouter) } else if test.duplicatePortName == true { - errorMessage = fmt.Sprintf("%s %s duplicate port name: port-1 in workload - cap-backend", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s duplicate port name: port-1 in workload - cap-backend", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.duplicatePortNumber == true { - errorMessage = fmt.Sprintf("%s %s duplicate port number: 4000 in workload - cap-backend", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s duplicate port number: 4000 in workload - cap-backend", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.routerDestNameCAPChk == true { - errorMessage = fmt.Sprintf("%s %s routerDestinationName not defined in port configuration of workload - cap-backend", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s routerDestinationName not defined in port configuration of workload - cap-backend", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.routerDestNameRouterChk == true { - errorMessage = fmt.Sprintf("%s %s routerDestinationName should not be defined for workload of type Router - cap-router", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s routerDestinationName should not be defined for workload of type Router - cap-router", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.customTenantOpWithoutSequence == true { - errorMessage = fmt.Sprintf("%s %s - If a jobDefinition of type CustomTenantOperation is part of the workloads, then spec.tenantOperations must be specified", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s - If a jobDefinition of type CustomTenantOperation is part of the workloads, then spec.tenantOperations must be specified", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.tenantOperationSequenceInvalid == true { - errorMessage = fmt.Sprintf("%s %s workload tenant operation tenant-op is not specified in spec.tenantOperations", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s workload tenant operation tenant-op is not specified in spec.tenantOperations", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.invalidWorkloadInTenantOpSeq == true { - errorMessage = fmt.Sprintf("%s %s custom-tenant-operation specified in spec.tenantOperations is not a valid workload of type TenantOperation or CustomTenantOperation", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s custom-tenant-operation specified in spec.tenantOperations is not a valid workload of type TenantOperation or CustomTenantOperation", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.missingTenantOpInSeqProvisioning == true { - errorMessage = fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.provisioning", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.provisioning", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.missingTenantOpInSeqUpgrade == true { - errorMessage = fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.upgrade", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.upgrade", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.missingTenantOpInSeqDeprovisioning == true { - errorMessage = fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.deprovisioning", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s - No tenant operation specified in spec.tenantOperation.deprovisioning", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.multipleContentJobsWithNoOrder == true { - errorMessage = fmt.Sprintf("%s %s if there are more than one content job, contentJobs should be defined", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s if there are more than one content job, contentJobs should be defined", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.missingContentJobinContentJobs == true { - errorMessage = fmt.Sprintf("%s %s content job content-2 is not specified as part of ContentJobs", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s content job content-2 is not specified as part of ContentJobs", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.invalidJobinContentJobs == true { - errorMessage = fmt.Sprintf("%s %s job dummy specified as part of ContentJobs is not a valid content job", InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + errorMessage = fmt.Sprintf("%s %s job dummy specified as part of ContentJobs is not a valid content job", InvalidationMessage, v1alpha2.CAPApplicationVersionKind) } else if test.invalidWorkloadName == true { - errorMessage = fmt.Sprintf("%s %s Invalid workload name: %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, "WrongWorkloadName") + errorMessage = fmt.Sprintf("%s %s Invalid workload name: %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, "WrongWorkloadName") } else if test.longDeploymentWorkloadName == true { errorMessage = fmt.Sprintf( "%s %s Derived service name '%s' (length %d) exceeds max limit of %d characters. Please shorten CAPApplicationVersion name '%s' or workload name '%s'.", InvalidationMessage, - v1alpha1.CAPApplicationVersionKind, + v1alpha2.CAPApplicationVersionKind, crd.Name+"-"+"extralongworkloadnamecontainingmorethan64characters"+"-svc", len(crd.Name+"-"+"extralongworkloadnamecontainingmorethan64characters"+"-svc"), 63, @@ -1363,7 +1302,7 @@ func TestCavInvalidity(t *testing.T) { errorMessage = fmt.Sprintf( "%s %s Derived content job pod name '%s' (length %d) exceeds max limit of %d characters. Please shorten CAPApplicationVersion name '%s' or workload name '%s'.", InvalidationMessage, - v1alpha1.CAPApplicationVersionKind, + v1alpha2.CAPApplicationVersionKind, crd.Name+"-"+"extralongcontentworkloadnamecontainingmorethan64characters"+"-q4m9c", len(crd.Name+"-"+"extralongcontentworkloadnamecontainingmorethan64characters"+"-q4m9c"), 63, @@ -1417,28 +1356,28 @@ func TestCavInvalidityServiceScenario(t *testing.T) { nameParts := []string{"Testing CAPApplicationVersion invalidity for operation " + string(test.operation) + "; "} testName := strings.Join(append(nameParts, test.backlogItems...), " ") t.Run(testName, func(t *testing.T) { - admissionReview, err := createAdmissionRequest(test.operation, v1alpha1.CAPApplicationVersionKind, caName, noUpdate) + admissionReview, err := createAdmissionRequest(test.operation, v1alpha2.CAPApplicationVersionKind, caName, noUpdate) if err != nil { t.Fatal("admission review error") } - crd := &v1alpha1.CAPApplicationVersion{ + crd := &v1alpha2.CAPApplicationVersion{ TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.CAPApplicationVersionKind, + Kind: v1alpha2.CAPApplicationVersionKind, }, ObjectMeta: metav1.ObjectMeta{ Name: cavName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1446,9 +1385,9 @@ func TestCavInvalidityServiceScenario(t *testing.T) { { Name: "cap-router", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1456,9 +1395,9 @@ func TestCavInvalidityServiceScenario(t *testing.T) { { Name: "content", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1470,46 +1409,46 @@ func TestCavInvalidityServiceScenario(t *testing.T) { if test.onlyServiceWorkloads == true { for _, workload := range crd.Spec.Workloads { if workload.DeploymentDefinition != nil { - workload.DeploymentDefinition.Type = v1alpha1.DeploymentService + workload.DeploymentDefinition.Type = v1alpha2.DeploymentService } } - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "tenant-operation", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "custom-tenant-operation", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobCustomTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobCustomTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) } else if test.serviceExposureWrongWorkloadName == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "service-1", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentService, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentService, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) - crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha1.ServiceExposure{ + crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha2.ServiceExposure{ SubDomain: "svc-subdomain", - Routes: []v1alpha1.Route{ + Routes: []v1alpha2.Route{ { WorkloadName: "wrong-name", Port: 4004, @@ -1518,15 +1457,15 @@ func TestCavInvalidityServiceScenario(t *testing.T) { }, }) } else if test.duplicateSubDomainInServiceExposure == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "service-1", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentService, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentService, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, - Ports: []v1alpha1.Ports{ + Ports: []v1alpha2.Ports{ { Name: "port-1", Port: 4004, @@ -1535,9 +1474,9 @@ func TestCavInvalidityServiceScenario(t *testing.T) { }, }) - crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha1.ServiceExposure{ + crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha2.ServiceExposure{ SubDomain: "svc-subdomain", - Routes: []v1alpha1.Route{ + Routes: []v1alpha2.Route{ { WorkloadName: "service-1", Port: 4004, @@ -1546,9 +1485,9 @@ func TestCavInvalidityServiceScenario(t *testing.T) { }, }) - crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha1.ServiceExposure{ + crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha2.ServiceExposure{ SubDomain: "svc-subdomain", - Routes: []v1alpha1.Route{ + Routes: []v1alpha2.Route{ { WorkloadName: "service-1", Port: 4004, @@ -1556,20 +1495,20 @@ func TestCavInvalidityServiceScenario(t *testing.T) { }, }) } else if test.portMissingInServiceExposure == true { - crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha1.WorkloadDetails{ + crd.Spec.Workloads = append(crd.Spec.Workloads, v1alpha2.WorkloadDetails{ Name: "service-1", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentService, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentService, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, }) - crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha1.ServiceExposure{ + crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha2.ServiceExposure{ SubDomain: "svc-subdomain", - Routes: []v1alpha1.Route{ + Routes: []v1alpha2.Route{ { WorkloadName: "service-1", Port: 4004, @@ -1578,9 +1517,9 @@ func TestCavInvalidityServiceScenario(t *testing.T) { }, }) - crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha1.ServiceExposure{ + crd.Spec.ServiceExposures = append(crd.Spec.ServiceExposures, v1alpha2.ServiceExposure{ SubDomain: "svc-subdomain", - Routes: []v1alpha1.Route{ + Routes: []v1alpha2.Route{ { WorkloadName: "service-1", Port: 4004, @@ -1609,13 +1548,13 @@ func TestCavInvalidityServiceScenario(t *testing.T) { var errorMessage string if test.onlyServiceWorkloads == true { - errorMessage = fmt.Sprintf(TenantOpJobWorkloadCountErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, v1alpha1.JobTenantOperation, v1alpha1.JobCustomTenantOperation) + errorMessage = fmt.Sprintf(TenantOpJobWorkloadCountErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, v1alpha2.JobTenantOperation, v1alpha2.JobCustomTenantOperation) } else if test.serviceExposureWrongWorkloadName == true { - errorMessage = fmt.Sprintf(ServiceExposureWorkloadNameErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, crd.Spec.ServiceExposures[0].Routes[0].WorkloadName, crd.Spec.ServiceExposures[0].SubDomain) + errorMessage = fmt.Sprintf(ServiceExposureWorkloadNameErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, crd.Spec.ServiceExposures[0].Routes[0].WorkloadName, crd.Spec.ServiceExposures[0].SubDomain) } else if test.duplicateSubDomainInServiceExposure == true { - errorMessage = fmt.Sprintf(DuplicateServiceExposureSubDomainErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, crd.Spec.ServiceExposures[0].SubDomain) + errorMessage = fmt.Sprintf(DuplicateServiceExposureSubDomainErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, crd.Spec.ServiceExposures[0].SubDomain) } else if test.portMissingInServiceExposure == true { - errorMessage = fmt.Sprintf(ServiceExposurePortErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind, crd.Spec.ServiceExposures[0].Routes[0].Port, crd.Spec.ServiceExposures[0].Routes[0].WorkloadName, crd.Spec.ServiceExposures[0].SubDomain) + errorMessage = fmt.Sprintf(ServiceExposurePortErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind, crd.Spec.ServiceExposures[0].Routes[0].Port, crd.Spec.ServiceExposures[0].Routes[0].WorkloadName, crd.Spec.ServiceExposures[0].SubDomain) } if admissionReviewRes.Response.Allowed || admissionReviewRes.Response.Result.Message != errorMessage { @@ -1649,30 +1588,30 @@ func TestCavPDBScenario(t *testing.T) { for _, test := range tests { testName := "Testing CAPApplicationVersion for " + test.name t.Run(testName, func(t *testing.T) { - admissionReview, err := createAdmissionRequest(test.operation, v1alpha1.CAPApplicationVersionKind, caName, noUpdate) + admissionReview, err := createAdmissionRequest(test.operation, v1alpha2.CAPApplicationVersionKind, caName, noUpdate) if err != nil { t.Fatal("admission review error") } minAvailable := intstr.FromInt(1) - crd := &v1alpha1.CAPApplicationVersion{ + crd := &v1alpha2.CAPApplicationVersion{ TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.CAPApplicationVersionKind, + Kind: v1alpha2.CAPApplicationVersionKind, }, ObjectMeta: metav1.ObjectMeta{ Name: cavName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, PodDisruptionBudget: &policyv1.PodDisruptionBudgetSpec{ @@ -1683,9 +1622,9 @@ func TestCavPDBScenario(t *testing.T) { { Name: "cap-router", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, PodDisruptionBudget: &policyv1.PodDisruptionBudgetSpec{ @@ -1696,9 +1635,9 @@ func TestCavPDBScenario(t *testing.T) { { Name: "content", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1706,9 +1645,9 @@ func TestCavPDBScenario(t *testing.T) { { Name: "tenant-op", ConsumedBTPServices: []string{}, - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobTenantOperation, - CommonDetails: v1alpha1.CommonDetails{ + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobTenantOperation, + CommonDetails: v1alpha2.CommonDetails{ Image: "foo", }, }, @@ -1745,7 +1684,7 @@ func TestCavPDBScenario(t *testing.T) { var errorMessage string if test.pdbWithSelectors == true { - errorMessage = fmt.Sprintf("%s %s selector must not be specified for podDisrptionBudget config in workload - %s", InvalidationMessage, v1alpha1.CAPApplicationVersionKind, crd.Spec.Workloads[0].Name) + errorMessage = fmt.Sprintf("%s %s selector must not be specified for podDisrptionBudget config in workload - %s", InvalidationMessage, v1alpha2.CAPApplicationVersionKind, crd.Spec.Workloads[0].Name) if admissionReviewRes.Response.Allowed || admissionReviewRes.Response.Result.Message != errorMessage { t.Fatal("validation response error") @@ -1789,16 +1728,16 @@ func TestCtoutInvalidity(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(crdObjects...), } - ctout := &v1alpha1.CAPTenantOutput{ + ctout := &v1alpha2.CAPTenantOutput{ TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.CAPTenantOutputKind, + Kind: v1alpha2.CAPTenantOutputKind, }, ObjectMeta: metav1.ObjectMeta{ Name: "some-ctout", Namespace: metav1.NamespaceDefault, Labels: map[string]string{}, }, - Spec: v1alpha1.CAPTenantOutputSpec{ + Spec: v1alpha2.CAPTenantOutputSpec{ SubscriptionCallbackData: `{"supportUsers":[{"name":"user_t1", "email":"usert1@foo.com"},{"name":"user_t2", "email":"usert2@foo.com"}]}`, }, } @@ -1807,7 +1746,7 @@ func TestCtoutInvalidity(t *testing.T) { ctout.Labels[LabelTenantId] = "some-tenant-id" } - admissionReview, err := createAdmissionRequest(test.operation, v1alpha1.CAPTenantOutputKind, ctout.Name, noUpdate) + admissionReview, err := createAdmissionRequest(test.operation, v1alpha2.CAPTenantOutputKind, ctout.Name, noUpdate) if err != nil { t.Fatal("admission review error") } @@ -1831,11 +1770,11 @@ func TestCtoutInvalidity(t *testing.T) { universalDeserializer.Decode(bytes, nil, &admissionReviewRes) if test.labelPresent { - if admissionReviewRes.Response.Allowed || admissionReviewRes.Response.Result.Message != fmt.Sprintf("%s %s label %s on CAP tenant output %s does not contain a valid tenant ID", InvalidationMessage, v1alpha1.CAPTenantOutputKind, LabelTenantId, "some-ctout") { + if admissionReviewRes.Response.Allowed || admissionReviewRes.Response.Result.Message != fmt.Sprintf("%s %s label %s on CAP tenant output %s does not contain a valid tenant ID", InvalidationMessage, v1alpha2.CAPTenantOutputKind, LabelTenantId, "some-ctout") { t.Fatal("validation response error") } } else { - if admissionReviewRes.Response.Allowed || admissionReviewRes.Response.Result.Message != fmt.Sprintf("%s %s label %s missing on CAP tenant output %s", InvalidationMessage, v1alpha1.CAPTenantOutputKind, LabelTenantId, "some-ctout") { + if admissionReviewRes.Response.Allowed || admissionReviewRes.Response.Result.Message != fmt.Sprintf("%s %s label %s missing on CAP tenant output %s", InvalidationMessage, v1alpha2.CAPTenantOutputKind, LabelTenantId, "some-ctout") { t.Fatal("validation response error") } } @@ -1867,11 +1806,11 @@ func TestClusterDomainInvalidity(t *testing.T) { } for _, test := range tests { t.Run("Testing ClusterDomain invalidity during "+string(test.operation), func(t *testing.T) { - clusterDomain := &v1alpha1.ClusterDomain{ + clusterDomain := &v1alpha2.ClusterDomain{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster-domain", }, - Spec: v1alpha1.DomainSpec{ + Spec: v1alpha2.DomainSpec{ Domain: "foo-cluster-domain.com", IngressSelector: map[string]string{ "app": "istio-ingressgateway", @@ -1879,12 +1818,12 @@ func TestClusterDomainInvalidity(t *testing.T) { }, }, } - domain := &v1alpha1.Domain{ + domain := &v1alpha2.Domain{ ObjectMeta: metav1.ObjectMeta{ Name: "domain", Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.DomainSpec{ + Spec: v1alpha2.DomainSpec{ Domain: "foo-domain.com", IngressSelector: map[string]string{ "app": "istio-ingressgateway", @@ -1897,7 +1836,7 @@ func TestClusterDomainInvalidity(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(clusterDomain, domain), } - admissionReview, err := createAdmissionRequest(test.operation, v1alpha1.ClusterDomainKind, clusterDomain.Name, noUpdate) + admissionReview, err := createAdmissionRequest(test.operation, v1alpha2.ClusterDomainKind, clusterDomain.Name, noUpdate) if err != nil { t.Fatal("admission review error") } @@ -1930,9 +1869,9 @@ func TestClusterDomainInvalidity(t *testing.T) { var errorMessage string if test.duplicateClusterDomain { - errorMessage = fmt.Sprintf("%s %s %s already exist with domain %s", InvalidationMessage, v1alpha1.ClusterDomainKind, clusterDomain.Name, clusterDomain.Spec.Domain) + errorMessage = fmt.Sprintf("%s %s %s already exist with domain %s", InvalidationMessage, v1alpha2.ClusterDomainKind, clusterDomain.Name, clusterDomain.Spec.Domain) } else if test.duplicateDomain { - errorMessage = fmt.Sprintf("%s %s %s already exist in namespace %s with domain %s", InvalidationMessage, v1alpha1.DomainKind, domain.Name, domain.Namespace, domain.Spec.Domain) + errorMessage = fmt.Sprintf("%s %s %s already exist in namespace %s with domain %s", InvalidationMessage, v1alpha2.DomainKind, domain.Name, domain.Namespace, domain.Spec.Domain) } if test.duplicateClusterDomain || test.duplicateDomain { @@ -1968,11 +1907,11 @@ func TestDomainInvalidity(t *testing.T) { } for _, test := range tests { t.Run("Testing Domain invalidity during "+string(test.operation), func(t *testing.T) { - clusterDomain := &v1alpha1.ClusterDomain{ + clusterDomain := &v1alpha2.ClusterDomain{ ObjectMeta: metav1.ObjectMeta{ Name: "cluster-domain", }, - Spec: v1alpha1.DomainSpec{ + Spec: v1alpha2.DomainSpec{ Domain: "foo-cluster-domain.com", IngressSelector: map[string]string{ "app": "istio-ingressgateway", @@ -1980,12 +1919,12 @@ func TestDomainInvalidity(t *testing.T) { }, }, } - domain := &v1alpha1.Domain{ + domain := &v1alpha2.Domain{ ObjectMeta: metav1.ObjectMeta{ Name: "domain", Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.DomainSpec{ + Spec: v1alpha2.DomainSpec{ Domain: "foo-domain.com", IngressSelector: map[string]string{ "app": "istio-ingressgateway", @@ -1998,7 +1937,7 @@ func TestDomainInvalidity(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(clusterDomain, domain), } - admissionReview, err := createAdmissionRequest(test.operation, v1alpha1.DomainKind, domain.Name, noUpdate) + admissionReview, err := createAdmissionRequest(test.operation, v1alpha2.DomainKind, domain.Name, noUpdate) if err != nil { t.Fatal("admission review error") } @@ -2031,9 +1970,9 @@ func TestDomainInvalidity(t *testing.T) { var errorMessage string if test.duplicateClusterDomain { - errorMessage = fmt.Sprintf("%s %s %s already exist with domain %s", InvalidationMessage, v1alpha1.ClusterDomainKind, clusterDomain.Name, clusterDomain.Spec.Domain) + errorMessage = fmt.Sprintf("%s %s %s already exist with domain %s", InvalidationMessage, v1alpha2.ClusterDomainKind, clusterDomain.Name, clusterDomain.Spec.Domain) } else if test.duplicateDomain { - errorMessage = fmt.Sprintf("%s %s %s already exist in namespace %s with domain %s", InvalidationMessage, v1alpha1.DomainKind, domain.Name, domain.Namespace, domain.Spec.Domain) + errorMessage = fmt.Sprintf("%s %s %s already exist in namespace %s with domain %s", InvalidationMessage, v1alpha2.DomainKind, domain.Name, domain.Namespace, domain.Spec.Domain) } if test.duplicateClusterDomain || test.duplicateDomain { @@ -2070,7 +2009,7 @@ func TestProviderTenantDeletionWithCAProvider(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(Ca), } - request, recorder := getHttpRequest(admissionv1.Delete, v1alpha1.CAPTenantKind, catName, noUpdate, t) + request, recorder := getHttpRequest(admissionv1.Delete, v1alpha2.CAPTenantKind, catName, noUpdate, t) wh.Validate(recorder, request) admissionReview := admissionv1.AdmissionReview{} @@ -2086,7 +2025,7 @@ func TestProviderTenantDeletionWithCAProvider(t *testing.T) { } } else { expectedMessage := fmt.Sprintf("%s provider %s %s cannot be deleted when a consistent %s %s exists. Delete the %s or remove it's provider section instead to delete this tenant", - InvalidationMessage, v1alpha1.CAPTenantKind, catName, v1alpha1.CAPApplicationKind, Ca.Name, v1alpha1.CAPApplicationKind) + InvalidationMessage, v1alpha2.CAPTenantKind, catName, v1alpha2.CAPApplicationKind, Ca.Name, v1alpha2.CAPApplicationKind) if admissionReview.Response.Allowed || admissionReview.Response.UID != uid || admissionReview.Response.Result.Message != expectedMessage { t.Fatalf("expected deletion to be denied with message %q but got allowed=%v message=%q", expectedMessage, admissionReview.Response.Allowed, admissionReview.Response.Result.Message) @@ -2104,34 +2043,34 @@ func TestCavMissingTenantOperation(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(Ca), } - admissionReview, err := createAdmissionRequest(admissionv1.Create, v1alpha1.CAPApplicationVersionKind, caName, noUpdate) + admissionReview, err := createAdmissionRequest(admissionv1.Create, v1alpha2.CAPApplicationVersionKind, caName, noUpdate) if err != nil { t.Fatal("admission review error") } - crd := &v1alpha1.CAPApplicationVersion{ + crd := &v1alpha2.CAPApplicationVersion{ TypeMeta: metav1.TypeMeta{ - Kind: v1alpha1.CAPApplicationVersionKind, + Kind: v1alpha2.CAPApplicationVersionKind, }, ObjectMeta: metav1.ObjectMeta{ Name: cavName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend", - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{Image: "foo"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{Image: "foo"}, }, }, { Name: "cap-router", - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{Image: "foo"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{Image: "foo"}, }, }, // no TenantOperation job workload defined @@ -2151,7 +2090,7 @@ func TestCavMissingTenantOperation(t *testing.T) { bodyBytes, _ := io.ReadAll(recorder.Body) universalDeserializer.Decode(bodyBytes, nil, &resp) - expected := fmt.Sprintf(TenantOpMissingErr, InvalidationMessage, v1alpha1.CAPApplicationVersionKind) + expected := fmt.Sprintf(TenantOpMissingErr, InvalidationMessage, v1alpha2.CAPApplicationVersionKind) if resp.Response.Allowed || resp.Response.Result.Message != expected { t.Fatalf("expected denied with %q, got allowed=%v message=%q", expected, resp.Response.Allowed, resp.Response.Result.Message) } @@ -2163,13 +2102,13 @@ func TestCtoutDeleteAllowed(t *testing.T) { CrdClient: fakeCrdClient.NewSimpleClientset(), } - admissionReview, err := createAdmissionRequest(admissionv1.Delete, v1alpha1.CAPTenantOutputKind, "some-ctout", noUpdate) + admissionReview, err := createAdmissionRequest(admissionv1.Delete, v1alpha2.CAPTenantOutputKind, "some-ctout", noUpdate) if err != nil { t.Fatal("admission review error") } // For Delete, OldObject is set by createAdmissionRequest's switch only for known kinds; build payload manually - ctout := &v1alpha1.CAPTenantOutput{ - TypeMeta: metav1.TypeMeta{Kind: v1alpha1.CAPTenantOutputKind}, + ctout := &v1alpha2.CAPTenantOutput{ + TypeMeta: metav1.TypeMeta{Kind: v1alpha2.CAPTenantOutputKind}, ObjectMeta: metav1.ObjectMeta{Name: "some-ctout", Namespace: metav1.NamespaceDefault}, } rawBytes, _ := json.Marshal(ctout) @@ -2224,23 +2163,23 @@ func TestIsServicesOnlyWithNilStatus(t *testing.T) { tests := []struct { name string hasProvider bool - workloads []v1alpha1.WorkloadDetails + workloads []v1alpha2.WorkloadDetails expectedSvcs bool }{ { name: "no provider, no tenant-op job -> services only", hasProvider: false, - workloads: []v1alpha1.WorkloadDetails{ + workloads: []v1alpha2.WorkloadDetails{ { Name: "svc", - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentService, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentService, }, }, { Name: "content", - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, }, }, }, @@ -2249,11 +2188,11 @@ func TestIsServicesOnlyWithNilStatus(t *testing.T) { { name: "has tenant-op job -> not services only", hasProvider: false, - workloads: []v1alpha1.WorkloadDetails{ + workloads: []v1alpha2.WorkloadDetails{ { Name: "tenant-op", - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobTenantOperation, + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobTenantOperation, }, }, }, @@ -2262,11 +2201,11 @@ func TestIsServicesOnlyWithNilStatus(t *testing.T) { { name: "has provider -> not services only", hasProvider: true, - workloads: []v1alpha1.WorkloadDetails{ + workloads: []v1alpha2.WorkloadDetails{ { Name: "content", - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobContent, + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobContent, }, }, }, @@ -2276,15 +2215,15 @@ func TestIsServicesOnlyWithNilStatus(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - ca := &v1alpha1.CAPApplication{ - Spec: v1alpha1.CAPApplicationSpec{}, + ca := &v1alpha2.CAPApplication{ + Spec: v1alpha2.CAPApplicationSpec{}, // Status.ServicesOnly explicitly nil } if test.hasProvider { - ca.Spec.Provider = &v1alpha1.BTPTenantIdentification{SubDomain: subDomain, TenantId: tenantId} + ca.Spec.Provider = &v1alpha2.BTPTenantIdentification{SubDomain: subDomain, TenantId: tenantId} } - cav := &v1alpha1.CAPApplicationVersion{ - Spec: v1alpha1.CAPApplicationVersionSpec{Workloads: test.workloads}, + cav := &v1alpha2.CAPApplicationVersion{ + Spec: v1alpha2.CAPApplicationVersionSpec{Workloads: test.workloads}, } if got := IsServicesOnly(ca, cav); got != test.expectedSvcs { t.Fatalf("IsServicesOnly: expected %v, got %v", test.expectedSvcs, got) @@ -2310,15 +2249,15 @@ func TestValidateMalformedObject(t *testing.T) { operation admissionv1.Operation objField string // "object" or "oldObject" }{ - {name: "CAPApplication create malformed", kind: v1alpha1.CAPApplicationKind, operation: admissionv1.Create, objField: "object"}, - {name: "CAPApplication update malformed old", kind: v1alpha1.CAPApplicationKind, operation: admissionv1.Update, objField: "oldObject"}, - {name: "CAPApplicationVersion create malformed", kind: v1alpha1.CAPApplicationVersionKind, operation: admissionv1.Create, objField: "object"}, - {name: "CAPApplicationVersion update malformed old", kind: v1alpha1.CAPApplicationVersionKind, operation: admissionv1.Update, objField: "oldObject"}, - {name: "CAPTenant create malformed", kind: v1alpha1.CAPTenantKind, operation: admissionv1.Create, objField: "object"}, - {name: "CAPTenant update malformed old", kind: v1alpha1.CAPTenantKind, operation: admissionv1.Update, objField: "oldObject"}, - {name: "CAPTenantOutput create malformed", kind: v1alpha1.CAPTenantOutputKind, operation: admissionv1.Create, objField: "object"}, - {name: "ClusterDomain create malformed", kind: v1alpha1.ClusterDomainKind, operation: admissionv1.Create, objField: "object"}, - {name: "Domain create malformed", kind: v1alpha1.DomainKind, operation: admissionv1.Create, objField: "object"}, + {name: "CAPApplication create malformed", kind: v1alpha2.CAPApplicationKind, operation: admissionv1.Create, objField: "object"}, + {name: "CAPApplication update malformed old", kind: v1alpha2.CAPApplicationKind, operation: admissionv1.Update, objField: "oldObject"}, + {name: "CAPApplicationVersion create malformed", kind: v1alpha2.CAPApplicationVersionKind, operation: admissionv1.Create, objField: "object"}, + {name: "CAPApplicationVersion update malformed old", kind: v1alpha2.CAPApplicationVersionKind, operation: admissionv1.Update, objField: "oldObject"}, + {name: "CAPTenant create malformed", kind: v1alpha2.CAPTenantKind, operation: admissionv1.Create, objField: "object"}, + {name: "CAPTenant update malformed old", kind: v1alpha2.CAPTenantKind, operation: admissionv1.Update, objField: "oldObject"}, + {name: "CAPTenantOutput create malformed", kind: v1alpha2.CAPTenantOutputKind, operation: admissionv1.Create, objField: "object"}, + {name: "ClusterDomain create malformed", kind: v1alpha2.ClusterDomainKind, operation: admissionv1.Create, objField: "object"}, + {name: "Domain create malformed", kind: v1alpha2.DomainKind, operation: admissionv1.Create, objField: "object"}, } for _, test := range tests { @@ -2365,49 +2304,49 @@ func TestValidateTenantOperationsWithExplicitSpecTenantOperations(t *testing.T) CrdClient: fakeCrdClient.NewSimpleClientset(Ca), } - cav := &v1alpha1.CAPApplicationVersion{ - TypeMeta: metav1.TypeMeta{Kind: v1alpha1.CAPApplicationVersionKind}, + cav := &v1alpha2.CAPApplicationVersion{ + TypeMeta: metav1.TypeMeta{Kind: v1alpha2.CAPApplicationVersionKind}, ObjectMeta: metav1.ObjectMeta{ Name: cavName, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend", - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{Image: "foo"}, - Ports: []v1alpha1.Ports{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{Image: "foo"}, + Ports: []v1alpha2.Ports{ {Name: "p1", RouterDestinationName: "p1-dest", Port: 4004}, }, }, }, { Name: "cap-router", - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentRouter, - CommonDetails: v1alpha1.CommonDetails{Image: "foo"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentRouter, + CommonDetails: v1alpha2.CommonDetails{Image: "foo"}, }, }, { Name: "tenant-op", - JobDefinition: &v1alpha1.JobDetails{ - Type: v1alpha1.JobTenantOperation, - CommonDetails: v1alpha1.CommonDetails{Image: "foo"}, + JobDefinition: &v1alpha2.JobDetails{ + Type: v1alpha2.JobTenantOperation, + CommonDetails: v1alpha2.CommonDetails{Image: "foo"}, }, }, }, - TenantOperations: &v1alpha1.TenantOperations{ - Provisioning: []v1alpha1.TenantOperationWorkloadReference{{WorkloadName: "tenant-op"}}, - Deprovisioning: []v1alpha1.TenantOperationWorkloadReference{{WorkloadName: "tenant-op"}}, - Upgrade: []v1alpha1.TenantOperationWorkloadReference{{WorkloadName: "tenant-op"}}, + TenantOperations: &v1alpha2.TenantOperations{ + Provisioning: []v1alpha2.TenantOperationWorkloadReference{{WorkloadName: "tenant-op"}}, + Deprovisioning: []v1alpha2.TenantOperationWorkloadReference{{WorkloadName: "tenant-op"}}, + Upgrade: []v1alpha2.TenantOperationWorkloadReference{{WorkloadName: "tenant-op"}}, }, }, } - admissionReview, err := createAdmissionRequest(admissionv1.Create, v1alpha1.CAPApplicationVersionKind, caName, noUpdate) + admissionReview, err := createAdmissionRequest(admissionv1.Create, v1alpha2.CAPApplicationVersionKind, caName, noUpdate) if err != nil { t.Fatal("admission review error") } @@ -2439,10 +2378,10 @@ func TestClusterDomainAndDomainNonCreateUpdateOps(t *testing.T) { kind string operation admissionv1.Operation }{ - {kind: v1alpha1.ClusterDomainKind, operation: admissionv1.Delete}, - {kind: v1alpha1.ClusterDomainKind, operation: admissionv1.Connect}, - {kind: v1alpha1.DomainKind, operation: admissionv1.Delete}, - {kind: v1alpha1.DomainKind, operation: admissionv1.Connect}, + {kind: v1alpha2.ClusterDomainKind, operation: admissionv1.Delete}, + {kind: v1alpha2.ClusterDomainKind, operation: admissionv1.Connect}, + {kind: v1alpha2.DomainKind, operation: admissionv1.Delete}, + {kind: v1alpha2.DomainKind, operation: admissionv1.Connect}, } for _, test := range tests { diff --git a/cmd/web-hooks/internal/handler/mutate.go b/cmd/web-hooks/internal/handler/mutate.go deleted file mode 100644 index b979c66d..00000000 --- a/cmd/web-hooks/internal/handler/mutate.go +++ /dev/null @@ -1,290 +0,0 @@ -/* -SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator contributors -SPDX-License-Identifier: Apache-2.0 -*/ - -package handler - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" - "gomodules.xyz/jsonpatch/v2" - admissionv1 "k8s.io/api/admission/v1" - k8sErrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/klog/v2" -) - -type matchingDomainDetails struct { - name string - kind string -} - -const ( - LabelMigratedToDomainRefsFromCA = "sme.sap.com/migrated-to-domain-refs-from-ca" - PrimaryDomainSuffix = "-primary" - CAPOperatorDomainsPrefix = "cap-operator-domains-" -) - -var jsonpatchType = admissionv1.PatchTypeJSONPatch - -func (wh *WebhookHandler) Mutate(w http.ResponseWriter, r *http.Request) { - // read incoming request to bytes - body, err := io.ReadAll(r.Body) - if err != nil { - httpError(w, http.StatusInternalServerError, fmt.Errorf("%s %w", AdmissionError, err)) - return - } - - // create admission review from bytes - admissionReview := getAdmissionRequestFromBytes(w, body) - if admissionReview == nil { - return - } - admissionReview.Response = &admissionv1.AdmissionResponse{ - UID: admissionReview.Request.UID, - } - - klog.InfoS("incoming admission review (mutate)", "kind", admissionReview.Request.Kind.Kind) - - switch admissionReview.Request.Kind.Kind { - case v1alpha1.CAPApplicationKind: - err = wh.mutateCA(admissionReview) - } - - if err != nil { - klog.ErrorS(err, "error in admission review (mutate)", "kind", admissionReview.Request.Kind.Kind, "name", admissionReview.Request.Name, "namespace", admissionReview.Request.Namespace) - admissionReview.Response.Result = &metav1.Status{ - Message: err.Error(), - } - } else { - admissionReview.Response.Allowed = true - } - - // prepare response - if bytes, err := json.Marshal(&admissionReview); err != nil { - httpError(w, http.StatusInternalServerError, fmt.Errorf("%s %w", AdmissionError, err)) - } else { - w.Write(bytes) - } -} - -func (wh *WebhookHandler) mutateCA(admissionReview *admissionv1.AdmissionReview) error { - caObjOld := v1alpha1.CAPApplication{} - caObj := v1alpha1.CAPApplication{} - - // Note: OldObject is nil for "CONNECT" and "CREATE" operations - if admissionReview.Request.Operation == admissionv1.Delete || admissionReview.Request.Operation == admissionv1.Update { - if _, _, err := universalDeserializer.Decode(admissionReview.Request.OldObject.Raw, nil, &caObjOld); err != nil { - return err - } - } - if admissionReview.Request.Operation == admissionv1.Update || admissionReview.Request.Operation == admissionv1.Create { - // Note: Object is nil for "DELETE" operation - if _, _, err := universalDeserializer.Decode(admissionReview.Request.Object.Raw, nil, &caObj); err != nil { - return err - } - - // If there is no domains, we skip the migration - if !(caObj.Spec.Domains.Primary != "" || len(caObj.Spec.Domains.Secondary) > 0) { - return nil - } - // Domains are DEPRECATED --> migrate to domainRefs - admissionReview.Response.Warnings = append(admissionReview.Response.Warnings, "CAPApplication --> Spec.Domains is deprecated, use Spec.DomainRefs instead") - // Check if we can migrate - canMigrate, err := wh.canMigrate(&caObj) - if err != nil { - return err - } - if canMigrate { - admissionReview.Response.Warnings = append(admissionReview.Response.Warnings, "Automatically migrating Domains to DomainRefs for CAPApplication: "+caObj.Namespace+"/"+caObj.Name) - klog.InfoS("migrating domains to domainRefs", "primary", caObj.Spec.Domains.Primary, "secondary", caObj.Spec.Domains.Secondary) - return wh.migrateDomainsToDomainRefs(&caObj, admissionReview) - } - } - return nil -} - -func (wh *WebhookHandler) canMigrate(ca *v1alpha1.CAPApplication) (bool, error) { - // Check if the Domains field is not empty - caExisting, err := wh.CrdClient.SmeV1alpha1().CAPApplications(ca.Namespace).Get(context.TODO(), ca.Name, metav1.GetOptions{}) - if err != nil && !k8sErrors.IsNotFound(err) { - return false, err - } - - if caExisting != nil && len(caExisting.Spec.DomainRefs) > 0 { - return false, nil - } - // At this point, either the CAPApplication does not exist -or- it does not have any domainRefs, so we can proceed with migration - return true, nil -} - -func (wh *WebhookHandler) migrateDomainsToDomainRefs(ca *v1alpha1.CAPApplication, admissionReview *admissionv1.AdmissionReview) error { - // Create a new CAPApplication object based on the old object, so that we can add domainRefs and remove the old Domains field - caMigrated := ca.DeepCopy() - - // Initialize DomainRefs if nil or non-empty to an empty slice - if caMigrated.Spec.DomainRefs == nil || len(caMigrated.Spec.DomainRefs) > 0 { - caMigrated.Spec.DomainRefs = []v1alpha1.DomainRef{} - } - - // Migrate Primary Domain to DomainRefs - if ca.Spec.Domains.Primary != "" { - err := wh.handleDomain(ca.Spec.Domains.Primary, caMigrated, -1) - if err != nil { - return err - } - } - - // Migrate Secondary Domains to DomainRefs - if len(ca.Spec.Domains.Secondary) > 0 { - for index, secondaryDomain := range ca.Spec.Domains.Secondary { - err := wh.handleDomain(secondaryDomain, caMigrated, index) - if err != nil { - return err - } - } - } - - // Remove the old Domains field, once migrated - // Note: This is done to ensure that the old Domains field is not present in the migrated object - caMigrated.Spec.Domains = v1alpha1.ApplicationDomains{} - - // Get JSON representation of current and migrated CAPApplication object(s) - caRaw, err := json.Marshal(ca) - if err != nil { - return err - } - caMigratedRaw, err := json.Marshal(caMigrated) - if err != nil { - return err - } - - // Create JSON patch to update the CAPApplication object based on migrated object - patch, err := jsonpatch.CreatePatch(caRaw, caMigratedRaw) - if err != nil { - return err - } - - // Create the admission response with the patch - jsonp, err := json.Marshal(patch) - if err != nil { - return err - } - - // Set the response with JSONPatch in the admission review - admissionReview.Response.Patch = jsonp - admissionReview.Response.PatchType = &jsonpatchType - - return nil -} - -func (wh *WebhookHandler) handleDomain(domain string, ca *v1alpha1.CAPApplication, index int) error { - // Check if the domain already exists in the current namespace or as a ClusterDomain - domainDetails, err := wh.getDomain(domain, ca.Namespace) - if err != nil { - return err - } - if domainDetails == nil { - klog.InfoS("No existing Domain resources found for domain", "domain", domain) - annotations := map[string]string{ - LabelMigratedToDomainRefsFromCA: ca.Namespace + "/" + ca.Name, - } - ingressLabels := map[string]string{} - for _, label := range ca.Spec.Domains.IstioIngressGatewayLabels { - ingressLabels[label.Name] = label.Value - } - // If no matching domain is found, create a new one based on the index - if index == -1 { - domainDetails, err = wh.createDomain(domain, ca.Name+PrimaryDomainSuffix, ca.Namespace, annotations, ingressLabels) - } else { - domainDetails, err = wh.createClusterDomain(domain, CAPOperatorDomainsPrefix, annotations, ingressLabels) - } - } - if err != nil { - return err - } - - ca.Spec.DomainRefs = append(ca.Spec.DomainRefs, v1alpha1.DomainRef{ - Name: domainDetails.name, - Kind: domainDetails.kind, - }) - - klog.InfoS("DomainRef added to CAPApplication", "domainRef", domainDetails.name, "kind", domainDetails.kind) - - return nil -} - -func (wh *WebhookHandler) getDomain(domain, namespace string) (*matchingDomainDetails, error) { - // Check if the domain exists in current namespace - doms, err := wh.CrdClient.SmeV1alpha1().Domains(namespace).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - return nil, err - } - for _, dom := range doms.Items { - if dom.Spec.Domain == domain { - klog.InfoS("Existing Domain resource found for domain", "domain", domain) - return &matchingDomainDetails{name: dom.Name, kind: v1alpha1.DomainKind}, nil - } - } - // Else, check if a ClusterDomain exists with the same domain - clusterDoms, err := wh.CrdClient.SmeV1alpha1().ClusterDomains(metav1.NamespaceAll).List(context.TODO(), metav1.ListOptions{}) - if err != nil { - return nil, err - } - for _, clusterDom := range clusterDoms.Items { - if clusterDom.Spec.Domain == domain { - klog.InfoS("Existing ClusterDomain resource found for domain", "domain", domain) - return &matchingDomainDetails{name: clusterDom.Name, kind: v1alpha1.ClusterDomainKind}, nil - } - } - return nil, nil -} - -func (wh *WebhookHandler) createDomain(domain string, name string, namespace string, annotations map[string]string, ingressSelector map[string]string) (details *matchingDomainDetails, err error) { - var createdDom *v1alpha1.Domain - domainResource := &v1alpha1.Domain{ - ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Annotations: annotations, - }, - Spec: v1alpha1.DomainSpec{ - Domain: domain, - IngressSelector: ingressSelector, - TLSMode: v1alpha1.TlsModeSimple, - DNSMode: v1alpha1.DnsModeWildcard, - }, - } - // Create the Domain in the Kubernetes cluster - if createdDom, err = wh.CrdClient.SmeV1alpha1().Domains(namespace).Create(context.TODO(), domainResource, metav1.CreateOptions{}); err != nil { - return nil, err - } - return &matchingDomainDetails{name: createdDom.Name, kind: v1alpha1.DomainKind}, nil -} - -func (wh *WebhookHandler) createClusterDomain(domain string, name string, annotations map[string]string, ingressSelector map[string]string) (details *matchingDomainDetails, err error) { - var createdDom *v1alpha1.ClusterDomain - clusterDomainResource := &v1alpha1.ClusterDomain{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: name, - Annotations: annotations, - }, - Spec: v1alpha1.DomainSpec{ - Domain: domain, - IngressSelector: ingressSelector, - TLSMode: v1alpha1.TlsModeSimple, - DNSMode: v1alpha1.DnsModeSubdomain, - }, - } - // Create the Domain in the Kubernetes cluster - if createdDom, err = wh.CrdClient.SmeV1alpha1().ClusterDomains(metav1.NamespaceNone).Create(context.TODO(), clusterDomainResource, metav1.CreateOptions{}); err != nil { - return nil, err - } - return &matchingDomainDetails{name: createdDom.Name, kind: v1alpha1.ClusterDomainKind}, nil -} diff --git a/cmd/web-hooks/internal/handler/mutate_test.go b/cmd/web-hooks/internal/handler/mutate_test.go deleted file mode 100644 index e08bbe8f..00000000 --- a/cmd/web-hooks/internal/handler/mutate_test.go +++ /dev/null @@ -1,484 +0,0 @@ -/* -SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator contributors -SPDX-License-Identifier: Apache-2.0 -*/ - -package handler - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "net/http" - "net/http/httptest" - "testing" - - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" - fakeCrdClient "github.com/sap/cap-operator/pkg/client/clientset/versioned/fake" - admissionv1 "k8s.io/api/admission/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - k8stesting "k8s.io/client-go/testing" -) - -// #region setup -func newTestHandler(objects ...runtime.Object) *WebhookHandler { - return &WebhookHandler{ - CrdClient: fakeCrdClient.NewSimpleClientset(objects...), - } -} - -func marshalJSON(obj any) []byte { - b, err := json.Marshal(obj) - if err != nil { - panic(err) - } - return b -} - -type testReader struct{} - -func (tr *testReader) Read(_ []byte) (n int, err error) { - return 0, errors.New("test error") -} - -func simulateErrorOnAPICall(clientSet *fakeCrdClient.Clientset, verb string, resource string) { - // Simulate an error on create - clientSet.Fake.PrependReactor(verb, resource, func(action k8stesting.Action) (handled bool, ret runtime.Object, err error) { - return true, nil, fmt.Errorf("test error for %s on %s", resource, verb) - }) -} - -//#endregion - -// #region tests -func TestMutate_NoBody(t *testing.T) { - wh := newTestHandler() - req := httptest.NewRequest("POST", "/mutate", nil) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusBadRequest { - t.Fatal("expected 400 Bad Request, got", w.Code) - } -} - -func TestMutate_InvalidBody(t *testing.T) { - wh := newTestHandler() - req := httptest.NewRequest("POST", "/mutate", &testReader{}) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusInternalServerError { - t.Fatal("expected 500 Internal Server Error, got", w.Code) - } -} - -func TestMutate_NonCAPApplicationKind_Allows(t *testing.T) { - wh := newTestHandler() - ar := admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - UID: "123", - Kind: metav1.GroupVersionKind{Kind: "OtherKind"}, - }, - } - body, _ := json.Marshal(ar) - req := httptest.NewRequest("POST", "/mutate", bytes.NewReader(body)) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusOK { - t.Fatal("expected 200 OK, got", w.Code) - } - var resp admissionv1.AdmissionReview - json.Unmarshal(w.Body.Bytes(), &resp) - if resp.Response.Allowed != true { - t.Fatal("expected response to be allowed") - } -} - -func TestMutate_CAPApplicationKind_Allows(t *testing.T) { - wh := newTestHandler() - ar := admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - UID: "123", - Kind: metav1.GroupVersionKind{Kind: v1alpha1.CAPApplicationKind}, - Operation: admissionv1.Update, - }, - } - body, _ := json.Marshal(ar) - req := httptest.NewRequest("POST", "/mutate", bytes.NewReader(body)) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusOK { - t.Fatal("expected 200 OK, got", w.Code) - } - var resp admissionv1.AdmissionReview - json.Unmarshal(w.Body.Bytes(), &resp) - if resp.Response.Allowed != true { - t.Fatal("expected response to be allowed") - } -} - -func TestMutate_ErrorOnCanMigrate(t *testing.T) { - wh := newTestHandler() - // Simulate an error on create - simulateErrorOnAPICall(wh.CrdClient.(*fakeCrdClient.Clientset), "get", "capapplications") - - ar := admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - UID: "123", - Kind: metav1.GroupVersionKind{Kind: v1alpha1.CAPApplicationKind}, - Operation: admissionv1.Update, - Object: runtime.RawExtension{Raw: marshalJSON(v1alpha1.CAPApplication{ - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: "some.app.com", - }, - }, - })}, - }, - } - body, _ := json.Marshal(ar) - req := httptest.NewRequest("POST", "/mutate", bytes.NewReader(body)) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusOK { - t.Fatal("expected 200 OK, got", w.Code) - } - var resp admissionv1.AdmissionReview - json.Unmarshal(w.Body.Bytes(), &resp) - if resp.Response.Allowed != false { - t.Fatal("expected response to be disallowed") - } - if resp.Response.Result.Message != "test error for capapplications on get" { - t.Fatalf("expected error message about CAPApplication (canMigrate), got: %s", resp.Response.Result.Message) - } -} - -func TestMutate_CAPApplicationKind_ErrorOnCreateDomain(t *testing.T) { - wh := newTestHandler() - // Simulate an error on create - simulateErrorOnAPICall(wh.CrdClient.(*fakeCrdClient.Clientset), "create", "domains") - - ar := admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - UID: "123", - Kind: metav1.GroupVersionKind{Kind: v1alpha1.CAPApplicationKind}, - Operation: admissionv1.Update, - Object: runtime.RawExtension{Raw: marshalJSON(v1alpha1.CAPApplication{ - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: "some.app.com", - }, - }, - })}, - }, - } - body, _ := json.Marshal(ar) - req := httptest.NewRequest("POST", "/mutate", bytes.NewReader(body)) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusOK { - t.Fatal("expected 200 OK, got", w.Code) - } - var resp admissionv1.AdmissionReview - json.Unmarshal(w.Body.Bytes(), &resp) - if resp.Response.Allowed != false { - t.Fatal("expected response to be disallowed") - } - if resp.Response.Result.Message != "test error for domains on create" { - t.Fatalf("expected error message about Domain creation, got: %s", resp.Response.Result.Message) - } -} - -func TestMutate_CAPApplicationKind_ErrorOnGetDomain(t *testing.T) { - // Create a Domain object to be found by the handler - domain := &v1alpha1.Domain{ - ObjectMeta: metav1.ObjectMeta{Name: "d", Namespace: "testns"}, - Spec: v1alpha1.DomainSpec{Domain: "some.app.com"}, - } - wh := newTestHandler(domain) - // Simulate an error on create - simulateErrorOnAPICall(wh.CrdClient.(*fakeCrdClient.Clientset), "list", "clusterdomains") - - ar := admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - UID: "123", - Kind: metav1.GroupVersionKind{Kind: v1alpha1.CAPApplicationKind}, - Operation: admissionv1.Update, - Object: runtime.RawExtension{Raw: marshalJSON(v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{ - Name: "testca", - Namespace: "testns", - }, - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: "some.app.com", - Secondary: []string{"other.app.com"}, - }, - DomainRefs: []v1alpha1.DomainRef{ - {Kind: "Domain", Name: "d"}, - {Kind: "ClusterDomain", Name: "cd"}, - }, - }, - })}, - }, - } - body, _ := json.Marshal(ar) - req := httptest.NewRequest("POST", "/mutate", bytes.NewReader(body)) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusOK { - t.Fatal("expected 200 OK, got", w.Code) - } - var resp admissionv1.AdmissionReview - json.Unmarshal(w.Body.Bytes(), &resp) - if resp.Response.Allowed != false { - t.Fatal("expected response to be disallowed") - } - if resp.Response.Result.Message != "test error for clusterdomains on list" { - t.Fatalf("expected error message about Domain creation, got: %s", resp.Response.Result.Message) - } -} - -func TestMutateCA_SkipIfNoDomains(t *testing.T) { - wh := newTestHandler() - ar := &admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - UID: "123", - Kind: metav1.GroupVersionKind{Kind: v1alpha1.CAPApplicationKind}, - Operation: admissionv1.Create, - Object: runtime.RawExtension{Raw: marshalJSON(v1alpha1.CAPApplication{ - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{}, - }, - })}, - }, - Response: &admissionv1.AdmissionResponse{}, - } - body, _ := json.Marshal(ar) - req := httptest.NewRequest("POST", "/mutate", bytes.NewReader(body)) - w := httptest.NewRecorder() - wh.Mutate(w, req) - if w.Code != http.StatusOK { - t.Fatal("expected 200 OK, got", w.Code) - } - var resp admissionv1.AdmissionReview - json.Unmarshal(w.Body.Bytes(), &resp) - if resp.Response.Allowed != true { - t.Fatal("expected response to be allowed") - } - -} - -func TestHandleDomain_ExistingDomain(t *testing.T) { - // Create a Domain object to be found by the handler - domain := &v1alpha1.Domain{ - ObjectMeta: metav1.ObjectMeta{Name: "d", Namespace: "ns"}, - Spec: v1alpha1.DomainSpec{Domain: "foo"}, - } - wh := newTestHandler(domain) - ca := &v1alpha1.CAPApplication{Spec: v1alpha1.CAPApplicationSpec{}} - err := wh.handleDomain("foo", ca, -1) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - if len(ca.Spec.DomainRefs) != 1 { - t.Fatalf("expected 1 domain ref, got %d", len(ca.Spec.DomainRefs)) - } -} - -func TestMutateCA_MigrateDomainsToDomainRefs(t *testing.T) { - // Setup: CAPApplication with primary and secondary domains, no DomainRefs - ca := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: "first.com", - Secondary: []string{"second.com"}, - }, - DomainRefs: nil, - }, - } - // Add Domain and ClusterDomain objects to the fake client - domain := &v1alpha1.Domain{ - ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "testns"}, - Spec: v1alpha1.DomainSpec{Domain: "first.com"}, - } - clusterDomain := &v1alpha1.ClusterDomain{ - ObjectMeta: metav1.ObjectMeta{Name: "bar", Namespace: ""}, - Spec: v1alpha1.DomainSpec{Domain: "second.com"}, - } - wh := newTestHandler(domain, clusterDomain) - ar := &admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - Operation: admissionv1.Create, - Object: runtime.RawExtension{Raw: marshalJSON(ca)}, - }, - Response: &admissionv1.AdmissionResponse{}, - } - err := wh.mutateCA(ar) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - // Should warn about migration and patch - if len(ar.Response.Warnings) == 0 { - t.Error("expected migration warning") - } -} - -func TestMutateCA_SkipMigrateDomainsToDomainRefs(t *testing.T) { - // Setup: CAPApplication with primary and secondary domains, no DomainRefs - ca := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: "foo.com", - }, - DomainRefs: []v1alpha1.DomainRef{ - {Kind: "Domain", Name: "foo"}, - {Kind: "ClusterDomain", Name: "bar"}, - }, - }, - } - // Add Domain and ClusterDomain objects to the fake client - domain := &v1alpha1.Domain{ - ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "testns"}, - Spec: v1alpha1.DomainSpec{Domain: "foo.com"}, - } - clusterDomain := &v1alpha1.ClusterDomain{ - ObjectMeta: metav1.ObjectMeta{Name: "bar", Namespace: ""}, - Spec: v1alpha1.DomainSpec{Domain: "bar.com"}, - } - wh := newTestHandler(ca, domain, clusterDomain) - ar := &admissionv1.AdmissionReview{ - Request: &admissionv1.AdmissionRequest{ - Operation: admissionv1.Create, - Object: runtime.RawExtension{Raw: marshalJSON(ca)}, - }, - Response: &admissionv1.AdmissionResponse{}, - } - err := wh.mutateCA(ar) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - // Should warn about migration and patch - if len(ar.Response.Warnings) == 0 { - t.Error("expected migration warning") - } -} - -func TestCanMigrate_NoExistingObject(t *testing.T) { - wh := newTestHandler() - ca := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - } - ok, err := wh.canMigrate(ca) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - if !ok { - t.Error("expected canMigrate to be true when no existing object") - } -} - -func TestCanMigrate_ExistingWithDomainRefs(t *testing.T) { - // Existing object with DomainRefs should return false - existing := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - Spec: v1alpha1.CAPApplicationSpec{ - DomainRefs: []v1alpha1.DomainRef{{Kind: "Domain", Name: "foo"}}, - }, - } - wh := newTestHandler(existing) - ca := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - } - ok, err := wh.canMigrate(ca) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - if ok { - t.Error("expected canMigrate to be false when existing object has DomainRefs") - } -} - -func TestHandleDomain_CreatesDomainIfNotFound(t *testing.T) { - wh := newTestHandler() - ca := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: "newdomain.com", - IstioIngressGatewayLabels: []v1alpha1.NameValue{{Name: "app", Value: "istio-ingressgateway"}, {Name: "istio", Value: "ingressgateway"}}, - }, - }, - } - err := wh.handleDomain("newdomain.com", ca, -1) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - if len(ca.Spec.DomainRefs) != 1 { - t.Fatalf("expected 1 domain ref, got %d", len(ca.Spec.DomainRefs)) - } - if ca.Spec.DomainRefs[0].Kind != "Domain" { - t.Fatalf("expected DomainRef kind Domain, got %s", ca.Spec.DomainRefs[0].Kind) - } -} - -func TestHandleDomain_CreatesClusterDomainIfNotFound(t *testing.T) { - wh := newTestHandler() - ca := &v1alpha1.CAPApplication{ - ObjectMeta: metav1.ObjectMeta{Name: "testca", Namespace: "testns"}, - Spec: v1alpha1.CAPApplicationSpec{}, - } - err := wh.handleDomain("clusterdomain.com", ca, 0) - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - if len(ca.Spec.DomainRefs) != 1 { - t.Fatalf("expected 1 domain ref, got %d", len(ca.Spec.DomainRefs)) - } - if ca.Spec.DomainRefs[0].Kind != "ClusterDomain" { - t.Fatalf("expected DomainRef kind ClusterDomain, got %s", ca.Spec.DomainRefs[0].Kind) - } -} - -func TestHandleDomain_ReturnsErrorDomain(t *testing.T) { - wh := newTestHandler() - simulateErrorOnAPICall(wh.CrdClient.(*fakeCrdClient.Clientset), "list", "domains") - err := wh.handleDomain("domain.com", &v1alpha1.CAPApplication{}, -1) - if err == nil { - t.Fatalf("expected error got nil") - } -} - -func TestHandleDomain_ReturnsErrorListClusterDomain(t *testing.T) { - wh := newTestHandler() - simulateErrorOnAPICall(wh.CrdClient.(*fakeCrdClient.Clientset), "list", "clusterdomains") - err := wh.handleDomain("domain.com", &v1alpha1.CAPApplication{}, 1) - if err == nil { - t.Fatalf("expected error got nil") - } -} - -func TestHandleDomain_ReturnsErrorCreateClusterDomain(t *testing.T) { - wh := newTestHandler() - simulateErrorOnAPICall(wh.CrdClient.(*fakeCrdClient.Clientset), "create", "clusterdomains") - err := wh.handleDomain("domain.com", &v1alpha1.CAPApplication{}, 1) - if err == nil { - t.Fatalf("expected error got nil") - } -} - -func TestGetDomain_ReturnsNilIfNotFound(t *testing.T) { - wh := newTestHandler() - details, err := wh.getDomain("notfound.com", "ns") - if err != nil { - t.Fatalf("expected no error, got %v", err) - } - if details != nil { - t.Fatal("expected nil details for not found domain") - } -} - -//#endregion diff --git a/cmd/web-hooks/main.go b/cmd/web-hooks/main.go index 0b413302..34d1c379 100644 --- a/cmd/web-hooks/main.go +++ b/cmd/web-hooks/main.go @@ -70,7 +70,6 @@ func main() { } http.HandleFunc("/validate", whHandler.Validate) - http.HandleFunc("/mutate", whHandler.Mutate) if parameters.tlsEnabled { klog.Fatal(http.ListenAndServeTLS(":"+strconv.Itoa(parameters.port), parameters.certFile, parameters.keyFile, nil)) diff --git a/crds/sme.sap.com_capapplications.yaml b/crds/sme.sap.com_capapplications.yaml index 8db43b7b..561cb1ac 100644 --- a/crds/sme.sap.com_capapplications.yaml +++ b/crds/sme.sap.com_capapplications.yaml @@ -23,6 +23,7 @@ spec: - jsonPath: .status.state name: State type: string + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -195,6 +196,158 @@ spec: - spec type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + btp: + properties: + services: + items: + properties: + class: + type: string + name: + type: string + secret: + type: string + subscriptionDependency: + enum: + - Auto + - Always + - Never + type: string + required: + - class + - name + - secret + type: object + type: array + required: + - services + type: object + btpAppName: + type: string + domainRefs: + items: + properties: + kind: + enum: + - Domain + - ClusterDomain + type: string + name: + type: string + required: + - kind + - name + type: object + type: array + provider: + properties: + subDomain: + type: string + tenantId: + type: string + required: + - subDomain + - tenantId + type: object + providerSubaccountId: + type: string + rolloutOnCredentialUpdate: + type: boolean + required: + - btp + - btpAppName + - providerSubaccountId + 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 + domainSpecHash: + type: string + lastFullReconciliationTime: + format: date-time + type: string + observedGeneration: + format: int64 + type: integer + observedSubdomains: + items: + type: string + type: array + servicesOnly: + type: boolean + state: + enum: + - "" + - Consistent + - Processing + - Error + - 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_capapplicationversions.yaml b/crds/sme.sap.com_capapplicationversions.yaml index a5b4a400..29b186d1 100644 --- a/crds/sme.sap.com_capapplicationversions.yaml +++ b/crds/sme.sap.com_capapplicationversions.yaml @@ -26,6 +26,7 @@ spec: - jsonPath: .spec.version name: Version type: string + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -6084,6 +6085,6077 @@ spec: - spec type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + - jsonPath: .spec.version + name: Version + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + capApplicationInstance: + type: string + contentJobs: + items: + type: string + type: array + registrySecrets: + items: + type: string + type: array + serviceExposures: + items: + properties: + routes: + items: + properties: + path: + type: string + port: + format: int32 + type: integer + workloadName: + type: string + required: + - port + - workloadName + type: object + type: array + subDomain: + type: string + required: + - routes + - subDomain + type: object + type: array + tenantOperations: + properties: + deprovisioning: + items: + properties: + continueOnFailure: + type: boolean + workloadName: + type: string + required: + - workloadName + type: object + type: array + provisioning: + items: + properties: + continueOnFailure: + type: boolean + workloadName: + type: string + required: + - workloadName + type: object + type: array + upgrade: + items: + properties: + continueOnFailure: + type: boolean + workloadName: + type: string + required: + - workloadName + type: object + type: array + type: object + version: + pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)(\.(0|[1-9]\d*)(-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?)?)?$ + type: string + workloads: + items: + properties: + annotations: + additionalProperties: + type: string + type: object + consumedBTPServices: + items: + type: string + type: array + deploymentDefinition: + properties: + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + type: object + x-kubernetes-map-type: atomic + weight: + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + x-kubernetes-list-type: atomic + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + type: object + x-kubernetes-map-type: atomic + type: array + x-kubernetes-list-type: atomic + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + x-kubernetes-list-type: atomic + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + x-kubernetes-list-type: atomic + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + x-kubernetes-list-type: atomic + type: object + type: object + args: + items: + type: string + type: array + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + horizontalPodAutoscaler: + properties: + behavior: + properties: + scaleDown: + properties: + policies: + items: + properties: + periodSeconds: + format: int32 + type: integer + type: + type: string + value: + format: int32 + type: integer + required: + - periodSeconds + - type + - value + type: object + type: array + x-kubernetes-list-type: atomic + selectPolicy: + type: string + stabilizationWindowSeconds: + format: int32 + type: integer + tolerance: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + scaleUp: + properties: + policies: + items: + properties: + periodSeconds: + format: int32 + type: integer + type: + type: string + value: + format: int32 + type: integer + required: + - periodSeconds + - type + - value + type: object + type: array + x-kubernetes-list-type: atomic + selectPolicy: + type: string + stabilizationWindowSeconds: + format: int32 + type: integer + tolerance: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + maxReplicas: + format: int32 + type: integer + metrics: + items: + properties: + containerResource: + properties: + container: + type: string + name: + type: string + target: + properties: + averageUtilization: + format: int32 + type: integer + averageValue: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + type: string + value: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - type + type: object + required: + - container + - name + - target + type: object + external: + properties: + metric: + properties: + name: + type: string + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + required: + - name + type: object + target: + properties: + averageUtilization: + format: int32 + type: integer + averageValue: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + type: string + value: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - type + type: object + required: + - metric + - target + type: object + object: + properties: + describedObject: + properties: + apiVersion: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + metric: + properties: + name: + type: string + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + required: + - name + type: object + target: + properties: + averageUtilization: + format: int32 + type: integer + averageValue: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + type: string + value: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - type + type: object + required: + - describedObject + - metric + - target + type: object + pods: + properties: + metric: + properties: + name: + type: string + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + required: + - name + type: object + target: + properties: + averageUtilization: + format: int32 + type: integer + averageValue: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + type: string + value: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - type + type: object + required: + - metric + - target + type: object + resource: + properties: + name: + type: string + target: + properties: + averageUtilization: + format: int32 + type: integer + averageValue: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + type: string + value: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + required: + - type + type: object + required: + - name + - target + type: object + type: + type: string + required: + - type + type: object + type: array + minReplicas: + format: int32 + type: integer + required: + - maxReplicas + type: object + image: + type: string + imagePullPolicy: + type: string + initContainers: + items: + properties: + args: + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + envFrom: + items: + properties: + configMapRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + x-kubernetes-list-type: atomic + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + stopSignal: + type: string + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - devicePath + x-kubernetes-list-type: map + volumeMounts: + items: + properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + workingDir: + type: string + required: + - name + type: object + type: array + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + stopSignal: + type: string + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + monitoring: + properties: + deletionRules: + properties: + expression: + type: string + metrics: + items: + properties: + calculationPeriod: + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + name: + type: string + thresholdValue: + format: double + type: string + type: + enum: + - Gauge + - Counter + type: string + required: + - calculationPeriod + - name + - thresholdValue + - type + type: object + type: array + type: object + x-kubernetes-validations: + - message: exactly one of the fields in [metrics expression] + must be set + rule: (has(self.metrics)?1:0)+(has(self.expression)?1:0) + == 1 + scrapeConfig: + properties: + interval: + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + path: + type: string + port: + type: string + scrapeTimeout: + pattern: ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$ + type: string + required: + - port + type: object + type: object + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + podDisruptionBudget: + properties: + maxUnavailable: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + minAvailable: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + unhealthyPodEvictionPolicy: + type: string + type: object + podSecurityContext: + properties: + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxChangePolicy: + type: string + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + type: string + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + ports: + items: + properties: + appProtocol: + type: string + name: + type: string + networkPolicy: + enum: + - Application + - Cluster + type: string + port: + format: int32 + type: integer + routerDestinationName: + type: string + required: + - name + - port + type: object + type: array + priorityClassName: + type: string + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + replicas: + format: int32 + type: integer + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccountName: + type: string + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stickiness: + properties: + hash: + properties: + httpCookie: + properties: + attributes: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + name: + type: string + path: + type: string + ttl: + type: string + type: object + httpHeaderName: + type: string + httpQueryParameterName: + type: string + useSourceIp: + type: boolean + type: object + x-kubernetes-validations: + - message: at most one of the fields in [httpHeaderName + httpCookie useSourceIp httpQueryParameterName] may + be set + rule: (has(self.httpHeaderName)?1:0)+(has(self.httpCookie)?1:0)+(has(self.useSourceIp)?1:0)+(has(self.httpQueryParameterName)?1:0) + <= 1 + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + type: array + type: + type: string + volumeMounts: + items: + properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + default: ext4 + type: string + kind: + type: string + readOnly: + default: false + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + user: + format: int64 + type: integer + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + emptyDir: + properties: + medium: + type: string + mode: + format: int32 + type: integer + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + x-kubernetes-list-type: atomic + wwids: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + image: + properties: + pullPolicy: + type: string + reference: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + default: default + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + x-kubernetes-list-type: atomic + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + user: + format: int64 + type: integer + required: + - path + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + user: + format: int64 + type: integer + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + user: + format: int64 + type: integer + userAnnotations: + additionalProperties: + type: string + type: object + required: + - keyType + - signerName + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - path + type: object + type: object + type: array + x-kubernetes-list-type: atomic + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + default: /etc/ceph/keyring + type: string + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + pool: + default: rbd + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + default: admin + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + default: xfs + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + default: ThinProvisioned + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + required: + - image + - type + type: object + jobDefinition: + properties: + activeDeadlineSeconds: + format: int64 + type: integer + affinity: + properties: + nodeAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + preference: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + type: object + x-kubernetes-map-type: atomic + weight: + format: int32 + type: integer + required: + - preference + - weight + type: object + type: array + x-kubernetes-list-type: atomic + requiredDuringSchedulingIgnoredDuringExecution: + properties: + nodeSelectorTerms: + items: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchFields: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + type: object + x-kubernetes-map-type: atomic + type: array + x-kubernetes-list-type: atomic + required: + - nodeSelectorTerms + type: object + x-kubernetes-map-type: atomic + type: object + podAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + x-kubernetes-list-type: atomic + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podAntiAffinity: + properties: + preferredDuringSchedulingIgnoredDuringExecution: + items: + properties: + podAffinityTerm: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + weight: + format: int32 + type: integer + required: + - podAffinityTerm + - weight + type: object + type: array + x-kubernetes-list-type: atomic + requiredDuringSchedulingIgnoredDuringExecution: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + namespaceSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + namespaces: + items: + type: string + type: array + x-kubernetes-list-type: atomic + topologyKey: + type: string + required: + - topologyKey + type: object + type: array + x-kubernetes-list-type: atomic + type: object + type: object + args: + items: + type: string + type: array + backoffLimit: + format: int32 + type: integer + command: + items: + type: string + type: array + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + image: + type: string + imagePullPolicy: + type: string + initContainers: + items: + properties: + args: + items: + type: string + type: array + x-kubernetes-list-type: atomic + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + env: + items: + properties: + name: + type: string + value: + type: string + valueFrom: + properties: + configMapKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + secretKeyRef: + properties: + key: + type: string + name: + default: "" + type: string + optional: + type: boolean + required: + - key + type: object + x-kubernetes-map-type: atomic + type: object + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + envFrom: + items: + properties: + configMapRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + prefix: + type: string + secretRef: + properties: + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + type: object + type: array + x-kubernetes-list-type: atomic + image: + type: string + imagePullPolicy: + type: string + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + stopSignal: + type: string + type: object + livenessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + name: + type: string + ports: + items: + properties: + containerPort: + format: int32 + type: integer + hostIP: + type: string + hostPort: + format: int32 + type: integer + name: + type: string + protocol: + default: TCP + type: string + required: + - containerPort + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + resizePolicy: + items: + properties: + resourceName: + type: string + restartPolicy: + type: string + required: + - resourceName + - restartPolicy + type: object + type: array + x-kubernetes-list-type: atomic + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + startupProbe: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + failureThreshold: + format: int32 + type: integer + grpc: + properties: + mode: + type: string + port: + format: int32 + type: integer + service: + default: "" + type: string + required: + - port + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + initialDelaySeconds: + format: int32 + type: integer + periodSeconds: + format: int32 + type: integer + successThreshold: + format: int32 + type: integer + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + terminationGracePeriodSeconds: + format: int64 + type: integer + timeoutSeconds: + format: int32 + type: integer + type: object + stdin: + type: boolean + stdinOnce: + type: boolean + terminationMessagePath: + type: string + terminationMessagePolicy: + type: string + tty: + type: boolean + volumeDevices: + items: + properties: + devicePath: + type: string + name: + type: string + required: + - devicePath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - devicePath + x-kubernetes-list-type: map + volumeMounts: + items: + properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + x-kubernetes-list-map-keys: + - mountPath + x-kubernetes-list-type: map + workingDir: + type: string + required: + - name + type: object + type: array + lifecycle: + properties: + postStart: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + properties: + exec: + properties: + command: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + httpGet: + properties: + host: + type: string + httpHeaders: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + path: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + protocol: + type: string + scheme: + type: string + required: + - port + type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object + tcpSocket: + properties: + host: + type: string + port: + anyOf: + - type: integer + - type: string + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + stopSignal: + type: string + type: object + nodeName: + type: string + nodeSelector: + additionalProperties: + type: string + type: object + podSecurityContext: + properties: + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + fsGroup: + format: int64 + type: integer + fsGroupChangePolicy: + type: string + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxChangePolicy: + type: string + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + supplementalGroups: + items: + format: int64 + type: integer + type: array + x-kubernetes-list-type: atomic + supplementalGroupsPolicy: + type: string + sysctls: + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + x-kubernetes-list-type: atomic + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + priorityClassName: + type: string + resources: + properties: + claims: + items: + properties: + name: + type: string + request: + type: string + required: + - name + type: object + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + restartPolicy: + type: string + securityContext: + properties: + allowPrivilegeEscalation: + type: boolean + appArmorProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + capabilities: + properties: + add: + items: + type: string + type: array + x-kubernetes-list-type: atomic + drop: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + privileged: + type: boolean + procMount: + type: string + readOnlyRootFilesystem: + type: boolean + runAsGroup: + format: int64 + type: integer + runAsNonRoot: + type: boolean + runAsUser: + format: int64 + type: integer + seLinuxOptions: + properties: + level: + type: string + role: + type: string + type: + type: string + user: + type: string + type: object + seccompProfile: + properties: + localhostProfile: + type: string + type: + type: string + required: + - type + type: object + windowsOptions: + properties: + gmsaCredentialSpec: + type: string + gmsaCredentialSpecName: + type: string + hostProcess: + type: boolean + runAsUserName: + type: string + type: object + type: object + serviceAccountName: + type: string + terminationGracePeriodSeconds: + format: int64 + type: integer + tolerations: + items: + properties: + effect: + type: string + key: + type: string + operator: + type: string + tolerationSeconds: + format: int64 + type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + maxSkew: + format: int32 + type: integer + minDomains: + format: int32 + type: integer + nodeAffinityPolicy: + type: string + nodeTaintsPolicy: + type: string + topologyKey: + type: string + whenUnsatisfiable: + type: string + required: + - maxSkew + - topologyKey + - whenUnsatisfiable + type: object + type: array + ttlSecondsAfterFinished: + format: int32 + type: integer + type: + type: string + volumeMounts: + items: + properties: + bindMountOptions: + items: + type: string + type: array + x-kubernetes-list-type: set + mountPath: + type: string + mountPropagation: + type: string + name: + type: string + readOnly: + type: boolean + recursiveReadOnly: + type: string + subPath: + type: string + subPathExpr: + type: string + required: + - mountPath + - name + type: object + type: array + volumes: + items: + properties: + awsElasticBlockStore: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + azureDisk: + properties: + cachingMode: + type: string + diskName: + type: string + diskURI: + type: string + fsType: + default: ext4 + type: string + kind: + type: string + readOnly: + default: false + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + properties: + readOnly: + type: boolean + secretName: + type: string + shareName: + type: string + required: + - secretName + - shareName + type: object + cephfs: + properties: + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + path: + type: string + readOnly: + type: boolean + secretFile: + type: string + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + type: string + required: + - monitors + type: object + cinder: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeID: + type: string + required: + - volumeID + type: object + configMap: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + csi: + properties: + driver: + type: string + fsType: + type: string + nodePublishSecretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + readOnly: + type: boolean + volumeAttributes: + additionalProperties: + type: string + type: object + required: + - driver + type: object + downwardAPI: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + user: + format: int64 + type: integer + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + emptyDir: + properties: + medium: + type: string + mode: + format: int32 + type: integer + sizeLimit: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + ephemeral: + properties: + volumeClaimTemplate: + properties: + metadata: + type: object + spec: + properties: + accessModes: + items: + type: string + type: array + x-kubernetes-list-type: atomic + dataSource: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + dataSourceRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + resources: + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + type: object + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + storageClassName: + type: string + volumeAttributesClassName: + type: string + volumeMode: + type: string + volumeName: + type: string + type: object + required: + - spec + type: object + type: object + fc: + properties: + fsType: + type: string + lun: + format: int32 + type: integer + readOnly: + type: boolean + targetWWNs: + items: + type: string + type: array + x-kubernetes-list-type: atomic + wwids: + items: + type: string + type: array + x-kubernetes-list-type: atomic + type: object + flexVolume: + properties: + driver: + type: string + fsType: + type: string + options: + additionalProperties: + type: string + type: object + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + required: + - driver + type: object + flocker: + properties: + datasetName: + type: string + datasetUUID: + type: string + type: object + gcePersistentDisk: + properties: + fsType: + type: string + partition: + format: int32 + type: integer + pdName: + type: string + readOnly: + type: boolean + required: + - pdName + type: object + gitRepo: + properties: + directory: + type: string + repository: + type: string + revision: + type: string + required: + - repository + type: object + glusterfs: + properties: + endpoints: + type: string + path: + type: string + readOnly: + type: boolean + required: + - endpoints + - path + type: object + hostPath: + properties: + path: + type: string + type: + type: string + required: + - path + type: object + image: + properties: + pullPolicy: + type: string + reference: + type: string + type: object + iscsi: + properties: + chapAuthDiscovery: + type: boolean + chapAuthSession: + type: boolean + fsType: + type: string + initiatorName: + type: string + iqn: + type: string + iscsiInterface: + default: default + type: string + lun: + format: int32 + type: integer + portals: + items: + type: string + type: array + x-kubernetes-list-type: atomic + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + targetPortal: + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + type: string + nfs: + properties: + path: + type: string + readOnly: + type: boolean + server: + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + properties: + claimName: + type: string + readOnly: + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + properties: + fsType: + type: string + pdID: + type: string + required: + - pdID + type: object + portworxVolume: + properties: + fsType: + type: string + readOnly: + type: boolean + volumeID: + type: string + required: + - volumeID + type: object + projected: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + sources: + items: + properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + x-kubernetes-list-type: atomic + required: + - key + - operator + type: object + type: array + x-kubernetes-list-type: atomic + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + user: + format: int64 + type: integer + required: + - path + type: object + configMap: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + downwardAPI: + properties: + items: + items: + properties: + fieldRef: + properties: + apiVersion: + type: string + fieldPath: + type: string + required: + - fieldPath + type: object + x-kubernetes-map-type: atomic + mode: + format: int32 + type: integer + path: + type: string + resourceFieldRef: + properties: + containerName: + type: string + divisor: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + type: string + required: + - resource + type: object + x-kubernetes-map-type: atomic + user: + format: int64 + type: integer + required: + - path + type: object + type: array + x-kubernetes-list-type: atomic + type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + user: + format: int64 + type: integer + userAnnotations: + additionalProperties: + type: string + type: object + required: + - keyType + - signerName + type: object + secret: + properties: + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + name: + default: "" + type: string + optional: + type: boolean + type: object + x-kubernetes-map-type: atomic + serviceAccountToken: + properties: + audience: + type: string + expirationSeconds: + format: int64 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - path + type: object + type: object + type: array + x-kubernetes-list-type: atomic + type: object + quobyte: + properties: + group: + type: string + readOnly: + type: boolean + registry: + type: string + tenant: + type: string + user: + type: string + volume: + type: string + required: + - registry + - volume + type: object + rbd: + properties: + fsType: + type: string + image: + type: string + keyring: + default: /etc/ceph/keyring + type: string + monitors: + items: + type: string + type: array + x-kubernetes-list-type: atomic + pool: + default: rbd + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + user: + default: admin + type: string + required: + - image + - monitors + type: object + scaleIO: + properties: + fsType: + default: xfs + type: string + gateway: + type: string + protectionDomain: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + sslEnabled: + type: boolean + storageMode: + default: ThinProvisioned + type: string + storagePool: + type: string + system: + type: string + volumeName: + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + properties: + defaultMode: + format: int32 + type: integer + defaultUser: + format: int64 + type: integer + items: + items: + properties: + key: + type: string + mode: + format: int32 + type: integer + path: + type: string + user: + format: int64 + type: integer + required: + - key + - path + type: object + type: array + x-kubernetes-list-type: atomic + optional: + type: boolean + secretName: + type: string + type: object + storageos: + properties: + fsType: + type: string + readOnly: + type: boolean + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + volumeName: + type: string + volumeNamespace: + type: string + type: object + vsphereVolume: + properties: + fsType: + type: string + storagePolicyID: + type: string + storagePolicyName: + type: string + volumePath: + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + required: + - image + - type + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + required: + - consumedBTPServices + - name + type: object + x-kubernetes-validations: + - message: exactly one of the fields in [deploymentDefinition jobDefinition] + must be set + rule: (has(self.deploymentDefinition)?1:0)+(has(self.jobDefinition)?1:0) + == 1 + maxItems: 100 + type: array + required: + - capApplicationInstance + - version + - workloads + 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 + finishedJobs: + items: + type: string + 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_captenantoperations.yaml b/crds/sme.sap.com_captenantoperations.yaml index c312cb5f..e047922a 100644 --- a/crds/sme.sap.com_captenantoperations.yaml +++ b/crds/sme.sap.com_captenantoperations.yaml @@ -26,6 +26,7 @@ spec: - jsonPath: .status.state name: State type: string + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -136,6 +137,129 @@ spec: - spec type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.operation + name: Operation + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + capApplicationVersionInstance: + type: string + operation: + enum: + - provisioning + - deprovisioning + - upgrade + type: string + steps: + items: + properties: + continueOnFailure: + type: boolean + name: + type: string + type: + enum: + - CustomTenantOperation + - TenantOperation + type: string + required: + - name + - type + type: object + type: array + subDomain: + type: string + tenantId: + type: string + required: + - capApplicationVersionInstance + - operation + - steps + - subDomain + - tenantId + type: object + status: + properties: + activeJob: + type: string + 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 + currentStep: + format: int32 + type: integer + observedGeneration: + format: int64 + type: integer + state: + enum: + - "" + - Processing + - Completed + - Failed + - 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_captenantoutputs.yaml b/crds/sme.sap.com_captenantoutputs.yaml index ddfade8e..42b0636a 100644 --- a/crds/sme.sap.com_captenantoutputs.yaml +++ b/crds/sme.sap.com_captenantoutputs.yaml @@ -20,6 +20,7 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -40,5 +41,31 @@ spec: - spec type: object served: true + storage: false + subresources: {} + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + subscriptionCallbackData: + type: string + type: object + required: + - metadata + - spec + type: object + served: true storage: true subresources: {} diff --git a/crds/sme.sap.com_captenants.yaml b/crds/sme.sap.com_captenants.yaml index e29577d8..8392ae65 100644 --- a/crds/sme.sap.com_captenants.yaml +++ b/crds/sme.sap.com_captenants.yaml @@ -29,6 +29,7 @@ spec: - jsonPath: .status.currentCAPApplicationVersionInstance name: Current Version type: string + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -127,6 +128,120 @@ spec: - spec type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + - jsonPath: .spec.subDomain + name: Subdomain + type: string + - jsonPath: .status.currentCAPApplicationVersionInstance + name: Current Version + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + capApplicationInstance: + type: string + subDomain: + type: string + tenantId: + type: string + version: + type: string + versionUpgradeStrategy: + enum: + - always + - never + type: string + required: + - capApplicationInstance + - subDomain + - tenantId + 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 + currentCAPApplicationVersionInstance: + type: string + lastFullReconciliationTime: + format: date-time + type: string + observedGeneration: + format: int64 + type: integer + previousCAPApplicationVersions: + items: + type: string + type: array + state: + enum: + - "" + - Ready + - Provisioning + - Upgrading + - Deleting + - ProvisioningError + - UpgradeError + type: string + required: + - state + type: object + required: + - metadata + - spec + type: object + served: true storage: true subresources: status: {} diff --git a/crds/sme.sap.com_clusterdomains.yaml b/crds/sme.sap.com_clusterdomains.yaml index 56c9ba62..ee07e6b3 100644 --- a/crds/sme.sap.com_clusterdomains.yaml +++ b/crds/sme.sap.com_clusterdomains.yaml @@ -26,6 +26,7 @@ spec: - jsonPath: .status.state name: State type: string + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -166,6 +167,159 @@ spec: - spec type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.domain + name: Domain + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + certConfig: + properties: + additionalCACertificate: + type: string + certManager: + properties: + issuerRef: + properties: + group: + type: string + kind: + type: string + name: + type: string + required: + - name + type: object + required: + - issuerRef + type: object + type: object + dnsMode: + default: None + enum: + - None + - Wildcard + - Subdomain + - Custom + type: string + dnsTarget: + pattern: ^[a-z0-9-.]+$ + type: string + dnsTemplates: + items: + properties: + name: + type: string + target: + type: string + required: + - name + - target + type: object + maxItems: 10 + type: array + domain: + pattern: ^[a-z0-9-.]+$ + type: string + ingressSelector: + additionalProperties: + type: string + type: object + tlsMode: + default: Simple + enum: + - Simple + - Mutual + - OptionalMutual + type: string + required: + - dnsMode + - 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 + dnsTarget: + type: string + gatewayName: + type: string + observedDomain: + type: string + 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 index 3e174b15..6b45bbca 100644 --- a/crds/sme.sap.com_domains.yaml +++ b/crds/sme.sap.com_domains.yaml @@ -26,6 +26,7 @@ spec: - jsonPath: .status.state name: State type: string + deprecated: true name: v1alpha1 schema: openAPIV3Schema: @@ -166,6 +167,159 @@ spec: - spec type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - jsonPath: .spec.domain + name: Domain + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.state + name: State + type: string + name: v1alpha2 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + certConfig: + properties: + additionalCACertificate: + type: string + certManager: + properties: + issuerRef: + properties: + group: + type: string + kind: + type: string + name: + type: string + required: + - name + type: object + required: + - issuerRef + type: object + type: object + dnsMode: + default: None + enum: + - None + - Wildcard + - Subdomain + - Custom + type: string + dnsTarget: + pattern: ^[a-z0-9-.]+$ + type: string + dnsTemplates: + items: + properties: + name: + type: string + target: + type: string + required: + - name + - target + type: object + maxItems: 10 + type: array + domain: + pattern: ^[a-z0-9-.]+$ + type: string + ingressSelector: + additionalProperties: + type: string + type: object + tlsMode: + default: Simple + enum: + - Simple + - Mutual + - OptionalMutual + type: string + required: + - dnsMode + - 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 + dnsTarget: + type: string + gatewayName: + type: string + observedDomain: + type: string + 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/internal/controller/common_test.go b/internal/controller/common_test.go index 3868f7d5..49e20fb4 100644 --- a/internal/controller/common_test.go +++ b/internal/controller/common_test.go @@ -34,7 +34,7 @@ import ( monv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" promopFake "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/fake" promopScheme "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/scheme" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" copfake "github.com/sap/cap-operator/pkg/client/clientset/versioned/fake" smeScheme "github.com/sap/cap-operator/pkg/client/clientset/versioned/scheme" istiometav1alpha1 "istio.io/api/meta/v1alpha1" @@ -61,13 +61,13 @@ import ( var gvrKindMap map[string]string = map[string]string{ "dnsentries.dns.gardener.cloud/v1alpha1": "DNSEntry", - "captenantoutputs.sme.sap.com/v1alpha1": "CAPTenantOutput", - "captenantoperations.sme.sap.com/v1alpha1": "CAPTenantOperation", - "captenants.sme.sap.com/v1alpha1": "CAPTenant", - "capapplications.sme.sap.com/v1alpha1": "CAPApplication", - "capapplicationversions.sme.sap.com/v1alpha1": "CAPApplicationVersion", - "domains.sme.sap.com/v1alpha1": "Domain", - "clusterdomains.sme.sap.com/v1alpha1": "ClusterDomain", + "captenantoutputs.sme.sap.com/v1alpha2": "CAPTenantOutput", + "captenantoperations.sme.sap.com/v1alpha2": "CAPTenantOperation", + "captenants.sme.sap.com/v1alpha2": "CAPTenant", + "capapplications.sme.sap.com/v1alpha2": "CAPApplication", + "capapplicationversions.sme.sap.com/v1alpha2": "CAPApplicationVersion", + "domains.sme.sap.com/v1alpha2": "Domain", + "clusterdomains.sme.sap.com/v1alpha2": "ClusterDomain", "servicemonitors.monitoring.coreos.com/v1": "ServiceMonitor", } @@ -160,17 +160,17 @@ var removeStatusTimestampHandler k8stesting.ReactionFunc = func(action k8stestin } switch cro := obj.(type) { - case *v1alpha1.CAPApplication: + case *v1alpha2.CAPApplication: cro.Status.Conditions = adjustConditions(cro.Status.Conditions) - case *v1alpha1.CAPApplicationVersion: + case *v1alpha2.CAPApplicationVersion: cro.Status.Conditions = adjustConditions(cro.Status.Conditions) - case *v1alpha1.CAPTenant: + case *v1alpha2.CAPTenant: cro.Status.Conditions = adjustConditions(cro.Status.Conditions) - case *v1alpha1.CAPTenantOperation: + case *v1alpha2.CAPTenantOperation: cro.Status.Conditions = adjustConditions(cro.Status.Conditions) - case *v1alpha1.Domain: + case *v1alpha2.Domain: cro.Status.Conditions = adjustConditions(cro.Status.Conditions) - case *v1alpha1.ClusterDomain: + case *v1alpha2.ClusterDomain: cro.Status.Conditions = adjustConditions(cro.Status.Conditions) } } @@ -576,25 +576,25 @@ func addInitialObjectToStore(resource []byte, c *Controller) error { fakeClient.Tracker().Create(schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1", Resource: "destinationrules"}, obj, metaObj.GetNamespace()) err = c.istioInformerFactory.Networking().V1().DestinationRules().Informer().GetIndexer().Add(obj) } - case *v1alpha1.CAPApplication, *v1alpha1.CAPApplicationVersion, *v1alpha1.CAPTenant, *v1alpha1.CAPTenantOperation, *v1alpha1.Domain, *v1alpha1.ClusterDomain: + case *v1alpha2.CAPApplication, *v1alpha2.CAPApplicationVersion, *v1alpha2.CAPTenant, *v1alpha2.CAPTenantOperation, *v1alpha2.Domain, *v1alpha2.ClusterDomain: fakeClient, ok := c.crdClient.(*copfake.Clientset) if !ok { return fmt.Errorf("controller is not using a fake clientset") } fakeClient.Tracker().Add(obj) switch obj.(type) { - case *v1alpha1.CAPApplication: - err = c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Informer().GetIndexer().Add(obj) - case *v1alpha1.CAPApplicationVersion: - err = c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Informer().GetIndexer().Add(obj) - case *v1alpha1.CAPTenant: - err = c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Informer().GetIndexer().Add(obj) - case *v1alpha1.CAPTenantOperation: - err = c.crdInformerFactory.Sme().V1alpha1().CAPTenantOperations().Informer().GetIndexer().Add(obj) - case *v1alpha1.Domain: - err = c.crdInformerFactory.Sme().V1alpha1().Domains().Informer().GetIndexer().Add(obj) - case *v1alpha1.ClusterDomain: - err = c.crdInformerFactory.Sme().V1alpha1().ClusterDomains().Informer().GetIndexer().Add(obj) + case *v1alpha2.CAPApplication: + err = c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Informer().GetIndexer().Add(obj) + case *v1alpha2.CAPApplicationVersion: + err = c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Informer().GetIndexer().Add(obj) + case *v1alpha2.CAPTenant: + err = c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Informer().GetIndexer().Add(obj) + case *v1alpha2.CAPTenantOperation: + err = c.crdInformerFactory.Sme().V1alpha2().CAPTenantOperations().Informer().GetIndexer().Add(obj) + case *v1alpha2.Domain: + err = c.crdInformerFactory.Sme().V1alpha2().Domains().Informer().GetIndexer().Add(obj) + case *v1alpha2.ClusterDomain: + err = c.crdInformerFactory.Sme().V1alpha2().ClusterDomains().Informer().GetIndexer().Add(obj) } case *monv1.ServiceMonitor: fakeClient, ok := c.promClient.(*promopFake.Clientset) @@ -649,20 +649,20 @@ func compareExpectedWithStore(t *testing.T, resource []byte, c *Controller) erro case *istionwv1.Gateway: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("gateways"), mo.GetNamespace(), mo.GetName()) } - case *v1alpha1.CAPApplication, *v1alpha1.CAPApplicationVersion, *v1alpha1.CAPTenant, *v1alpha1.CAPTenantOperation, *v1alpha1.Domain, *v1alpha1.ClusterDomain: + case *v1alpha2.CAPApplication, *v1alpha2.CAPApplicationVersion, *v1alpha2.CAPTenant, *v1alpha2.CAPTenantOperation, *v1alpha2.Domain, *v1alpha2.ClusterDomain: fakeClient := c.crdClient.(*copfake.Clientset) switch expected.(type) { - case *v1alpha1.CAPApplication: + case *v1alpha2.CAPApplication: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("capapplications"), mo.GetNamespace(), mo.GetName()) - case *v1alpha1.CAPApplicationVersion: + case *v1alpha2.CAPApplicationVersion: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("capapplicationversions"), mo.GetNamespace(), mo.GetName()) - case *v1alpha1.CAPTenant: + case *v1alpha2.CAPTenant: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("captenants"), mo.GetNamespace(), mo.GetName()) - case *v1alpha1.CAPTenantOperation: + case *v1alpha2.CAPTenantOperation: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("captenantoperations"), mo.GetNamespace(), mo.GetName()) - case *v1alpha1.Domain: + case *v1alpha2.Domain: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("domains"), mo.GetNamespace(), mo.GetName()) - case *v1alpha1.ClusterDomain: + case *v1alpha2.ClusterDomain: actual, err = fakeClient.Tracker().Get(gvk.GroupVersion().WithResource("clusterdomains"), metav1.NamespaceAll, mo.GetName()) } case *monv1.ServiceMonitor: diff --git a/internal/controller/controller.go b/internal/controller/controller.go index 07842168..ab08da5f 100644 --- a/internal/controller/controller.go +++ b/internal/controller/controller.go @@ -21,7 +21,7 @@ import ( gardenerDNS "github.com/gardener/external-dns-management/pkg/client/dns/clientset/versioned" gardenerDNSInformers "github.com/gardener/external-dns-management/pkg/client/dns/informers/externalversions" "github.com/sap/cap-operator/pkg/client/clientset/versioned" - v1alpha1scheme "github.com/sap/cap-operator/pkg/client/clientset/versioned/scheme" + v1alpha2scheme "github.com/sap/cap-operator/pkg/client/clientset/versioned/scheme" crdInformers "github.com/sap/cap-operator/pkg/client/informers/externalversions" "golang.org/x/time/rate" istio "istio.io/client-go/pkg/clientset/versioned" @@ -115,7 +115,7 @@ func NewController(client kubernetes.Interface, crdClient versioned.Interface, i // initialize event recorder scheme := runtime.NewScheme() kubescheme.AddToScheme(scheme) - v1alpha1scheme.AddToScheme(scheme) + v1alpha2scheme.AddToScheme(scheme) istioscheme.AddToScheme(scheme) eventBroadcaster := events.NewBroadcaster(&events.EventSinkImpl{Interface: client.EventsV1()}) eventBroadcaster.StartLogging(klog.Background()) diff --git a/internal/controller/controller_test.go b/internal/controller/controller_test.go index 5e0908fb..21c6975b 100644 --- a/internal/controller/controller_test.go +++ b/internal/controller/controller_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/informers" @@ -219,8 +219,8 @@ func TestController_processQueueItem(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var ( - ca *v1alpha1.CAPApplication - cat *v1alpha1.CAPTenant + ca *v1alpha2.CAPApplication + cat *v1alpha2.CAPTenant ) if tt.createCA { ca = createCaCRO(tt.resourceName, true) @@ -232,7 +232,7 @@ func TestController_processQueueItem(t *testing.T) { // Deregister metrics defer deregisterMetrics() - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca}, cats: []*v1alpha1.CAPTenant{cat}, preventStart: true}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca}, cats: []*v1alpha2.CAPTenant{cat}, preventStart: true}) if tt.resource == 9 || tt.resource == 99 { c.queues[tt.resource] = workqueue.NewTypedRateLimitingQueueWithConfig(workqueue.DefaultTypedControllerRateLimiter[QueueItem](), workqueue.TypedRateLimitingQueueConfig[QueueItem]{}) } @@ -355,30 +355,30 @@ func TestController_recoverFromPanic(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { var ( - ca *v1alpha1.CAPApplication - cav *v1alpha1.CAPApplicationVersion - cat *v1alpha1.CAPTenant - ctop *v1alpha1.CAPTenantOperation + ca *v1alpha2.CAPApplication + cav *v1alpha2.CAPApplicationVersion + cat *v1alpha2.CAPTenant + ctop *v1alpha2.CAPTenantOperation ) ca = createCaCRO(tt.resourceName, true) cav = createCavCRO(tt.resourceName, "", "0.0.1") cat = createCatCRO(resourceName, catType, true) if tt.catUpgrading { - cat.Status.State = v1alpha1.CAPTenantStateUpgrading + cat.Status.State = v1alpha2.CAPTenantStateUpgrading } else { - cat.Status.State = v1alpha1.CAPTenantStateProvisioning + cat.Status.State = v1alpha2.CAPTenantStateProvisioning } - ctop = &v1alpha1.CAPTenantOperation{ + ctop = &v1alpha2.CAPTenantOperation{ ObjectMeta: metav1.ObjectMeta{Name: tt.resourceName, Namespace: tt.resourceNamespace}, - Spec: v1alpha1.CAPTenantOperationSpec{}, - Status: v1alpha1.CAPTenantOperationStatus{ - GenericStatus: v1alpha1.GenericStatus{}, + Spec: v1alpha2.CAPTenantOperationSpec{}, + Status: v1alpha2.CAPTenantOperationStatus{ + GenericStatus: v1alpha2.GenericStatus{}, State: "", }, } - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca}, cavs: []*v1alpha1.CAPApplicationVersion{cav}, cats: []*v1alpha1.CAPTenant{cat}, ctops: []*v1alpha1.CAPTenantOperation{ctop}, preventStart: true}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca}, cavs: []*v1alpha2.CAPApplicationVersion{cav}, cats: []*v1alpha2.CAPTenant{cat}, ctops: []*v1alpha2.CAPTenantOperation{ctop}, preventStart: true}) dummyKubeInformerFactory := &dummyInformerFactoryType{c.kubeInformerFactory, tt.resourceNamespace, nil} testC := &Controller{ diff --git a/internal/controller/dns-manager.go b/internal/controller/dns-manager.go index 1a158f28..66de9ed3 100644 --- a/internal/controller/dns-manager.go +++ b/internal/controller/dns-manager.go @@ -14,7 +14,7 @@ import ( dnsv1alpha1 "github.com/gardener/external-dns-management/pkg/apis/dns/v1alpha1" sprig "github.com/go-task/slim-sprig/v3" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -40,7 +40,7 @@ type dnsInfo struct { appId string } -func handleDnsEntries[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, ownerId, subResourceName string, subResourceNamespace string) (err error) { +func handleDnsEntries[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, ownerId, subResourceName string, subResourceNamespace string) (err error) { if dnsManager() != dnsManagerGardener { // skip dns entry handling if not using gardener dns manager return nil @@ -101,7 +101,7 @@ func handleDnsEntries[T v1alpha1.DomainEntity](ctx context.Context, c *Controlle }, // Finalizers: []string{FinalizerDomain}, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(metav1.Object(dom), v1alpha1.SchemeGroupVersion.WithKind(dom.GetKind())), + *metav1.NewControllerRef(metav1.Object(dom), v1alpha2.SchemeGroupVersion.WithKind(dom.GetKind())), }, }, Spec: getDnsEntrySpec(info), @@ -155,7 +155,7 @@ func getDnsEntrySpec(info *dnsInfo) dnsv1alpha1.DNSEntrySpec { } } -func getDnsInfo[T v1alpha1.DomainEntity](c *Controller, dom T) (resolvedDNSInfo []*dnsInfo, err error) { +func getDnsInfo[T v1alpha2.DomainEntity](c *Controller, dom T) (resolvedDNSInfo []*dnsInfo, err error) { dnsTemplates, subdomainInfo, err := getDNSDetails(dom, c) if err != nil { return nil, err @@ -200,21 +200,21 @@ func getDnsInfo[T v1alpha1.DomainEntity](c *Controller, dom T) (resolvedDNSInfo return resolvedDNSInfo, err } -func getDNSDetails[T v1alpha1.DomainEntity](dom T, c *Controller) (dnsTemplates []v1alpha1.DNSTemplate, subdomainInfo map[string]string, err error) { - dnsTemplates = []v1alpha1.DNSTemplate{} +func getDNSDetails[T v1alpha2.DomainEntity](dom T, c *Controller) (dnsTemplates []v1alpha2.DNSTemplate, subdomainInfo map[string]string, err error) { + dnsTemplates = []v1alpha2.DNSTemplate{} collectSubdomains := false switch dom.GetSpec().DNSMode { - case v1alpha1.DnsModeWildcard: - dnsTemplates = append(dnsTemplates, v1alpha1.DNSTemplate{Name: "*.{{.domain}}", Target: "{{.dnsTarget}}"}) - case v1alpha1.DnsModeSubdomain: - dnsTemplates = append(dnsTemplates, v1alpha1.DNSTemplate{Name: "{{.subDomain}}.{{.domain}}", Target: "{{.dnsTarget}}"}) + case v1alpha2.DnsModeWildcard: + dnsTemplates = append(dnsTemplates, v1alpha2.DNSTemplate{Name: "*.{{.domain}}", Target: "{{.dnsTarget}}"}) + case v1alpha2.DnsModeSubdomain: + dnsTemplates = append(dnsTemplates, v1alpha2.DNSTemplate{Name: "{{.subDomain}}.{{.domain}}", Target: "{{.dnsTarget}}"}) // If subdomain is used, we need to collect subdomains from applications collectSubdomains = true - case v1alpha1.DnsModeCustom: + case v1alpha2.DnsModeCustom: dnsTemplates = dom.GetSpec().DNSTemplates // If subdomain is used, we need to collect subdomains from applications - collectSubdomains = slices.ContainsFunc(dnsTemplates, func(t v1alpha1.DNSTemplate) bool { + collectSubdomains = slices.ContainsFunc(dnsTemplates, func(t v1alpha2.DNSTemplate) bool { return strings.Contains(t.Name, subDomainTemplateVar) }) default: // Default is None @@ -231,7 +231,7 @@ func getDNSDetails[T v1alpha1.DomainEntity](dom T, c *Controller) (dnsTemplates return dnsTemplates, subdomainInfo, nil } -func parseDNSTemplate(tpl *template.Template, dnsTemplate v1alpha1.DNSTemplate, domVars map[string]any) (*dnsInfo, error) { +func parseDNSTemplate(tpl *template.Template, dnsTemplate v1alpha2.DNSTemplate, domVars map[string]any) (*dnsInfo, error) { // Parse the DNS templates parseTemplate := func(templateString string, templateVars map[string]any) (string, error) { var tmpS strings.Builder @@ -261,7 +261,7 @@ func parseDNSTemplate(tpl *template.Template, dnsTemplate v1alpha1.DNSTemplate, return &dns, nil } -func collectAppSubdomainInfos[T v1alpha1.DomainEntity](c *Controller, dom T) (subdomains map[string]string, err error) { +func collectAppSubdomainInfos[T v1alpha2.DomainEntity](c *Controller, dom T) (subdomains map[string]string, err error) { cas, err := getReferencingApplications(c, dom) if err != nil { return nil, err diff --git a/internal/controller/informers.go b/internal/controller/informers.go index 9ec4d3bb..31eb4b61 100644 --- a/internal/controller/informers.go +++ b/internal/controller/informers.go @@ -9,7 +9,7 @@ import ( "reflect" "time" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -39,12 +39,12 @@ const defaultDependantDelay = 3 * time.Second var ( KindMap = map[int]string{ - ResourceCAPApplication: v1alpha1.CAPApplicationKind, - ResourceCAPApplicationVersion: v1alpha1.CAPApplicationVersionKind, - ResourceCAPTenant: v1alpha1.CAPTenantKind, - ResourceCAPTenantOperation: v1alpha1.CAPTenantOperationKind, - ResourceDomain: v1alpha1.DomainKind, - ResourceClusterDomain: v1alpha1.ClusterDomainKind, + ResourceCAPApplication: v1alpha2.CAPApplicationKind, + ResourceCAPApplicationVersion: v1alpha2.CAPApplicationVersionKind, + ResourceCAPTenant: v1alpha2.CAPTenantKind, + ResourceCAPTenantOperation: v1alpha2.CAPTenantOperationKind, + ResourceDomain: v1alpha2.DomainKind, + ResourceClusterDomain: v1alpha2.ClusterDomainKind, } ) @@ -54,18 +54,18 @@ type NamespacedResourceKey struct { } var QueueMapping map[int]map[int]string = map[int]map[int]string{ - ResourceCAPApplication: {ResourceCAPApplication: v1alpha1.CAPApplicationKind}, - ResourceCAPApplicationVersion: {ResourceCAPApplicationVersion: v1alpha1.CAPApplicationVersionKind, ResourceCAPApplication: v1alpha1.CAPApplicationKind}, - ResourceCAPTenant: {ResourceCAPTenant: v1alpha1.CAPTenantKind, ResourceCAPApplication: v1alpha1.CAPApplicationKind}, - ResourceCAPTenantOperation: {ResourceCAPTenantOperation: v1alpha1.CAPTenantOperationKind, ResourceCAPTenant: v1alpha1.CAPTenantKind}, - ResourceDomain: {ResourceDomain: v1alpha1.DomainKind}, - ResourceClusterDomain: {ResourceClusterDomain: v1alpha1.ClusterDomainKind}, - ResourceJob: {ResourceCAPTenantOperation: v1alpha1.CAPTenantOperationKind, ResourceCAPApplicationVersion: v1alpha1.CAPApplicationVersionKind}, - ResourceGateway: {ResourceDomain: v1alpha1.DomainKind, ResourceClusterDomain: v1alpha1.ClusterDomainKind}, - ResourceCertificate: {ResourceDomain: v1alpha1.DomainKind, ResourceClusterDomain: v1alpha1.ClusterDomainKind}, - ResourceDNSEntry: {ResourceDomain: v1alpha1.DomainKind, ResourceClusterDomain: v1alpha1.ClusterDomainKind}, - ResourceVirtualService: {ResourceCAPTenant: v1alpha1.CAPTenantKind}, - ResourceDestinationRule: {ResourceCAPApplicationVersion: v1alpha1.CAPApplicationVersionKind}, + ResourceCAPApplication: {ResourceCAPApplication: v1alpha2.CAPApplicationKind}, + ResourceCAPApplicationVersion: {ResourceCAPApplicationVersion: v1alpha2.CAPApplicationVersionKind, ResourceCAPApplication: v1alpha2.CAPApplicationKind}, + ResourceCAPTenant: {ResourceCAPTenant: v1alpha2.CAPTenantKind, ResourceCAPApplication: v1alpha2.CAPApplicationKind}, + ResourceCAPTenantOperation: {ResourceCAPTenantOperation: v1alpha2.CAPTenantOperationKind, ResourceCAPTenant: v1alpha2.CAPTenantKind}, + ResourceDomain: {ResourceDomain: v1alpha2.DomainKind}, + ResourceClusterDomain: {ResourceClusterDomain: v1alpha2.ClusterDomainKind}, + ResourceJob: {ResourceCAPTenantOperation: v1alpha2.CAPTenantOperationKind, ResourceCAPApplicationVersion: v1alpha2.CAPApplicationVersionKind}, + ResourceGateway: {ResourceDomain: v1alpha2.DomainKind, ResourceClusterDomain: v1alpha2.ClusterDomainKind}, + ResourceCertificate: {ResourceDomain: v1alpha2.DomainKind, ResourceClusterDomain: v1alpha2.ClusterDomainKind}, + ResourceDNSEntry: {ResourceDomain: v1alpha2.DomainKind, ResourceClusterDomain: v1alpha2.ClusterDomainKind}, + ResourceVirtualService: {ResourceCAPTenant: v1alpha2.CAPTenantKind}, + ResourceDestinationRule: {ResourceCAPApplicationVersion: v1alpha2.CAPApplicationVersionKind}, } type QueueItem struct { @@ -119,32 +119,32 @@ func (c *Controller) getEventHandlerFuncsForResource(res int) cache.ResourceEven } func (c *Controller) registerCAPApplicationListeners() { - c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Informer(). + c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Informer(). AddEventHandler(c.getEventHandlerFuncsForResource(ResourceCAPApplication)) } func (c *Controller) registerCAPApplicationVersionListeners() { - c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Informer(). + c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Informer(). AddEventHandler(c.getEventHandlerFuncsForResource(ResourceCAPApplicationVersion)) } func (c *Controller) registerCAPTenantListeners() { - c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Informer(). + c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Informer(). AddEventHandler(c.getEventHandlerFuncsForResource(ResourceCAPTenant)) } func (c *Controller) registerCAPTenantOperationListeners() { - c.crdInformerFactory.Sme().V1alpha1().CAPTenantOperations().Informer(). + c.crdInformerFactory.Sme().V1alpha2().CAPTenantOperations().Informer(). AddEventHandler(c.getEventHandlerFuncsForResource(ResourceCAPTenantOperation)) } func (c *Controller) registerClusterDomainListeners() { - c.crdInformerFactory.Sme().V1alpha1().ClusterDomains().Informer(). + c.crdInformerFactory.Sme().V1alpha2().ClusterDomains().Informer(). AddEventHandler(c.getEventHandlerFuncsForResource(ResourceClusterDomain)) } func (c *Controller) registerDomainListeners() { - c.crdInformerFactory.Sme().V1alpha1().Domains().Informer(). + c.crdInformerFactory.Sme().V1alpha2().Domains().Informer(). AddEventHandler(c.getEventHandlerFuncsForResource(ResourceDomain)) } @@ -197,7 +197,7 @@ func (c *Controller) getSecretEventHandlerFuncs() cache.ResourceEventHandlerFunc return // no relevant changes } secretNS := new.GetNamespace() - cas, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().CAPApplications(secretNS).List(labels.Everything()) + cas, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().CAPApplications(secretNS).List(labels.Everything()) if err != nil { klog.ErrorS(err, "error retrieving applications", "informers", "rollout-manager") } @@ -261,7 +261,7 @@ func determineQueueItem(dependentKey int, sourceKey int, oldObj metav1.Object, n if newObj == nil { obj = oldObj } - if owner, ok := getOwnerByKind(obj.GetOwnerReferences(), dependentKind); ok { + if owner, ok := getOwnerByKind(obj.GetOwnerReferences(), dependentKind, v1alpha2.Group); ok { klog.InfoS(queuing, "namespace", obj.GetNamespace(), "name", owner.Name, "kind", dependentKind) return &QueueItem{Key: dependentKey, ResourceKey: NamespacedResourceKey{Name: owner.Name, Namespace: obj.GetNamespace()}} } else if owner, ok := getOwnerFromObjectMetadata(obj, dependentKind); ok { diff --git a/internal/controller/informers_test.go b/internal/controller/informers_test.go index b6a43621..4a6ef032 100644 --- a/internal/controller/informers_test.go +++ b/internal/controller/informers_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/workqueue" @@ -17,7 +17,7 @@ import ( // secretHandlerFixture builds a controller with the given CAPApplications pre-loaded // and attaches a real rolloutManager so the handler can enqueue into it. -func secretHandlerFixture(cas []*v1alpha1.CAPApplication) *Controller { +func secretHandlerFixture(cas []*v1alpha2.CAPApplication) *Controller { c := getTestController(testResources{cas: cas}) c.rolloutManager = newRolloutManager(c) return c @@ -144,8 +144,8 @@ func TestController_initializeInformers(t *testing.T) { res = createCaCRO(tt.itemName, false) case ResourceCAPApplicationVersion: ca := createCaCRO(tt.itemName, false) - cav := createCavCRO(tt.itemName, v1alpha1.CAPApplicationVersionStateReady, defaultVersion) - cav.ObjectMeta.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(ca, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationKind))} + cav := createCavCRO(tt.itemName, v1alpha2.CAPApplicationVersionStateReady, defaultVersion) + cav.ObjectMeta.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(ca, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationKind))} res = cav case ResourceCertificate: // set label on a pod to simulate certificate in a different namespace @@ -191,7 +191,7 @@ func TestController_initializeInformers(t *testing.T) { func TestSecretHandler_SameResourceVersion(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - c := secretHandlerFixture([]*v1alpha1.CAPApplication{ca}) + c := secretHandlerFixture([]*v1alpha2.CAPApplication{ca}) handler := c.getSecretEventHandlerFuncs() old := secretV("cap-cap-01-uaa-bind-cf", metav1.NamespaceDefault, "1") @@ -240,7 +240,7 @@ func TestSecretHandler_NoCAPApplicationsInNamespace(t *testing.T) { func TestSecretHandler_AllCAsRolloutDisabled(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", false /* disabled */, btpServices()) - c := secretHandlerFixture([]*v1alpha1.CAPApplication{ca}) + c := secretHandlerFixture([]*v1alpha2.CAPApplication{ca}) handler := c.getSecretEventHandlerFuncs() old := secretV("cap-cap-01-uaa-bind-cf", metav1.NamespaceDefault, "1") @@ -259,7 +259,7 @@ func TestSecretHandler_AllCAsRolloutDisabled(t *testing.T) { func TestSecretHandler_OneCAWithRolloutEnabled(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - c := secretHandlerFixture([]*v1alpha1.CAPApplication{ca}) + c := secretHandlerFixture([]*v1alpha2.CAPApplication{ca}) handler := c.getSecretEventHandlerFuncs() old := secretV("cap-cap-01-uaa-bind-cf", metav1.NamespaceDefault, "1") @@ -283,7 +283,7 @@ func TestSecretHandler_EnqueuesOnceWithMixedCAs(t *testing.T) { defer deregisterMetrics() caDisabled := buildCA("test-cap-disabled", false, btpServices()) caEnabled := buildCA("test-cap-enabled", true, btpServices()) - c := secretHandlerFixture([]*v1alpha1.CAPApplication{caDisabled, caEnabled}) + c := secretHandlerFixture([]*v1alpha2.CAPApplication{caDisabled, caEnabled}) handler := c.getSecretEventHandlerFuncs() old := secretV("cap-cap-01-uaa-bind-cf", metav1.NamespaceDefault, "1") @@ -322,7 +322,7 @@ func TestSecretHandler_OnlyUpdateFuncWired(t *testing.T) { func TestSecretHandler_MultipleDistinctSecrets(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - c := secretHandlerFixture([]*v1alpha1.CAPApplication{ca}) + c := secretHandlerFixture([]*v1alpha2.CAPApplication{ca}) handler := c.getSecretEventHandlerFuncs() for i, name := range []string{"secret-a", "secret-b", "secret-c"} { diff --git a/internal/controller/reconcile-capapplication.go b/internal/controller/reconcile-capapplication.go index 784bb7e6..5e6cec9f 100644 --- a/internal/controller/reconcile-capapplication.go +++ b/internal/controller/reconcile-capapplication.go @@ -15,7 +15,7 @@ import ( "time" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" corev1 "k8s.io/api/core/v1" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -38,7 +38,7 @@ const ( ) func (c *Controller) reconcileCAPApplication(ctx context.Context, item QueueItem, _ int) (result *ReconcileResult, err error) { - cached, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().CAPApplications(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) + cached, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().CAPApplications(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) if err != nil { return nil, handleOperatorResourceErrors(err) } @@ -46,7 +46,7 @@ func (c *Controller) reconcileCAPApplication(ctx context.Context, item QueueItem // Set Error state and return when there is no ProviderSubaccountId if ca.Spec.ProviderSubaccountId == "" { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "MissingProviderSubaccountId", "set providerSubaccountId and restart CAP Operator controller to be able to use this app") + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "MissingProviderSubaccountId", "set providerSubaccountId and restart CAP Operator controller to be able to use this app") c.updateCAPApplicationStatus(ctx, ca) return } @@ -77,7 +77,7 @@ func (c *Controller) reconcileCAPApplication(ctx context.Context, item QueueItem if genChanged := (ca.Status.State == "Consistent" && ca.Status.ObservedGeneration != ca.Generation); ca.Status.State == "" || genChanged { reason, message := getCAReason(genChanged) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateProcessing, metav1.ConditionFalse, reason, message) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateProcessing, metav1.ConditionFalse, reason, message) result = NewReconcileResultWithResource(ResourceCAPApplication, ca.Name, ca.Namespace, 0) } else { result, err = c.handleCAPApplicationDependentResources(ctx, ca) @@ -87,7 +87,7 @@ func (c *Controller) reconcileCAPApplication(ctx context.Context, item QueueItem return } -func (c *Controller) handleCAPApplicationDependentResources(ctx context.Context, ca *v1alpha1.CAPApplication) (requeue *ReconcileResult, err error) { +func (c *Controller) handleCAPApplicationDependentResources(ctx context.Context, ca *v1alpha2.CAPApplication) (requeue *ReconcileResult, err error) { var processing bool defer func() { if processing { @@ -118,15 +118,15 @@ func (c *Controller) handleCAPApplicationDependentResources(ctx context.Context, } if cav == nil { processing = true - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateProcessing, metav1.ConditionFalse, "WaitingForReadyCAPApplicationVersion", "") + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateProcessing, metav1.ConditionFalse, "WaitingForReadyCAPApplicationVersion", "") // Update additional condition `LatestVersionReady` to False - ca.SetStatusCondition(string(v1alpha1.ConditionTypeLatestVersionReady), metav1.ConditionFalse, "WaitingForReadyCAPApplicationVersion", "") + ca.SetStatusCondition(string(v1alpha2.ConditionTypeLatestVersionReady), metav1.ConditionFalse, "WaitingForReadyCAPApplicationVersion", "") return } // Check if this is a services only scenario and update the Status accordingly if err = c.checkServicesOnly(ca, cav); err != nil { // Update additional condition `LatestVersionReady` to False with error from checkServicesOnly - ca.SetStatusCondition(string(v1alpha1.ConditionTypeLatestVersionReady), metav1.ConditionFalse, "WaitingForReadyCAPApplicationVersion", err.Error()) + ca.SetStatusCondition(string(v1alpha2.ConditionTypeLatestVersionReady), metav1.ConditionFalse, "WaitingForReadyCAPApplicationVersion", err.Error()) return } // We can already update LatestVersionReady to "true" at this point in time, but as this method is called several times, we do not do it here (during initial Provisioning as CA itself is may not be Consistent) @@ -140,20 +140,20 @@ func (c *Controller) handleCAPApplicationDependentResources(ctx context.Context, return nil, c.reconcileServiceNetworking(ctx, ca, cav) } -func (c *Controller) verifyApplicationConsistent(ca *v1alpha1.CAPApplication) { - if ca.Status.State != v1alpha1.CAPApplicationStateConsistent { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateConsistent, metav1.ConditionTrue, "VersionExists", "") +func (c *Controller) verifyApplicationConsistent(ca *v1alpha2.CAPApplication) { + if ca.Status.State != v1alpha2.CAPApplicationStateConsistent { + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateConsistent, metav1.ConditionTrue, "VersionExists", "") // Update additional condition `LatestVersionReady` to True - ca.SetStatusCondition(string(v1alpha1.ConditionTypeLatestVersionReady), metav1.ConditionTrue, "VersionExists", "") + ca.SetStatusCondition(string(v1alpha2.ConditionTypeLatestVersionReady), metav1.ConditionTrue, "VersionExists", "") // No tenants for services only scenario if !ca.IsServicesOnly() { // Update additional condition `AllTenantsReady` to True - ca.SetStatusCondition(string(v1alpha1.ConditionTypeAllTenantsReady), metav1.ConditionTrue, string(v1alpha1.ConditionTypeAllTenantsReady), "") + ca.SetStatusCondition(string(v1alpha2.ConditionTypeAllTenantsReady), metav1.ConditionTrue, string(v1alpha2.ConditionTypeAllTenantsReady), "") } } } -func (c *Controller) checkNewCavAndTenantReconcile(ctx context.Context, ca *v1alpha1.CAPApplication, readyCav *v1alpha1.CAPApplicationVersion, latestCav *v1alpha1.CAPApplicationVersion) (*ReconcileResult, error) { +func (c *Controller) checkNewCavAndTenantReconcile(ctx context.Context, ca *v1alpha2.CAPApplication, readyCav *v1alpha2.CAPApplicationVersion, latestCav *v1alpha2.CAPApplicationVersion) (*ReconcileResult, error) { // No tenants for services only scenario if ca.IsServicesOnly() { return nil, nil @@ -161,12 +161,12 @@ func (c *Controller) checkNewCavAndTenantReconcile(ctx context.Context, ca *v1al // Reset ready Condition and Reason for Tenant check AllTenantsReady --> True readyCondition := metav1.ConditionTrue - readyReason := string(v1alpha1.ConditionTypeAllTenantsReady) + readyReason := string(v1alpha2.ConditionTypeAllTenantsReady) // Get all relevant tenants tenants, err := c.getRelevantTenantsForCA(ca) if err != nil || len(tenants) == 0 { - ca.SetStatusCondition(string(v1alpha1.ConditionTypeAllTenantsReady), readyCondition, readyReason, "") + ca.SetStatusCondition(string(v1alpha2.ConditionTypeAllTenantsReady), readyCondition, readyReason, "") return nil, err } checkDone := false @@ -182,34 +182,34 @@ func (c *Controller) checkNewCavAndTenantReconcile(ctx context.Context, ca *v1al updated = true } // When a Tenant state is not Ready -or- when version of tenant (with VersionUpgradeStrategy = always) does not match the latest CAV version --> AllTenantsReady = False - if !checkDone && (updated || (tenant.Status.State != v1alpha1.CAPTenantStateReady || (tenant.Spec.VersionUpgradeStrategy == v1alpha1.VersionUpgradeStrategyTypeAlways && latestCav.Spec.Version != tenant.Spec.Version))) { + if !checkDone && (updated || (tenant.Status.State != v1alpha2.CAPTenantStateReady || (tenant.Spec.VersionUpgradeStrategy == v1alpha2.VersionUpgradeStrategyTypeAlways && latestCav.Spec.Version != tenant.Spec.Version))) { readyCondition = metav1.ConditionFalse readyReason = "NotAllTenantsReady" checkDone = true } } // Update `AllTenantsReady` status condition - ca.SetStatusCondition(string(v1alpha1.ConditionTypeAllTenantsReady), readyCondition, readyReason, "") + ca.SetStatusCondition(string(v1alpha2.ConditionTypeAllTenantsReady), readyCondition, readyReason, "") if updated { msg := fmt.Sprintf("new version %s.%s was used to trigger tenant upgrades", readyCav.Namespace, readyCav.Name) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateProcessing, metav1.ConditionFalse, CAPApplicationEventNewCAVTriggeredTenantUpgrade, msg) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateProcessing, metav1.ConditionFalse, CAPApplicationEventNewCAVTriggeredTenantUpgrade, msg) c.Event(ca, nil, corev1.EventTypeNormal, CAPApplicationEventNewCAVTriggeredTenantUpgrade, EventActionCheckForVersion, msg) } return result, nil } -func (c *Controller) checkForTenantVersionUpgradeAndReconcile(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, tenant *v1alpha1.CAPTenant, result *ReconcileResult) (bool, error) { +func (c *Controller) checkForTenantVersionUpgradeAndReconcile(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, tenant *v1alpha2.CAPTenant, result *ReconcileResult) (bool, error) { // This is done to reconcile tenant networking which may be needed for session affinity if result != nil && tenant.Status.CurrentCAPApplicationVersionInstance != "" { result.AddResource(ResourceCAPTenant, tenant.Name, tenant.Namespace, 1) } - if tenant.Spec.VersionUpgradeStrategy == v1alpha1.VersionUpgradeStrategyTypeNever { + if tenant.Spec.VersionUpgradeStrategy == v1alpha2.VersionUpgradeStrategyTypeNever { // Skip non relevant tenants return false, nil } - if tenant.Status.State == v1alpha1.CAPTenantStateProvisioning || tenant.Status.State == v1alpha1.CAPTenantStateUpgrading || tenant.Status.State == v1alpha1.CAPTenantStateDeleting { + if tenant.Status.State == v1alpha2.CAPTenantStateProvisioning || tenant.Status.State == v1alpha2.CAPTenantStateUpgrading || tenant.Status.State == v1alpha2.CAPTenantStateDeleting { // Skip tenants that are not ready or not in processing or not in error return false, nil } @@ -222,8 +222,8 @@ func (c *Controller) checkForTenantVersionUpgradeAndReconcile(ctx context.Contex // update CAPTenant Spec to point to the latest version cat.Spec.Version = cav.Spec.Version // Trigger update on CAPTenant (modifies Generation) --> which would reconcile the tenant - if _, err := c.crdClient.SmeV1alpha1().CAPTenants(ca.Namespace).Update(ctx, cat, metav1.UpdateOptions{}); err != nil { - return false, fmt.Errorf("could not update %s %s.%s: %w", v1alpha1.CAPTenantKind, cat.Namespace, cat.Name, err) + if _, err := c.crdClient.SmeV1alpha2().CAPTenants(ca.Namespace).Update(ctx, cat, metav1.UpdateOptions{}); err != nil { + return false, fmt.Errorf("could not update %s %s.%s: %w", v1alpha2.CAPTenantKind, cat.Namespace, cat.Name, err) } c.Event(tenant, ca, corev1.EventTypeNormal, CAPTenantEventAutoVersionUpdate, EventActionUpgrade, fmt.Sprintf("version updated to %s for initiating tenant upgrade", cav.Spec.Version)) return true, nil @@ -231,7 +231,7 @@ func (c *Controller) checkForTenantVersionUpgradeAndReconcile(ctx context.Contex return false, nil } -func (c *Controller) checkAdditionalConditions(ctx context.Context, ca *v1alpha1.CAPApplication, result *ReconcileResult, err error) (*ReconcileResult, error) { +func (c *Controller) checkAdditionalConditions(ctx context.Context, ca *v1alpha2.CAPApplication, result *ReconcileResult, err error) (*ReconcileResult, error) { // In case of explicit Reconcile or errors return back with the original result if result != nil || err != nil { return result, err @@ -243,7 +243,7 @@ func (c *Controller) checkAdditionalConditions(ctx context.Context, ca *v1alpha1 // Check and update additional status conditions // Set ready Condition and Reason for Version check LatestVersionNotReady = True readyCondition := metav1.ConditionTrue - readyReason := string(v1alpha1.ConditionTypeLatestVersionReady) + readyReason := string(v1alpha2.ConditionTypeLatestVersionReady) // Get latest CAV (incl. ones that may not be ready) cav, err := c.getLatestCAPApplicationVersion(ca) @@ -252,7 +252,7 @@ func (c *Controller) checkAdditionalConditions(ctx context.Context, ca *v1alpha1 return nil, err } // When the latest CAV is not Ready --> LatestVersionNotReady = False - if cav.Status.State != v1alpha1.CAPApplicationVersionStateReady { + if cav.Status.State != v1alpha2.CAPApplicationVersionStateReady { readyCondition = metav1.ConditionFalse readyReason = "LatestVersionNotReady" // Get the latest Ready CAV for the tenant @@ -263,13 +263,13 @@ func (c *Controller) checkAdditionalConditions(ctx context.Context, ca *v1alpha1 } // Update `LatestVersionReady` status condition - ca.SetStatusCondition(string(v1alpha1.ConditionTypeLatestVersionReady), readyCondition, readyReason, "") + ca.SetStatusCondition(string(v1alpha2.ConditionTypeLatestVersionReady), readyCondition, readyReason, "") return c.checkNewCavAndTenantReconcile(ctx, ca, readyCav, cav) } -func (c *Controller) updateCAPApplication(ctx context.Context, ca *v1alpha1.CAPApplication) error { - caUpdated, err := c.crdClient.SmeV1alpha1().CAPApplications(ca.Namespace).Update(ctx, ca, metav1.UpdateOptions{}) +func (c *Controller) updateCAPApplication(ctx context.Context, ca *v1alpha2.CAPApplication) error { + caUpdated, err := c.crdClient.SmeV1alpha2().CAPApplications(ca.Namespace).Update(ctx, ca, metav1.UpdateOptions{}) // Update reference to the resource if caUpdated != nil { *ca = *caUpdated @@ -277,11 +277,11 @@ func (c *Controller) updateCAPApplication(ctx context.Context, ca *v1alpha1.CAPA return err } -func (c *Controller) updateCAPApplicationStatus(ctx context.Context, ca *v1alpha1.CAPApplication) error { +func (c *Controller) updateCAPApplicationStatus(ctx context.Context, ca *v1alpha2.CAPApplication) error { if isDeletionImminent(&ca.ObjectMeta) { return nil } - caUpdated, err := c.crdClient.SmeV1alpha1().CAPApplications(ca.Namespace).UpdateStatus(ctx, ca, metav1.UpdateOptions{}) + caUpdated, err := c.crdClient.SmeV1alpha2().CAPApplications(ca.Namespace).UpdateStatus(ctx, ca, metav1.UpdateOptions{}) // update reference to the resource if caUpdated != nil { *ca = *caUpdated @@ -289,7 +289,7 @@ func (c *Controller) updateCAPApplicationStatus(ctx context.Context, ca *v1alpha return err } -func (c *Controller) observeCAPApplicationSubdomains(ca *v1alpha1.CAPApplication, result *ReconcileResult) (*ReconcileResult, error) { +func (c *Controller) observeCAPApplicationSubdomains(ca *v1alpha2.CAPApplication, result *ReconcileResult) (*ReconcileResult, error) { mapSubDomains := map[string]struct{}{} // Get all versions and tenants @@ -322,7 +322,7 @@ func (c *Controller) observeCAPApplicationSubdomains(ca *v1alpha1.CAPApplication return result, nil } -func (c *Controller) getCachedApplicationResources(ca *v1alpha1.CAPApplication) (versions []*v1alpha1.CAPApplicationVersion, tenants []*v1alpha1.CAPTenant, err error) { +func (c *Controller) getCachedApplicationResources(ca *v1alpha2.CAPApplication) (versions []*v1alpha2.CAPApplicationVersion, tenants []*v1alpha2.CAPTenant, err error) { versions, err = c.getCachedCAPApplicationVersions(ca) if err != nil { return nil, nil, err @@ -334,29 +334,29 @@ func (c *Controller) getCachedApplicationResources(ca *v1alpha1.CAPApplication) return versions, tenants, nil } -func addDomainReferencesToReconcileResult(refs []v1alpha1.DomainRef, result *ReconcileResult, namespace string) { +func addDomainReferencesToReconcileResult(refs []v1alpha2.DomainRef, result *ReconcileResult, namespace string) { for _, ref := range refs { switch ref.Kind { - case v1alpha1.DomainKind: + case v1alpha2.DomainKind: result.AddResource(ResourceDomain, ref.Name, namespace, 0) - case v1alpha1.ClusterDomainKind: + case v1alpha2.ClusterDomainKind: result.AddResource(ResourceClusterDomain, ref.Name, corev1.NamespaceAll, 0) } } } -func (c *Controller) validateSecrets(ca *v1alpha1.CAPApplication) (bool, error) { +func (c *Controller) validateSecrets(ca *v1alpha2.CAPApplication) (bool, error) { err := c.checkSecretsExist(ca.Spec.BTP.Services, ca.Namespace) if err == nil { return false, nil } else if !k8sErrors.IsNotFound(err) { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProcessingSecretsError", err.Error()) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProcessingSecretsError", err.Error()) return false, err } // waiting for secrets - message := fmt.Sprintf("waiting for secrets to get ready for %s %s.%s; %s", v1alpha1.CAPApplicationKind, ca.Name, ca.Namespace, err.Error()) + message := fmt.Sprintf("waiting for secrets to get ready for %s %s.%s; %s", v1alpha2.CAPApplicationKind, ca.Name, ca.Namespace, err.Error()) util.LogInfo(message, string(Processing), ca, nil) c.Event(ca, nil, corev1.EventTypeWarning, CAPApplicationEventMissingSecrets, EventActionProcessingSecrets, message) @@ -364,10 +364,10 @@ func (c *Controller) validateSecrets(ca *v1alpha1.CAPApplication) (bool, error) return true, nil } -func (c *Controller) getRelevantTenantsForCA(ca *v1alpha1.CAPApplication) ([]*v1alpha1.CAPTenant, error) { +func (c *Controller) getRelevantTenantsForCA(ca *v1alpha2.CAPApplication) ([]*v1alpha2.CAPTenant, error) { // No tenants for services only scenario if ca.IsServicesOnly() { - return []*v1alpha1.CAPTenant{}, nil + return []*v1alpha2.CAPTenant{}, nil } tenantLabels := map[string]string{} tenantLabels[LabelAppIdHash] = sha1Sum(ca.Spec.ProviderSubaccountId, ca.Spec.BTPAppName) @@ -376,20 +376,20 @@ func (c *Controller) getRelevantTenantsForCA(ca *v1alpha1.CAPApplication) ([]*v1 if err != nil { return nil, err } - return c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister().CAPTenants(ca.Namespace).List(tenantsSelector) + return c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister().CAPTenants(ca.Namespace).List(tenantsSelector) } -func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) (bool, error) { +func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) (bool, error) { // No tenants for services only scenario or if Provider is explicitly set to empty if ca.IsServicesOnly() || ca.IsProviderEmpty() { return false, nil } providerTenantName := strings.Join([]string{ca.Name, TenantTypeProvider}, "-") - tenant, err := c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister().CAPTenants(ca.Namespace).Get(providerTenantName) + tenant, err := c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister().CAPTenants(ca.Namespace).Get(providerTenantName) if err != nil { if !k8sErrors.IsNotFound(err) { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) return false, err } @@ -399,39 +399,34 @@ func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, } if !isCROConditionReady(tenant.Status.GenericStatus) { // Upgrade errors also handled - if tenant.Status.State == v1alpha1.CAPTenantStateProvisioningError || tenant.Status.State == v1alpha1.CAPTenantStateUpgradeError { - err = fmt.Errorf("provider %s in state %s for %s %s.%s", v1alpha1.CAPTenantKind, tenant.Status.State, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) + if tenant.Status.State == v1alpha2.CAPTenantStateProvisioningError || tenant.Status.State == v1alpha2.CAPTenantStateUpgradeError { + err = fmt.Errorf("provider %s in state %s for %s %s.%s", v1alpha2.CAPTenantKind, tenant.Status.State, v1alpha2.CAPApplicationKind, ca.Namespace, ca.Name) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) return false, err } - msg := fmt.Sprintf("provider %v not ready for %v %v.%v; waiting for it to be ready", v1alpha1.CAPTenantKind, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name) + msg := fmt.Sprintf("provider %v not ready for %v %v.%v; waiting for it to be ready", v1alpha2.CAPTenantKind, v1alpha2.CAPApplicationKind, ca.Namespace, ca.Name) util.LogInfo("Waiting for provider tenant to be ready", string(Processing), ca, tenant, "tenantId", ca.Spec.Provider.TenantId) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateProcessing, metav1.ConditionFalse, EventActionProviderTenantProcessing, msg) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateProcessing, metav1.ConditionFalse, EventActionProviderTenantProcessing, msg) return true, nil } return false, nil } -func (c *Controller) createProviderTenant(ctx context.Context, ca *v1alpha1.CAPApplication, version string, providerTenantName string) (tenant *v1alpha1.CAPTenant, err error) { +func (c *Controller) createProviderTenant(ctx context.Context, ca *v1alpha2.CAPApplication, version string, providerTenantName string) (tenant *v1alpha2.CAPTenant, err error) { providerSubaccountId := ca.Spec.ProviderSubaccountId tenantLabels := map[string]string{ LabelTenantId: ca.Spec.Provider.TenantId, } - globalAccountGUID := ca.Spec.GlobalAccountId - if globalAccountGUID == "" { - globalAccountGUID = ca.Annotations[AnnotationGlobalAccountId] - } + globalAccountGUID := ca.Annotations[AnnotationGlobalAccountId] // Create a secret with the provider subscription context (dervied from the spec of CAPApplication) secret, err := c.kubeClient.CoreV1().Secrets(ca.Namespace).Create(context.TODO(), &corev1.Secret{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: providerTenantName + "-", - Namespace: ca.Namespace, - Labels: tenantLabels, - }, + GenerateName: providerTenantName + "-", + Namespace: ca.Namespace, + Labels: tenantLabels, StringData: map[string]string{ SubscriptionContext: `{ "subscriptionAppName": "` + ca.Spec.BTPAppName + `", @@ -444,7 +439,7 @@ func (c *Controller) createProviderTenant(ctx context.Context, ca *v1alpha1.CAPA }, metav1.CreateOptions{}) if err != nil { util.LogError(err, "Error creating tenant subscription context secret", string(Processing), ca, nil, "tenantId", ca.Spec.Provider.TenantId) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) return } @@ -460,34 +455,32 @@ func (c *Controller) createProviderTenant(ctx context.Context, ca *v1alpha1.CAPA labels[LabelAppIdHash] = sha1Sum(ca.Spec.ProviderSubaccountId, ca.Spec.BTPAppName) - if tenant, err = c.crdClient.SmeV1alpha1().CAPTenants(ca.Namespace).Create( - ctx, &v1alpha1.CAPTenant{ - ObjectMeta: metav1.ObjectMeta{ - Name: providerTenantName, - Namespace: ca.Namespace, - Annotations: annotations, - Labels: labels, - }, - Spec: v1alpha1.CAPTenantSpec{ + if tenant, err = c.crdClient.SmeV1alpha2().CAPTenants(ca.Namespace).Create( + ctx, &v1alpha2.CAPTenant{ + Name: providerTenantName, + Namespace: ca.Namespace, + Annotations: annotations, + Labels: labels, + Spec: v1alpha2.CAPTenantSpec{ CAPApplicationInstance: ca.Name, - BTPTenantIdentification: v1alpha1.BTPTenantIdentification{ + BTPTenantIdentification: v1alpha2.BTPTenantIdentification{ SubDomain: ca.Spec.Provider.SubDomain, TenantId: ca.Spec.Provider.TenantId, }, Version: version, }, }, metav1.CreateOptions{}); err != nil { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) return } if tenant != nil { secret.OwnerReferences = []metav1.OwnerReference{ - *metav1.NewControllerRef(tenant, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantKind)), + *metav1.NewControllerRef(tenant, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantKind)), } _, err = c.kubeClient.CoreV1().Secrets(tenant.Namespace).Update(context.TODO(), secret, metav1.UpdateOptions{}) if err != nil { util.LogError(err, "Error updating tenant subscription context secret", string(Processing), ca, nil, "tenantId", ca.Spec.Provider.TenantId) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProviderTenantError", err.Error()) return } } @@ -495,12 +488,12 @@ func (c *Controller) createProviderTenant(ctx context.Context, ca *v1alpha1.CAPA return } -func (c *Controller) handleCAPApplicationDeletion(ctx context.Context, ca *v1alpha1.CAPApplication) (*ReconcileResult, error) { +func (c *Controller) handleCAPApplicationDeletion(ctx context.Context, ca *v1alpha2.CAPApplication) (*ReconcileResult, error) { var err error util.LogInfo("Attempting to delete application", string(Deleting), ca, nil) - if ca.Status.State != v1alpha1.CAPApplicationStateDeleting { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateDeleting, metav1.ConditionFalse, "DeleteTriggered", "") + if ca.Status.State != v1alpha2.CAPApplicationStateDeleting { + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateDeleting, metav1.ConditionFalse, "DeleteTriggered", "") return NewReconcileResultWithResource(ResourceCAPApplication, ca.Name, ca.Namespace, 0), nil } @@ -521,7 +514,7 @@ func (c *Controller) handleCAPApplicationDeletion(ctx context.Context, ca *v1alp // delete CAPApplication if removeFinalizer(&ca.Finalizers, FinalizerCAPApplication) { // requeue domain references for cleanup - var outdatedRefs []v1alpha1.DomainRef + var outdatedRefs []v1alpha2.DomainRef json.Unmarshal([]byte(ca.Status.DomainSpecHash), &outdatedRefs) // ignore errors (considering older versions) var requeue *ReconcileResult if outdatedRefs != nil { @@ -536,7 +529,7 @@ func (c *Controller) handleCAPApplicationDeletion(ctx context.Context, ca *v1alp return nil, nil } -func (c *Controller) checkTenants(ca *v1alpha1.CAPApplication) (bool, error) { +func (c *Controller) checkTenants(ca *v1alpha2.CAPApplication) (bool, error) { ignoredTenants := 0 tenants, err := c.getRelevantTenantsForCA(ca) if err != nil { @@ -546,7 +539,7 @@ func (c *Controller) checkTenants(ca *v1alpha1.CAPApplication) (bool, error) { // Automatically delete the provider tenant on deleting CAPApplication. for _, tenant := range tenants { if tenantType, ok := tenant.Labels[LabelTenantType]; ok && tenantType == TenantTypeProvider { - c.crdClient.SmeV1alpha1().CAPTenants(ca.Namespace).Delete(context.TODO(), tenant.Name, metav1.DeleteOptions{}) + c.crdClient.SmeV1alpha2().CAPTenants(ca.Namespace).Delete(context.TODO(), tenant.Name, metav1.DeleteOptions{}) ignoredTenants = 1 break } @@ -557,7 +550,7 @@ func (c *Controller) checkTenants(ca *v1alpha1.CAPApplication) (bool, error) { if tenantsExist { util.LogInfo("Dependent tenants found", string(Deleting), ca, nil, "tenantCount", len(tenants)) if len(tenants) > ignoredTenants { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateDeleting, metav1.ConditionFalse, "TenantsExist", "Delete all tenants (e.g. by unsubscribing to the app) before deleting this application") + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateDeleting, metav1.ConditionFalse, "TenantsExist", "Delete all tenants (e.g. by unsubscribing to the app) before deleting this application") } } else { util.LogInfo("No dependent tenants found, proceeding with deletion", string(Deleting), ca, nil) @@ -566,7 +559,7 @@ func (c *Controller) checkTenants(ca *v1alpha1.CAPApplication) (bool, error) { return tenantsExist, nil } -func (c *Controller) prepareCAPApplication(ca *v1alpha1.CAPApplication) (update bool) { +func (c *Controller) prepareCAPApplication(ca *v1alpha2.CAPApplication) (update bool) { // Do nothing when object is deleted if ca.DeletionTimestamp != nil { return false @@ -591,7 +584,7 @@ func (c *Controller) prepareCAPApplication(ca *v1alpha1.CAPApplication) (update return update } -func (c *Controller) areApplicationDomainReferencesReady(ca *v1alpha1.CAPApplication) (bool, error) { +func (c *Controller) areApplicationDomainReferencesReady(ca *v1alpha2.CAPApplication) (bool, error) { // check if all domain references are ready doms, cdoms, err := fetchDomainResourcesFromCache(c, ca.Spec.DomainRefs, ca.Namespace) if err != nil { @@ -604,40 +597,40 @@ func (c *Controller) areApplicationDomainReferencesReady(ca *v1alpha1.CAPApplica return areDomainResourcesReady(cdoms) } -func (c *Controller) reconcileApplicationDomainReferences(ca *v1alpha1.CAPApplication) (requeue *ReconcileResult, err error) { +func (c *Controller) reconcileApplicationDomainReferences(ca *v1alpha2.CAPApplication) (requeue *ReconcileResult, err error) { // (1) fetch referenced domain resources var ( - doms []*v1alpha1.Domain - cdoms []*v1alpha1.ClusterDomain + doms []*v1alpha2.Domain + cdoms []*v1alpha2.ClusterDomain ) doms, cdoms, err = fetchDomainResourcesFromCache(c, ca.Spec.DomainRefs, ca.Namespace) if k8sErrors.IsNotFound(err) { // ignore error and wait for domain resources to be created c.Event(ca, nil, corev1.EventTypeWarning, CAPApplicationEventMissingDomainReferences, EventActionProcessingDomainResources, err.Error()) - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateProcessing, metav1.ConditionFalse, "ProcessingDomainReferences", "Waiting for all domain references to be created") + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateProcessing, metav1.ConditionFalse, "ProcessingDomainReferences", "Waiting for all domain references to be created") requeue = NewReconcileResultWithResource(ResourceCAPApplication, ca.Name, ca.Namespace, 5*time.Second) return requeue, nil } else if err != nil { - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, "ProcessingDomainReferences", err.Error()) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, "ProcessingDomainReferences", err.Error()) return nil, err } // (2) check and wait till all referenced domain resources are ready - setNotReady := func(state v1alpha1.CAPApplicationState, msg string) { + setNotReady := func(state v1alpha2.CAPApplicationState, msg string) { ca.SetStatusWithReadyCondition(state, metav1.ConditionFalse, "ProcessingDomainReferences", msg) requeue = NewReconcileResultWithResource(ResourceCAPApplication, ca.Name, ca.Namespace, 5*time.Second) } setStatus := func(r bool, e error) bool { var ( - s v1alpha1.CAPApplicationState + s v1alpha2.CAPApplicationState m string ) if e != nil { - s = v1alpha1.CAPApplicationStateError + s = v1alpha2.CAPApplicationStateError m = e.Error() } else if !r { - s = v1alpha1.CAPApplicationStateProcessing + s = v1alpha2.CAPApplicationStateProcessing m = "Waiting for domain references to be ready" } else { return false @@ -687,7 +680,7 @@ func (c *Controller) reconcileApplicationDomainReferences(ca *v1alpha1.CAPApplic return } -func (c *Controller) addApplicationResourcesToReconcileResult(ca *v1alpha1.CAPApplication, requeue *ReconcileResult) error { +func (c *Controller) addApplicationResourcesToReconcileResult(ca *v1alpha2.CAPApplication, requeue *ReconcileResult) error { versions, tenants, err := c.getCachedApplicationResources(ca) if err != nil { return err @@ -709,7 +702,7 @@ func (c *Controller) addApplicationResourcesToReconcileResult(ca *v1alpha1.CAPAp } // Collect service operation metrics based on the status of the CAV -func collectServiceOperationMetrics(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, err error) { +func collectServiceOperationMetrics(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, err error) { appIdHash := ca.Labels[LabelAppIdHash] // Collect/Increment overall completed service operation metrics diff --git a/internal/controller/reconcile-capapplication_test.go b/internal/controller/reconcile-capapplication_test.go index 039e0295..6ce0af55 100644 --- a/internal/controller/reconcile-capapplication_test.go +++ b/internal/controller/reconcile-capapplication_test.go @@ -455,11 +455,11 @@ func TestProviderTenantCreationError(t *testing.T) { }, expectedResources: "testdata/capapplication/ca-43.expected.yaml", expectError: true, - mockErrorForResources: []ResourceAction{{Verb: "create", Group: "sme.sap.com", Version: "v1alpha1", Resource: "captenants", Namespace: "*", Name: "*"}}, + mockErrorForResources: []ResourceAction{{Verb: "create", Group: "sme.sap.com", Version: "v1alpha2", Resource: "captenants", Namespace: "*", Name: "*"}}, }, ) - if err.Error() != "mocked api error (captenants.sme.sap.com/v1alpha1)" { + if err.Error() != "mocked api error (captenants.sme.sap.com/v1alpha2)" { t.Error("Wrong error message") } } diff --git a/internal/controller/reconcile-capapplicationversion.go b/internal/controller/reconcile-capapplicationversion.go index d2dcb963..19545d33 100644 --- a/internal/controller/reconcile-capapplicationversion.go +++ b/internal/controller/reconcile-capapplicationversion.go @@ -16,7 +16,7 @@ import ( monv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" appsv1 "k8s.io/api/apps/v1" autoscalingv2 "k8s.io/api/autoscaling/v2" batchv1 "k8s.io/api/batch/v1" @@ -47,15 +47,15 @@ const ( var trueVal = true type DeploymentParameters struct { - CA *v1alpha1.CAPApplication - CAV *v1alpha1.CAPApplicationVersion + CA *v1alpha2.CAPApplication + CAV *v1alpha2.CAPApplicationVersion OwnerRef *metav1.OwnerReference - WorkloadDetails v1alpha1.WorkloadDetails + WorkloadDetails v1alpha2.WorkloadDetails VCAPSecretName string } func (c *Controller) reconcileCAPApplicationVersion(ctx context.Context, item QueueItem, _ int) (*ReconcileResult, error) { - lister := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister() + lister := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister() cached, err := lister.CAPApplicationVersions(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) if err != nil { return nil, handleOperatorResourceErrors(err) @@ -80,10 +80,10 @@ func (c *Controller) reconcileCAPApplicationVersion(ctx context.Context, item Qu return c.handleCAPApplicationVersion(ctx, cav) } -func (c *Controller) updateCAPApplicationVersionStatus(ctx context.Context, cav *v1alpha1.CAPApplicationVersion, state v1alpha1.CAPApplicationVersionState, condition metav1.Condition) error { +func (c *Controller) updateCAPApplicationVersionStatus(ctx context.Context, cav *v1alpha2.CAPApplicationVersion, state v1alpha2.CAPApplicationVersionState, condition metav1.Condition) error { cav.SetStatusWithReadyCondition(state, condition.Status, condition.Reason, condition.Message) - cavUpdated, statusErr := c.crdClient.SmeV1alpha1().CAPApplicationVersions(cav.Namespace).UpdateStatus(ctx, cav, metav1.UpdateOptions{}) + cavUpdated, statusErr := c.crdClient.SmeV1alpha2().CAPApplicationVersions(cav.Namespace).UpdateStatus(ctx, cav, metav1.UpdateOptions{}) // Update reference to the resource if cavUpdated != nil { *cav = *cavUpdated @@ -95,8 +95,8 @@ func (c *Controller) updateCAPApplicationVersionStatus(ctx context.Context, cav return statusErr } -func (c *Controller) updateCAPApplicationVersion(ctx context.Context, cav *v1alpha1.CAPApplicationVersion) error { - cavUpdated, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions(cav.Namespace).Update(ctx, cav, metav1.UpdateOptions{}) +func (c *Controller) updateCAPApplicationVersion(ctx context.Context, cav *v1alpha2.CAPApplicationVersion) error { + cavUpdated, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions(cav.Namespace).Update(ctx, cav, metav1.UpdateOptions{}) // Update reference to the resource if cavUpdated != nil { *cav = *cavUpdated @@ -104,7 +104,7 @@ func (c *Controller) updateCAPApplicationVersion(ctx context.Context, cav *v1alp return err } -func (c *Controller) handleCAPApplicationVersion(ctx context.Context, cav *v1alpha1.CAPApplicationVersion) (*ReconcileResult, error) { +func (c *Controller) handleCAPApplicationVersion(ctx context.Context, cav *v1alpha2.CAPApplicationVersion) (*ReconcileResult, error) { ca, _ := c.getCachedCAPApplication(cav.Namespace, cav.Spec.CAPApplicationInstance) // Check for valid secrets @@ -113,22 +113,22 @@ func (c *Controller) handleCAPApplicationVersion(ctx context.Context, cav *v1alp message := "Missing secrets; err: " + err.Error() // Requeue after 10s to check if secrets exist util.LogInfo(message+" check again if the required secrets exist after 10 seconds", string(Processing), cav, nil, "version", cav.Spec.Version) - return NewReconcileResultWithResource(ResourceCAPApplicationVersion, cav.Name, cav.Namespace, 10*time.Second), c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "WaitingForSecrets", Message: message}) + return NewReconcileResultWithResource(ResourceCAPApplicationVersion, cav.Name, cav.Namespace, 10*time.Second), c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "WaitingForSecrets", Message: message}) } // If Valid secrets exists proceed with processing deployment var statusErr error switch cav.Status.State { case "": - return NewReconcileResultWithResource(ResourceCAPApplicationVersion, cav.Name, cav.Namespace, 0), c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ReadyForProcessing"}) - case v1alpha1.CAPApplicationVersionStateError: + return NewReconcileResultWithResource(ResourceCAPApplicationVersion, cav.Name, cav.Namespace, 0), c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ReadyForProcessing"}) + case v1alpha2.CAPApplicationVersionStateError: var errorCondition metav1.Condition if len(cav.Status.Conditions) > 0 { errorCondition = *cav.Status.Conditions[0].DeepCopy() // keep the error condition while re-processing } else { - errorCondition = metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "RetryProcessing"} + errorCondition = metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "RetryProcessing"} } - statusErr = c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateProcessing, errorCondition) + statusErr = c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateProcessing, errorCondition) } if statusErr != nil { @@ -138,21 +138,21 @@ func (c *Controller) handleCAPApplicationVersion(ctx context.Context, cav *v1alp return c.processWorkloads(ctx, ca, cav) } -func (c *Controller) processWorkloads(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) (*ReconcileResult, error) { +func (c *Controller) processWorkloads(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) (*ReconcileResult, error) { // We do not update individual deployments/jobs (so far these are just created, as we expect secrets don't change!) overallDeployments := []*appsv1.Deployment{} // Handle Content job err := c.handleContentDeployJob(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInContentDeploymentJob", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInContentDeploymentJob", Message: err.Error()}) return nil, err } // Create Service Deployments serviceDeployments, err := c.updateServiceDeployment(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInServiceDeployment", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInServiceDeployment", Message: err.Error()}) return nil, err } overallDeployments = append(overallDeployments, serviceDeployments...) @@ -160,7 +160,7 @@ func (c *Controller) processWorkloads(ctx context.Context, ca *v1alpha1.CAPAppli // Create AppRouter Deployment approuterDeployment, err := c.updateApprouterDeployment(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInAppRouterDeployment", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInAppRouterDeployment", Message: err.Error()}) return nil, err } if approuterDeployment != nil { @@ -170,7 +170,7 @@ func (c *Controller) processWorkloads(ctx context.Context, ca *v1alpha1.CAPAppli // Create Server Deployment serverDeployments, err := c.updateServerDeployment(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInServerDeployment", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInServerDeployment", Message: err.Error()}) return nil, err } if len(serverDeployments) > 0 { @@ -180,14 +180,14 @@ func (c *Controller) processWorkloads(ctx context.Context, ca *v1alpha1.CAPAppli // Create All Services err = c.updateServices(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInServerService", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInServerService", Message: err.Error()}) return nil, err } // Create Additional Deployments additionalDeployments, err := c.updateAdditionalDeployment(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInJobWorkerDeployment", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInJobWorkerDeployment", Message: err.Error()}) return nil, err } overallDeployments = append(overallDeployments, additionalDeployments...) @@ -195,36 +195,36 @@ func (c *Controller) processWorkloads(ctx context.Context, ca *v1alpha1.CAPAppli // Create NetworkPolicy err = c.updateNetworkPolicies(ctx, ca, cav) if err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInNetworkPolicy", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInNetworkPolicy", Message: err.Error()}) return nil, err } // Check for status of all workloads processing, err := c.checkOverallWorkloadStatus(ctx, overallDeployments, cav) if processing { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "WaitingForWorkloads"}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "WaitingForWorkloads"}) return NewReconcileResultWithResource(ResourceCAPApplicationVersion, cav.Name, cav.Namespace, 10*time.Second), nil } else if err != nil { util.LogError(err, "Workload(s) in error status", string(Error), cav, nil, "version", cav.Spec.Version) - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ErrorInWorkloadStatus", Message: err.Error()}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateError, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ErrorInWorkloadStatus", Message: err.Error()}) return nil, err } requeue, err := c.checkServiceDNSEntries(ca, cav) if requeue != nil || err != nil { - c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "WaitingForServiceDNSEntries"}) + c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "WaitingForServiceDNSEntries"}) return requeue, err } // We now wait until all the deployments are actually "Ready", apart from relying on Content Job completing successfully! - if cav.Status.State == v1alpha1.CAPApplicationVersionStateProcessing { + if cav.Status.State == v1alpha2.CAPApplicationVersionStateProcessing { // Only log if the state is still processing as cav might be reconciled again util.LogInfo("All deployments and other resources created successfully", string(Ready), cav, nil, "version", cav.Spec.Version) } - return nil, c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateReady, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "True", Reason: "WorkloadsReady"}) + return nil, c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateReady, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "True", Reason: "WorkloadsReady"}) } -func (c *Controller) checkServiceDNSEntries(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) (*ReconcileResult, error) { +func (c *Controller) checkServiceDNSEntries(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) (*ReconcileResult, error) { checkNeeded := len(cav.Spec.ServiceExposures) > 0 // check application domain references to ensure dns entries are ready if checkNeeded { @@ -242,14 +242,14 @@ func (c *Controller) checkServiceDNSEntries(ca *v1alpha1.CAPApplication, cav *v1 return nil, nil } -func getContentJobName(contentJobWorkloadName string, cav *v1alpha1.CAPApplicationVersion) string { +func getContentJobName(contentJobWorkloadName string, cav *v1alpha2.CAPApplicationVersion) string { if cav.Spec.ContentJobs == nil { // for backward compatibility as there could be existing jobs in the clusters with old names - return cav.Name + "-" + strings.ToLower(string(v1alpha1.JobContent)) + return cav.Name + "-" + strings.ToLower(string(v1alpha2.JobContent)) } return cav.Name + "-" + contentJobWorkloadName } -func getNextContentJob(cav *v1alpha1.CAPApplicationVersion) *v1alpha1.WorkloadDetails { +func getNextContentJob(cav *v1alpha2.CAPApplicationVersion) *v1alpha2.WorkloadDetails { // If the previous job failed, we should not trigger the next job if len(cav.Status.Conditions) > 0 && cav.Status.Conditions[0].Reason == "ErrorInContentDeploymentJob" { @@ -257,7 +257,7 @@ func getNextContentJob(cav *v1alpha1.CAPApplicationVersion) *v1alpha1.WorkloadDe } if cav.Spec.ContentJobs == nil { - contentJobWorkload := getRelevantJob(v1alpha1.JobContent, cav) + contentJobWorkload := getRelevantJob(v1alpha2.JobContent, cav) if contentJobWorkload != nil && !cav.CheckFinishedJobs(getContentJobName(contentJobWorkload.Name, cav)) { return contentJobWorkload } @@ -273,7 +273,7 @@ func getNextContentJob(cav *v1alpha1.CAPApplicationVersion) *v1alpha1.WorkloadDe } // #region Content Deploy Job -func (c *Controller) handleContentDeployJob(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) error { +func (c *Controller) handleContentDeployJob(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) error { workload := getNextContentJob(cav) // All jobs executed --> exit @@ -296,7 +296,7 @@ func (c *Controller) handleContentDeployJob(ctx context.Context, ca *v1alpha1.CA consumedServiceInfos := getConsumedServiceInfos(getConsumedServiceMap(workload.ConsumedBTPServices), ca.Spec.BTP.Services) // Create ownerRef to CAV - ownerRef := *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)) + ownerRef := *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)) // Get VCAP secret name vcapSecretName, err = c.createVCAPSecret(jobName, cav.Namespace, ownerRef, consumedServiceInfos) @@ -313,7 +313,7 @@ func (c *Controller) handleContentDeployJob(ctx context.Context, ca *v1alpha1.CA } // newContentDeploymentJob creates a Content Deployment Job for the CAV resource. It also sets the appropriate OwnerReferences. -func newContentDeploymentJob(cav *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails, ownerRef metav1.OwnerReference, vcapSecretName string) *batchv1.Job { +func newContentDeploymentJob(cav *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails, ownerRef metav1.OwnerReference, vcapSecretName string) *batchv1.Job { labels := copyMaps(workload.Labels, map[string]string{ LabelDisableKarydia: "true", }) @@ -382,22 +382,22 @@ func newContentDeploymentJob(cav *v1alpha1.CAPApplicationVersion, workload *v1al //#endregion // #region Service Deployment -func (c *Controller) updateServiceDeployment(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) ([]*appsv1.Deployment, error) { - return c.updateDeployments(ctx, v1alpha1.DeploymentService, ca, cav) +func (c *Controller) updateServiceDeployment(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) ([]*appsv1.Deployment, error) { + return c.updateDeployments(ctx, v1alpha2.DeploymentService, ca, cav) } //#endregion // #region Server -func (c *Controller) updateServerDeployment(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) ([]*appsv1.Deployment, error) { - return c.updateDeployments(ctx, v1alpha1.DeploymentCAP, ca, cav) +func (c *Controller) updateServerDeployment(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) ([]*appsv1.Deployment, error) { + return c.updateDeployments(ctx, v1alpha2.DeploymentCAP, ca, cav) } //#endregion // #region AppRouter -func (c *Controller) updateApprouterDeployment(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) (*appsv1.Deployment, error) { - routerWorkload := getRelevantDeployment(v1alpha1.DeploymentRouter, cav) +func (c *Controller) updateApprouterDeployment(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) (*appsv1.Deployment, error) { + routerWorkload := getRelevantDeployment(v1alpha2.DeploymentRouter, cav) if routerWorkload != nil { return c.updateDeployment(ctx, ca, cav, routerWorkload) } @@ -407,14 +407,14 @@ func (c *Controller) updateApprouterDeployment(ctx context.Context, ca *v1alpha1 //#endregion // #region Additional Deployments -func (c *Controller) updateAdditionalDeployment(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) ([]*appsv1.Deployment, error) { - return c.updateDeployments(ctx, v1alpha1.DeploymentAdditional, ca, cav) +func (c *Controller) updateAdditionalDeployment(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) ([]*appsv1.Deployment, error) { + return c.updateDeployments(ctx, v1alpha2.DeploymentAdditional, ca, cav) } //#endregion // #region update deployments -func (c *Controller) updateDeployments(ctx context.Context, deploymentType v1alpha1.DeploymentType, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) ([]*appsv1.Deployment, error) { +func (c *Controller) updateDeployments(ctx context.Context, deploymentType v1alpha2.DeploymentType, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) ([]*appsv1.Deployment, error) { configuredDeployments := getDeployments(deploymentType, cav) actualDeployments := []*appsv1.Deployment{} for _, workload := range configuredDeployments { @@ -431,7 +431,7 @@ func (c *Controller) updateDeployments(ctx context.Context, deploymentType v1alp // #endregion // #region Service -func (c *Controller) updateServices(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) error { +func (c *Controller) updateServices(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) error { workloadServicePortInfos := getRelevantServicePortInfo(cav) for _, workloadServicePortInfo := range workloadServicePortInfos { // Get the Service with the name specified in CustomDeployment.spec @@ -455,7 +455,7 @@ func (c *Controller) updateServices(ctx context.Context, ca *v1alpha1.CAPApplica } // newService creates a new Service for a CAV resource. It also sets the appropriate OwnerReferences. -func newService(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workloadServicePortInfo servicePortInfo) *corev1.Service { +func newService(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workloadServicePortInfo servicePortInfo) *corev1.Service { var ports []corev1.ServicePort for _, port := range workloadServicePortInfo.Ports { @@ -479,7 +479,7 @@ func newService(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion Labels: labels, Annotations: annotations, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)), + *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)), }, }, Spec: corev1.ServiceSpec{ @@ -509,7 +509,7 @@ func (c *Controller) checkServiceMonitorCapability() error { return fmt.Errorf("resource %s is not served by API version %s", resourceKind, monitoringGroupVersion) } -func (c *Controller) updateServiceMonitors(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workloadServicePortInfos []servicePortInfo) error { +func (c *Controller) updateServiceMonitors(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workloadServicePortInfos []servicePortInfo) error { if err := c.checkServiceMonitorCapability(); err != nil { util.LogWarning(err, "could not confirm availability of service monitor resource; service monitors will not be created") return nil @@ -525,7 +525,7 @@ func (c *Controller) updateServiceMonitors(ctx context.Context, ca *v1alpha1.CAP return nil } -func (c *Controller) reconcileWorkloadServiceMonitor(ctx context.Context, wl *v1alpha1.WorkloadDetails, cav *v1alpha1.CAPApplicationVersion, workloadServicePortInfos []servicePortInfo, ca *v1alpha1.CAPApplication) error { +func (c *Controller) reconcileWorkloadServiceMonitor(ctx context.Context, wl *v1alpha2.WorkloadDetails, cav *v1alpha2.CAPApplicationVersion, workloadServicePortInfos []servicePortInfo, ca *v1alpha2.CAPApplication) error { if wl.DeploymentDefinition == nil || wl.DeploymentDefinition.Monitoring == nil || wl.DeploymentDefinition.Monitoring.ScrapeConfig == nil { return nil // do not reconcile service monitors } @@ -558,7 +558,7 @@ func isWorkloadPort(wlPorts []corev1.ServicePort, scrapePort string) bool { return false } -func newServiceMonitor(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, wl *v1alpha1.WorkloadDetails, wlPortInfos *servicePortInfo) *monv1.ServiceMonitor { +func newServiceMonitor(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, wl *v1alpha2.WorkloadDetails, wlPortInfos *servicePortInfo) *monv1.ServiceMonitor { config := wl.DeploymentDefinition.Monitoring.ScrapeConfig return &monv1.ServiceMonitor{ ObjectMeta: metav1.ObjectMeta{ @@ -567,7 +567,7 @@ func newServiceMonitor(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplication Labels: copyMaps(wl.Labels, getLabels(ca, cav, CategoryServiceMonitor, string(wl.DeploymentDefinition.Type), wlPortInfos.WorkloadName+ServiceSuffix, true)), Annotations: copyMaps(wl.Annotations, getAnnotations(cav)), OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)), + *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)), }, }, Spec: monv1.ServiceMonitorSpec{ @@ -587,7 +587,7 @@ func newServiceMonitor(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplication // #endregion ServiceMonitor // #region NetworkPolicy -func (c *Controller) updateNetworkPolicies(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) error { +func (c *Controller) updateNetworkPolicies(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) error { var ( spec networkingv1.NetworkPolicySpec err error @@ -617,7 +617,7 @@ func (c *Controller) updateNetworkPolicies(ctx context.Context, ca *v1alpha1.CAP } // check and create a new NetworkPolicy for the given workload/CAV resource. It also sets the appropriate OwnerReferences. -func (c *Controller) createNetworkPolicy(ctx context.Context, name string, spec networkingv1.NetworkPolicySpec, cav *v1alpha1.CAPApplicationVersion) error { +func (c *Controller) createNetworkPolicy(ctx context.Context, name string, spec networkingv1.NetworkPolicySpec, cav *v1alpha2.CAPApplicationVersion) error { networkPolicy, err := c.kubeClient.NetworkingV1().NetworkPolicies(cav.Namespace).Get(ctx, name, metav1.GetOptions{}) // If the resource doesn't exist, we'll create it if k8sErrors.IsNotFound(err) { @@ -627,7 +627,7 @@ func (c *Controller) createNetworkPolicy(ctx context.Context, name string, spec Name: name, Namespace: cav.Namespace, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)), + *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)), }, }, Spec: spec, @@ -639,7 +639,7 @@ func (c *Controller) createNetworkPolicy(ctx context.Context, name string, spec return doChecks(err, networkPolicy, cav, "NetworkPolicy") } -func getAppPodNetworkPolicySpec(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) networkingv1.NetworkPolicySpec { +func getAppPodNetworkPolicySpec(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) networkingv1.NetworkPolicySpec { return networkingv1.NetworkPolicySpec{ PolicyTypes: []networkingv1.PolicyType{networkingv1.PolicyTypeIngress}, Ingress: []networkingv1.NetworkPolicyIngressRule{{ @@ -655,7 +655,7 @@ func getAppPodNetworkPolicySpec(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPAp } } -func getPortSpecificNetworkPolicySpec(workloadServicePortInfo servicePortInfo, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) networkingv1.NetworkPolicySpec { +func getPortSpecificNetworkPolicySpec(workloadServicePortInfo servicePortInfo, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) networkingv1.NetworkPolicySpec { ports := []networkingv1.NetworkPolicyPort{} for _, port := range workloadServicePortInfo.ClusterPorts { ports = append(ports, networkingv1.NetworkPolicyPort{Port: &intstr.IntOrString{IntVal: port}}) @@ -681,7 +681,7 @@ func getPortSpecificNetworkPolicySpec(workloadServicePortInfo servicePortInfo, c // #region Deployments -func (c *Controller) updateDeployment(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails) (*appsv1.Deployment, error) { +func (c *Controller) updateDeployment(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails) (*appsv1.Deployment, error) { if res := validateEnv(workload.DeploymentDefinition.Env, restrictedEnvNames); res != "" { return nil, errorEnv(workload.Name, res) } @@ -696,7 +696,7 @@ func (c *Controller) updateDeployment(ctx context.Context, ca *v1alpha1.CAPAppli consumedServiceInfos := getConsumedServiceInfos(getConsumedServiceMap(workload.ConsumedBTPServices), ca.Spec.BTP.Services) // Create ownerRef to CAV - ownerRef := *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)) + ownerRef := *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)) // Get VCAP secret name vcapSecretName, err = c.createVCAPSecret(deploymentName, cav.Namespace, ownerRef, consumedServiceInfos) @@ -727,7 +727,7 @@ func (c *Controller) updateDeployment(ctx context.Context, ca *v1alpha1.CAPAppli return workloadDeployment, doChecks(err, workloadDeployment, cav, workload.Name) } -func (c *Controller) createOrUpdateDestinationRule(ctx context.Context, deploymentName string, workload *v1alpha1.WorkloadDetails, cav *v1alpha1.CAPApplicationVersion) error { +func (c *Controller) createOrUpdateDestinationRule(ctx context.Context, deploymentName string, workload *v1alpha2.WorkloadDetails, cav *v1alpha2.CAPApplicationVersion) error { // Only create DestinationRule if stickiness is configured for the workload stickiness := getStickinessForWorkload(workload) if stickiness == nil { @@ -736,13 +736,13 @@ func (c *Controller) createOrUpdateDestinationRule(ctx context.Context, deployme return c.handleDestinationRule(ctx, deploymentName, stickiness, cav) } -func getStickinessForWorkload(workload *v1alpha1.WorkloadDetails) *v1alpha1.Stickiness { +func getStickinessForWorkload(workload *v1alpha2.WorkloadDetails) *v1alpha2.Stickiness { if workload.DeploymentDefinition.Stickiness != nil { return workload.DeploymentDefinition.Stickiness - } else if workload.DeploymentDefinition.Type == v1alpha1.DeploymentRouter { - return &v1alpha1.Stickiness{ - Hash: &v1alpha1.StickinessHash{ - HttpCookie: &v1alpha1.HTTPCookie{ + } else if workload.DeploymentDefinition.Type == v1alpha2.DeploymentRouter { + return &v1alpha2.Stickiness{ + Hash: &v1alpha2.StickinessHash{ + HttpCookie: &v1alpha2.HTTPCookie{ Name: RouterHttpCookieName, Path: "/", Ttl: &metav1.Duration{Duration: 0 * time.Second}, // session cookie @@ -753,7 +753,7 @@ func getStickinessForWorkload(workload *v1alpha1.WorkloadDetails) *v1alpha1.Stic return nil } -func (c *Controller) createOrUpdateHorizontalPodAutoscaler(ctx context.Context, deploymentName string, workload *v1alpha1.WorkloadDetails, cav *v1alpha1.CAPApplicationVersion, ca *v1alpha1.CAPApplication) error { +func (c *Controller) createOrUpdateHorizontalPodAutoscaler(ctx context.Context, deploymentName string, workload *v1alpha2.WorkloadDetails, cav *v1alpha2.CAPApplicationVersion, ca *v1alpha2.CAPApplication) error { hpaName := deploymentName // Get the HPA which should exist for this deployment hpa, err := c.kubeClient.AutoscalingV2().HorizontalPodAutoscalers(cav.Namespace).Get(ctx, hpaName, metav1.GetOptions{}) @@ -767,7 +767,7 @@ func (c *Controller) createOrUpdateHorizontalPodAutoscaler(ctx context.Context, return doChecks(err, hpa, cav, workload.Name) } -func newHorizontalPodAutoscaler(deploymentName string, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails) *autoscalingv2.HorizontalPodAutoscaler { +func newHorizontalPodAutoscaler(deploymentName string, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails) *autoscalingv2.HorizontalPodAutoscaler { hpaName := deploymentName labels := copyMaps(workload.Labels, getLabels(ca, cav, CategoryWorkload, string(workload.DeploymentDefinition.Type), getWorkloadName(cav.Name, workload.Name), true)) @@ -790,7 +790,7 @@ func newHorizontalPodAutoscaler(deploymentName string, ca *v1alpha1.CAPApplicati Name: hpaName, Namespace: cav.Namespace, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)), + *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)), }, Labels: labels, Annotations: copyMaps(workload.Annotations, getAnnotations(cav)), @@ -799,7 +799,7 @@ func newHorizontalPodAutoscaler(deploymentName string, ca *v1alpha1.CAPApplicati } } -func (c *Controller) createOrUpdatePodDisruptionBudget(ctx context.Context, workload *v1alpha1.WorkloadDetails, cav *v1alpha1.CAPApplicationVersion, ca *v1alpha1.CAPApplication) error { +func (c *Controller) createOrUpdatePodDisruptionBudget(ctx context.Context, workload *v1alpha2.WorkloadDetails, cav *v1alpha2.CAPApplicationVersion, ca *v1alpha2.CAPApplication) error { pdbName := getWorkloadName(cav.Name, workload.Name) // Get the PDB which should exist for this deployment pdb, err := c.kubeClient.PolicyV1().PodDisruptionBudgets(cav.Namespace).Get(ctx, pdbName, metav1.GetOptions{}) @@ -813,7 +813,7 @@ func (c *Controller) createOrUpdatePodDisruptionBudget(ctx context.Context, work return doChecks(err, pdb, cav, workload.Name) } -func newPodDisruptionBudget(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails) *policyv1.PodDisruptionBudget { +func newPodDisruptionBudget(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails) *policyv1.PodDisruptionBudget { labels := copyMaps(workload.Labels, getLabels(ca, cav, CategoryWorkload, string(workload.DeploymentDefinition.Type), getWorkloadName(cav.Name, workload.Name), true)) pdbName := getWorkloadName(cav.Name, workload.Name) return &policyv1.PodDisruptionBudget{ @@ -821,7 +821,7 @@ func newPodDisruptionBudget(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplic Name: pdbName, Namespace: cav.Namespace, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)), + *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)), }, Labels: labels, Annotations: copyMaps(workload.Annotations, getAnnotations(cav)), @@ -830,7 +830,7 @@ func newPodDisruptionBudget(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplic } } -func newPodDisruptionBudgetSpec(workload *v1alpha1.WorkloadDetails, labels map[string]string) policyv1.PodDisruptionBudgetSpec { +func newPodDisruptionBudgetSpec(workload *v1alpha2.WorkloadDetails, labels map[string]string) policyv1.PodDisruptionBudgetSpec { pdbSpec := workload.DeploymentDefinition.PodDisruptionBudget.DeepCopy() pdbSpec.Selector = &metav1.LabelSelector{ MatchLabels: labels, @@ -839,7 +839,7 @@ func newPodDisruptionBudgetSpec(workload *v1alpha1.WorkloadDetails, labels map[s } // newDeployment creates a new generic Deployment for a CAV resource based on the type. It also sets the appropriate OwnerReferences. -func newDeployment(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails, ownerRef metav1.OwnerReference, vcapSecretName string) *appsv1.Deployment { +func newDeployment(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails, ownerRef metav1.OwnerReference, vcapSecretName string) *appsv1.Deployment { params := &DeploymentParameters{ CA: ca, CAV: cav, @@ -929,7 +929,7 @@ func getEnv(params *DeploymentParameters) []corev1.EnvVar { } env = append(env, params.WorkloadDetails.DeploymentDefinition.Env...) - if params.WorkloadDetails.DeploymentDefinition.Type == v1alpha1.DeploymentRouter { + if params.WorkloadDetails.DeploymentDefinition.Type == v1alpha2.DeploymentRouter { // Add destinations env for `Router` appendDestinationsEnv(params.CAV, &env) } @@ -937,7 +937,7 @@ func getEnv(params *DeploymentParameters) []corev1.EnvVar { return env } -func appendDestinationsEnv(cav *v1alpha1.CAPApplicationVersion, env *[]corev1.EnvVar) { +func appendDestinationsEnv(cav *v1alpha2.CAPApplicationVersion, env *[]corev1.EnvVar) { var ( destEnvIndex int = -1 destMap map[string]RouterDestination = map[string]RouterDestination{} @@ -1004,7 +1004,7 @@ func getEnvFrom(vcapServiceName string) []corev1.EnvFromSource { } } -func (c *Controller) prepareCAPApplicationVersion(cav *v1alpha1.CAPApplicationVersion) (update bool, err error) { +func (c *Controller) prepareCAPApplicationVersion(cav *v1alpha2.CAPApplicationVersion) (update bool, err error) { // Do nothing when object is deleted if cav.DeletionTimestamp != nil { return false, nil @@ -1013,9 +1013,9 @@ func (c *Controller) prepareCAPApplicationVersion(cav *v1alpha1.CAPApplicationVe if err != nil { return false, err } - if _, ok := getOwnerByKind(cav.OwnerReferences, v1alpha1.CAPApplicationKind); !ok { + if _, ok := getOwnerByObject(cav.OwnerReferences, v1alpha2.CAPApplicationKind, ca); !ok { // create owner reference - CAPApplication - cav.OwnerReferences = append(cav.OwnerReferences, *metav1.NewControllerRef(ca, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationKind))) + cav.OwnerReferences = append(cav.OwnerReferences, *metav1.NewControllerRef(ca, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationKind))) update = true } @@ -1037,14 +1037,14 @@ func (c *Controller) prepareCAPApplicationVersion(cav *v1alpha1.CAPApplicationVe } // Annotations -func getAnnotations(cav *v1alpha1.CAPApplicationVersion) map[string]string { +func getAnnotations(cav *v1alpha2.CAPApplicationVersion) map[string]string { return map[string]string{ AnnotationOwnerIdentifier: cav.Namespace + "." + cav.Name, } } // Labels -func getLabels(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, category string, workloadType string, workloadName string, additionalDetails bool) map[string]string { +func getLabels(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, category string, workloadType string, workloadName string, additionalDetails bool) map[string]string { labels := map[string]string{ App: ca.Spec.BTPAppName, LabelCAVVersion: cav.Spec.Version, @@ -1067,7 +1067,7 @@ func getLabels(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, return labels } -func addCAPApplicationVersionLabels(cav *v1alpha1.CAPApplicationVersion, ca *v1alpha1.CAPApplication) (updated bool) { +func addCAPApplicationVersionLabels(cav *v1alpha2.CAPApplicationVersion, ca *v1alpha2.CAPApplication) (updated bool) { appMetadata := appMetadataIdentifiers{ providerSubaccountId: ca.Spec.ProviderSubaccountId, appName: ca.Spec.BTPAppName, @@ -1084,7 +1084,7 @@ func addCAPApplicationVersionLabels(cav *v1alpha1.CAPApplicationVersion, ca *v1a } // Check if an error occurred or if owner references are correct -func doChecks(err error, obj metav1.Object, cav *v1alpha1.CAPApplicationVersion, res string) error { +func doChecks(err error, obj metav1.Object, cav *v1alpha2.CAPApplicationVersion, res string) error { // If an error occurs during Get/Create, we'll requeue the item so we can // attempt processing again later. This could have been caused by a // temporary network failure, or any other transient reason. @@ -1094,17 +1094,17 @@ func doChecks(err error, obj metav1.Object, cav *v1alpha1.CAPApplicationVersion, } // Check if the Deployment is not controlled by this CustomDeployment resource - _, ok := getOwnerByKind(obj.GetOwnerReferences(), v1alpha1.CAPApplicationVersionKind) + _, ok := getOwnerByObject(obj.GetOwnerReferences(), v1alpha2.CAPApplicationVersionKind, cav) if !ok { - return fmt.Errorf("%s could not be identified for the resource %s %s: %s.%s", v1alpha1.CAPApplicationVersionKind, res, obj.GetName(), cav.Namespace, cav.Name) + return fmt.Errorf("%s could not be identified for the resource %s %s: %s.%s", v1alpha2.CAPApplicationVersionKind, res, obj.GetName(), cav.Namespace, cav.Name) } return nil } -func getContentJobInOrder(cav *v1alpha1.CAPApplicationVersion) []string { +func getContentJobInOrder(cav *v1alpha2.CAPApplicationVersion) []string { if cav.Spec.ContentJobs == nil { - contentJob := getRelevantJob(v1alpha1.JobContent, cav) + contentJob := getRelevantJob(v1alpha2.JobContent, cav) if contentJob == nil { return nil } @@ -1113,7 +1113,7 @@ func getContentJobInOrder(cav *v1alpha1.CAPApplicationVersion) []string { return cav.Spec.ContentJobs } -func checkAndUpdateJobStatusFinishedJobs(contentDeployJob *batchv1.Job, cav *v1alpha1.CAPApplicationVersion) error { +func checkAndUpdateJobStatusFinishedJobs(contentDeployJob *batchv1.Job, cav *v1alpha2.CAPApplicationVersion) error { if contentDeployJob == nil { return nil } @@ -1128,16 +1128,16 @@ func checkAndUpdateJobStatusFinishedJobs(contentDeployJob *batchv1.Job, cav *v1a return nil } -func isExposedWorkload(workloadDetails v1alpha1.WorkloadDetails, cav *v1alpha1.CAPApplicationVersion) bool { +func isExposedWorkload(workloadDetails v1alpha2.WorkloadDetails, cav *v1alpha2.CAPApplicationVersion) bool { // If the workload is of type router, it should be exposed - if workloadDetails.DeploymentDefinition.Type == v1alpha1.DeploymentRouter { + if workloadDetails.DeploymentDefinition.Type == v1alpha2.DeploymentRouter { return true } // If the workload is in the serviceExposures list, it should be exposed return slices.ContainsFunc(cav.Spec.ServiceExposures, - func(serviceExposure v1alpha1.ServiceExposure) bool { + func(serviceExposure v1alpha2.ServiceExposure) bool { return slices.ContainsFunc(serviceExposure.Routes, - func(route v1alpha1.Route) bool { + func(route v1alpha2.Route) bool { return route.WorkloadName == workloadDetails.Name }, ) @@ -1145,7 +1145,7 @@ func isExposedWorkload(workloadDetails v1alpha1.WorkloadDetails, cav *v1alpha1.C ) } -func (c *Controller) checkContentWorkloadStatus(ctx context.Context, cav *v1alpha1.CAPApplicationVersion) (bool, error) { +func (c *Controller) checkContentWorkloadStatus(ctx context.Context, cav *v1alpha2.CAPApplicationVersion) (bool, error) { // Once the cav goes into Error state, we should not check the jobs again in the next reconciliation loop // because it could happen that the job can get deleted meanwhile and we won't be able // to determine the state of the job correctly. @@ -1162,13 +1162,13 @@ func (c *Controller) checkContentWorkloadStatus(ctx context.Context, cav *v1alph } // All Jobs are executed - if cav.Status.State != v1alpha1.CAPApplicationVersionStateReady { + if cav.Status.State != v1alpha2.CAPApplicationVersionStateReady { util.LogInfo("Content job(s) completed", string(Processing), cav, nil, "version", cav.Spec.Version) } return false, nil } -func (c *Controller) processContentJob(ctx context.Context, cav *v1alpha1.CAPApplicationVersion, job string) (bool, error) { +func (c *Controller) processContentJob(ctx context.Context, cav *v1alpha2.CAPApplicationVersion, job string) (bool, error) { // Get the contentDeploy job with the name expected for this CAV instance // The job could get deleted after sometime. So we should also check the finished job list on the CAV status. contentDeployJob, err := c.kubeInformerFactory.Batch().V1().Jobs().Lister().Jobs(cav.Namespace).Get(job) @@ -1183,7 +1183,7 @@ func (c *Controller) processContentJob(ctx context.Context, cav *v1alpha1.CAPApp } if numOfFinishedJobsBeforeUpd != len(cav.Status.FinishedJobs) { - if err := c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False", Reason: "ReadyForProcessing"}); err != nil { + if err := c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateProcessing, metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False", Reason: "ReadyForProcessing"}); err != nil { return false, err } } @@ -1197,7 +1197,7 @@ func (c *Controller) processContentJob(ctx context.Context, cav *v1alpha1.CAPApp return false, nil } -func (c *Controller) checkOverallWorkloadStatus(ctx context.Context, overallDeployments []*appsv1.Deployment, cav *v1alpha1.CAPApplicationVersion) (bool, error) { +func (c *Controller) checkOverallWorkloadStatus(ctx context.Context, overallDeployments []*appsv1.Deployment, cav *v1alpha2.CAPApplicationVersion) (bool, error) { // First check if the content jobs are completed processing, err := c.checkContentWorkloadStatus(ctx, cav) if processing || err != nil { @@ -1228,7 +1228,7 @@ func (c *Controller) checkOverallWorkloadStatus(ctx context.Context, overallDepl } // All Jobs and Deployment are Ready - if cav.Status.State != v1alpha1.CAPApplicationVersionStateReady { + if cav.Status.State != v1alpha2.CAPApplicationVersionStateReady { // Only log this state if cav is not already in Ready state as the resource might be reconciled again util.LogInfo("All workloads ready", string(Processing), cav, nil, "version", cav.Spec.Version) } @@ -1236,8 +1236,8 @@ func (c *Controller) checkOverallWorkloadStatus(ctx context.Context, overallDepl return false, nil } -func (c *Controller) getRelevantTenantsForCAV(cav *v1alpha1.CAPApplicationVersion) []*v1alpha1.CAPTenant { - var tenants []*v1alpha1.CAPTenant +func (c *Controller) getRelevantTenantsForCAV(cav *v1alpha2.CAPApplicationVersion) []*v1alpha2.CAPTenant { + var tenants []*v1alpha2.CAPTenant // Get CAPApplication instance ca, _ := c.getCachedCAPApplication(cav.Namespace, cav.Spec.CAPApplicationInstance) if ca != nil { @@ -1245,7 +1245,7 @@ func (c *Controller) getRelevantTenantsForCAV(cav *v1alpha1.CAPApplicationVersio tenantLabels[LabelAppIdHash] = sha1Sum(ca.Spec.ProviderSubaccountId, ca.Spec.BTPAppName) // Get all tenants in the namespace for the CAPApplication - allTenants, _ := c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister().CAPTenants(cav.Namespace).List(labels.SelectorFromSet(tenantLabels)) + allTenants, _ := c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister().CAPTenants(cav.Namespace).List(labels.SelectorFromSet(tenantLabels)) // Filter out relevant tenants for the CAPApplicationVersion for _, tenant := range allTenants { // If a tenant is already on a given version -or- is being provisioned/upgraded to a version, it is relevant for this CAPApplicationVersion @@ -1257,19 +1257,19 @@ func (c *Controller) getRelevantTenantsForCAV(cav *v1alpha1.CAPApplicationVersio return tenants } -func (c *Controller) deleteCAPApplicationVersion(ctx context.Context, cav *v1alpha1.CAPApplicationVersion) (*ReconcileResult, error) { +func (c *Controller) deleteCAPApplicationVersion(ctx context.Context, cav *v1alpha2.CAPApplicationVersion) (*ReconcileResult, error) { // Update State if it is not set yet util.LogInfo("Deleting application version", string(Deleting), cav, nil, "version", cav.Spec.Version) - if cav.Status.State != v1alpha1.CAPApplicationVersionStateDeleting { + if cav.Status.State != v1alpha2.CAPApplicationVersionStateDeleting { var deleteCondition metav1.Condition if len(cav.Status.Conditions) > 0 { deleteCondition = *cav.Status.Conditions[0].DeepCopy() // Reuse the existing condition during deletion } else { - deleteCondition = metav1.Condition{Type: string(v1alpha1.ConditionTypeReady), Status: "False"} + deleteCondition = metav1.Condition{Type: string(v1alpha2.ConditionTypeReady), Status: "False"} } // Set the reason for Deletion deleteCondition.Reason = "DeleteTriggered" - err := c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha1.CAPApplicationVersionStateDeleting, deleteCondition) + err := c.updateCAPApplicationVersionStatus(ctx, cav, v1alpha2.CAPApplicationVersionStateDeleting, deleteCondition) if err != nil { return nil, err } diff --git a/internal/controller/reconcile-capapplicationversion_test.go b/internal/controller/reconcile-capapplicationversion_test.go index 0d4d0bcd..ea70e1a3 100644 --- a/internal/controller/reconcile-capapplicationversion_test.go +++ b/internal/controller/reconcile-capapplicationversion_test.go @@ -916,7 +916,7 @@ func TestCAV_ServicesOnlyError(t *testing.T) { expectError: true, mockErrorForResources: []ResourceAction{ {Verb: "create", Group: "apps", Version: "v1", Resource: "deployments", Namespace: "default", Name: "*"}, - {Verb: "update", Group: "sme.sap.com", Version: "v1alpha1", Resource: "capapplicationversions", Namespace: "default", Name: "*"}, + {Verb: "update", Group: "sme.sap.com", Version: "v1alpha2", Resource: "capapplicationversions", Namespace: "default", Name: "*"}, }, }, ) diff --git a/internal/controller/reconcile-captenant.go b/internal/controller/reconcile-captenant.go index 9287a821..80d1917c 100644 --- a/internal/controller/reconcile-captenant.go +++ b/internal/controller/reconcile-captenant.go @@ -11,7 +11,7 @@ import ( "time" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" @@ -19,16 +19,16 @@ import ( ) type IdentifiedCAPTenantOperations struct { - active []*v1alpha1.CAPTenantOperation - processed []*v1alpha1.CAPTenantOperation + active []*v1alpha2.CAPTenantOperation + processed []*v1alpha2.CAPTenantOperation } type CAPTenantOperationTypeSelector string -type CAPTenantStateHandlerFunc func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) +type CAPTenantStateHandlerFunc func(ctx context.Context, c *Controller, cat *v1alpha2.CAPTenant, target StateCondition, ctop *v1alpha2.CAPTenantOperation) (*ReconcileResult, error) type StateCondition struct { - state v1alpha1.CAPTenantState + state v1alpha2.CAPTenantState conditionReason string conditionStatus metav1.ConditionStatus } @@ -46,9 +46,9 @@ type StatusInfo struct { const ( CAPTenantOperationTypeSelectorAll CAPTenantOperationTypeSelector = "All" - CAPTenantOperationTypeSelectorUpgrade CAPTenantOperationTypeSelector = CAPTenantOperationTypeSelector(v1alpha1.CAPTenantOperationTypeUpgrade) - CAPTenantOperationTypeSelectorProvisioning CAPTenantOperationTypeSelector = CAPTenantOperationTypeSelector(v1alpha1.CAPTenantOperationTypeProvisioning) - CAPTenantOperationTypeSelectorDeprovisioning CAPTenantOperationTypeSelector = CAPTenantOperationTypeSelector(v1alpha1.CAPTenantOperationTypeDeprovisioning) + CAPTenantOperationTypeSelectorUpgrade CAPTenantOperationTypeSelector = CAPTenantOperationTypeSelector(v1alpha2.CAPTenantOperationTypeUpgrade) + CAPTenantOperationTypeSelectorProvisioning CAPTenantOperationTypeSelector = CAPTenantOperationTypeSelector(v1alpha2.CAPTenantOperationTypeProvisioning) + CAPTenantOperationTypeSelectorDeprovisioning CAPTenantOperationTypeSelector = CAPTenantOperationTypeSelector(v1alpha2.CAPTenantOperationTypeDeprovisioning) ) const ( @@ -76,78 +76,78 @@ const ( const tenantOperationTimeout = 30 * time.Second -var operationTypeMsgMap = map[v1alpha1.CAPTenantOperationType]string{ - v1alpha1.CAPTenantOperationTypeProvisioning: string(Provisioning), - v1alpha1.CAPTenantOperationTypeUpgrade: string(Upgrading), - v1alpha1.CAPTenantOperationTypeDeprovisioning: string(Deprovisioning), +var operationTypeMsgMap = map[v1alpha2.CAPTenantOperationType]string{ + v1alpha2.CAPTenantOperationTypeProvisioning: string(Provisioning), + v1alpha2.CAPTenantOperationTypeUpgrade: string(Upgrading), + v1alpha2.CAPTenantOperationTypeDeprovisioning: string(Deprovisioning), } // maps tenant operation types (and their status) to CAPTenant status changes -var TenantOperationStatusMap = map[v1alpha1.CAPTenantOperationType]StatusInfo{ - v1alpha1.CAPTenantOperationTypeProvisioning: { +var TenantOperationStatusMap = map[v1alpha2.CAPTenantOperationType]StatusInfo{ + v1alpha2.CAPTenantOperationTypeProvisioning: { failed: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateProvisioningError, conditionReason: CAPTenantEventProvisioningFailed, conditionStatus: metav1.ConditionFalse}, + target: StateCondition{state: v1alpha2.CAPTenantStateProvisioningError, conditionReason: CAPTenantEventProvisioningFailed, conditionStatus: metav1.ConditionFalse}, handler: handleFailingTenantOperation, }, completed: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateReady, conditionReason: CAPTenantEventProvisioningCompleted, conditionStatus: metav1.ConditionTrue}, + target: StateCondition{state: v1alpha2.CAPTenantStateReady, conditionReason: CAPTenantEventProvisioningCompleted, conditionStatus: metav1.ConditionTrue}, handler: handleCompletedProvisioningUpgradeOperation, }, processing: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateProvisioning, conditionReason: CAPTenantEventProvisioningOperationCreated, conditionStatus: metav1.ConditionFalse}, + target: StateCondition{state: v1alpha2.CAPTenantStateProvisioning, conditionReason: CAPTenantEventProvisioningOperationCreated, conditionStatus: metav1.ConditionFalse}, handler: handleWaitingForTenantOperation, }, }, - v1alpha1.CAPTenantOperationTypeUpgrade: { // NOTE: during upgrades the ready condition status remains "True" as the tenant is in use + v1alpha2.CAPTenantOperationTypeUpgrade: { // NOTE: during upgrades the ready condition status remains "True" as the tenant is in use failed: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateUpgradeError, conditionReason: CAPTenantEventUpgradeFailed, conditionStatus: metav1.ConditionTrue}, + target: StateCondition{state: v1alpha2.CAPTenantStateUpgradeError, conditionReason: CAPTenantEventUpgradeFailed, conditionStatus: metav1.ConditionTrue}, handler: handleFailingTenantOperation, }, completed: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateReady, conditionReason: CAPTenantEventUpgradeCompleted, conditionStatus: metav1.ConditionTrue}, + target: StateCondition{state: v1alpha2.CAPTenantStateReady, conditionReason: CAPTenantEventUpgradeCompleted, conditionStatus: metav1.ConditionTrue}, handler: handleCompletedProvisioningUpgradeOperation, }, processing: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateUpgrading, conditionReason: CAPTenantEventUpgradeOperationCreated, conditionStatus: metav1.ConditionTrue}, + target: StateCondition{state: v1alpha2.CAPTenantStateUpgrading, conditionReason: CAPTenantEventUpgradeOperationCreated, conditionStatus: metav1.ConditionTrue}, handler: handleWaitingForTenantOperation, }, }, - v1alpha1.CAPTenantOperationTypeDeprovisioning: { + v1alpha2.CAPTenantOperationTypeDeprovisioning: { failed: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateDeleting, conditionReason: CAPTenantEventDeprovisioningFailed, conditionStatus: metav1.ConditionFalse}, + target: StateCondition{state: v1alpha2.CAPTenantStateDeleting, conditionReason: CAPTenantEventDeprovisioningFailed, conditionStatus: metav1.ConditionFalse}, handler: handleFailingTenantOperation, }, completed: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateDeleting, conditionReason: CAPTenantEventDeprovisioningCompleted, conditionStatus: metav1.ConditionFalse}, + target: StateCondition{state: v1alpha2.CAPTenantStateDeleting, conditionReason: CAPTenantEventDeprovisioningCompleted, conditionStatus: metav1.ConditionFalse}, handler: removeTenantFinalizers, }, processing: TargetStateHandler{ - target: StateCondition{state: v1alpha1.CAPTenantStateDeleting, conditionReason: CAPTenantEventDeprovisioningOperationCreated, conditionStatus: metav1.ConditionFalse}, + target: StateCondition{state: v1alpha2.CAPTenantStateDeleting, conditionReason: CAPTenantEventDeprovisioningOperationCreated, conditionStatus: metav1.ConditionFalse}, handler: handleWaitingForTenantOperation, }, }, } -func getTenantReconcileResultConsideringDeletion(cat *v1alpha1.CAPTenant, fallback *ReconcileResult) *ReconcileResult { - if cat.DeletionTimestamp != nil && cat.Status.State != v1alpha1.CAPTenantStateDeleting { +func getTenantReconcileResultConsideringDeletion(cat *v1alpha2.CAPTenant, fallback *ReconcileResult) *ReconcileResult { + if cat.DeletionTimestamp != nil && cat.Status.State != v1alpha2.CAPTenantStateDeleting { return NewReconcileResultWithResource(ResourceCAPTenant, cat.Name, cat.Namespace, tenantOperationTimeout) } return fallback } -var handleWaitingForTenantOperation = func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) { +var handleWaitingForTenantOperation = func(ctx context.Context, c *Controller, cat *v1alpha2.CAPTenant, target StateCondition, ctop *v1alpha2.CAPTenantOperation) (*ReconcileResult, error) { // NOTE: not returning a requeue item is ok, as changes in CAPTenantOperation status will queue the item via the informer util.LogInfo("Waiting for tenant operation to complete", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) - cat.SetStatusWithReadyCondition(target.state, target.conditionStatus, target.conditionReason, fmt.Sprintf("waiting for %s %s.%s of type %s to complete", v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name, ctop.Spec.Operation)) + cat.SetStatusWithReadyCondition(target.state, target.conditionStatus, target.conditionReason, fmt.Sprintf("waiting for %s %s.%s of type %s to complete", v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name, ctop.Spec.Operation)) return NewReconcileResultWithResource(ResourceCAPTenant, cat.Name, cat.Namespace, tenantOperationTimeout), nil // requeue while the tenant operation is being processed } -var handleCompletedProvisioningUpgradeOperation = func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) { +var handleCompletedProvisioningUpgradeOperation = func(ctx context.Context, c *Controller, cat *v1alpha2.CAPTenant, target StateCondition, ctop *v1alpha2.CAPTenantOperation) (*ReconcileResult, error) { util.LogInfo("Tenant operation successfully completed", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) - message := fmt.Sprintf("%s %s.%s successfully completed", v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name) + message := fmt.Sprintf("%s %s.%s successfully completed", v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name) c.Event(cat, ctop, corev1.EventTypeNormal, target.conditionReason, string(target.state), message) - ca, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().CAPApplications(cat.Namespace).Get(cat.Spec.CAPApplicationInstance) + ca, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().CAPApplications(cat.Namespace).Get(cat.Spec.CAPApplicationInstance) if err != nil { return nil, err } @@ -179,16 +179,16 @@ var handleCompletedProvisioningUpgradeOperation = func(ctx context.Context, c *C return getTenantReconcileResultConsideringDeletion(cat, nil), nil } -var handleFailingTenantOperation = func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) { +var handleFailingTenantOperation = func(ctx context.Context, c *Controller, cat *v1alpha2.CAPTenant, target StateCondition, ctop *v1alpha2.CAPTenantOperation) (*ReconcileResult, error) { var ( message string related runtime.Object = nil ) if ctop == nil { - message = fmt.Sprintf("Could not identify %s for tenant state %s", v1alpha1.CAPTenantOperationKind, cat.Status.State) + message = fmt.Sprintf("Could not identify %s for tenant state %s", v1alpha2.CAPTenantOperationKind, cat.Status.State) util.LogInfo(message, string(Processing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) } else { - message = fmt.Sprintf("%s %s.%s failed", v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name) + message = fmt.Sprintf("%s %s.%s failed", v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name) util.LogInfo("Tenant operation failed", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) related = ctop } @@ -198,9 +198,9 @@ var handleFailingTenantOperation = func(ctx context.Context, c *Controller, cat return getTenantReconcileResultConsideringDeletion(cat, nil), nil } -var removeTenantFinalizers = func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) { +var removeTenantFinalizers = func(ctx context.Context, c *Controller, cat *v1alpha2.CAPTenant, target StateCondition, ctop *v1alpha2.CAPTenantOperation) (*ReconcileResult, error) { if ctop != nil { - c.Event(cat, ctop, corev1.EventTypeNormal, target.conditionReason, string(target.state), fmt.Sprintf("%s of %s %s.%s successfully completed; attempting to remove finalizers", ctop.Spec.Operation, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name)) + c.Event(cat, ctop, corev1.EventTypeNormal, target.conditionReason, string(target.state), fmt.Sprintf("%s of %s %s.%s successfully completed; attempting to remove finalizers", ctop.Spec.Operation, v1alpha2.CAPTenantKind, cat.Namespace, cat.Name)) } // remove known finalizer @@ -212,7 +212,7 @@ var removeTenantFinalizers = func(ctx context.Context, c *Controller, cat *v1alp } func (c *Controller) reconcileCAPTenant(ctx context.Context, item QueueItem, _ int) (requeue *ReconcileResult, err error) { - cached, err := c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister().CAPTenants(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) + cached, err := c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister().CAPTenants(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) if err != nil { return nil, handleOperatorResourceErrors(err) } @@ -258,9 +258,9 @@ func (c *Controller) reconcileCAPTenant(ctx context.Context, item QueueItem, _ i return } -func (c *Controller) updateCAPTenant(ctx context.Context, cat *v1alpha1.CAPTenant, requeue bool) (result *ReconcileResult, err error) { - var catUpdated *v1alpha1.CAPTenant - catUpdated, err = c.crdClient.SmeV1alpha1().CAPTenants(cat.Namespace).Update(ctx, cat, metav1.UpdateOptions{}) +func (c *Controller) updateCAPTenant(ctx context.Context, cat *v1alpha2.CAPTenant, requeue bool) (result *ReconcileResult, err error) { + var catUpdated *v1alpha2.CAPTenant + catUpdated, err = c.crdClient.SmeV1alpha2().CAPTenants(cat.Namespace).Update(ctx, cat, metav1.UpdateOptions{}) // Update reference to the resource if catUpdated != nil { *cat = *catUpdated @@ -271,7 +271,7 @@ func (c *Controller) updateCAPTenant(ctx context.Context, cat *v1alpha1.CAPTenan return } -func findLatestCreatedTenantOperation(ops []*v1alpha1.CAPTenantOperation, selector CAPTenantOperationTypeSelector) (latest *v1alpha1.CAPTenantOperation) { +func findLatestCreatedTenantOperation(ops []*v1alpha2.CAPTenantOperation, selector CAPTenantOperationTypeSelector) (latest *v1alpha2.CAPTenantOperation) { for _, op := range ops { // workaround to fix pointer resolution after loop -> https://stackoverflow.com/questions/45967305/copying-the-address-of-a-loop-variable-in-go ctop := op @@ -286,8 +286,8 @@ func findLatestCreatedTenantOperation(ops []*v1alpha1.CAPTenantOperation, select return latest } -func findCAPTenantOperationTypeFromProcessingState(state v1alpha1.CAPTenantState) v1alpha1.CAPTenantOperationType { - var opType v1alpha1.CAPTenantOperationType +func findCAPTenantOperationTypeFromProcessingState(state v1alpha2.CAPTenantState) v1alpha2.CAPTenantOperationType { + var opType v1alpha2.CAPTenantOperationType for k, v := range TenantOperationStatusMap { if v.processing.target.state == state { opType = k @@ -297,7 +297,7 @@ func findCAPTenantOperationTypeFromProcessingState(state v1alpha1.CAPTenantState return opType } -func isTenantOperationConditionFailed(ctop *v1alpha1.CAPTenantOperation) bool { +func isTenantOperationConditionFailed(ctop *v1alpha2.CAPTenantOperation) bool { ready := ctop.Status.GenericStatus.Conditions[0] // NOTE: check reason != StepCompleted, instead of == StepFailed (operation could fail because of multiple reasons) if ready.Status == metav1.ConditionTrue && ready.Reason != CAPTenantOperationConditionReasonStepCompleted { @@ -306,7 +306,7 @@ func isTenantOperationConditionFailed(ctop *v1alpha1.CAPTenantOperation) bool { return false } -func (c *Controller) handleTenantOperationsForCAPTenant(ctx context.Context, cat *v1alpha1.CAPTenant) (*ReconcileResult, error) { +func (c *Controller) handleTenantOperationsForCAPTenant(ctx context.Context, cat *v1alpha2.CAPTenant) (*ReconcileResult, error) { ops, err := c.getCAPTenantOperationsByType(cat, CAPTenantOperationTypeSelectorAll) if err != nil { return nil, err @@ -323,7 +323,7 @@ func (c *Controller) handleTenantOperationsForCAPTenant(ctx context.Context, cat } // [2] look for operations which have recently finished and set status accordingly - if cat.Status.State == v1alpha1.CAPTenantStateProvisioning || cat.Status.State == v1alpha1.CAPTenantStateUpgrading || cat.Status.State == v1alpha1.CAPTenantStateDeleting { + if cat.Status.State == v1alpha2.CAPTenantStateProvisioning || cat.Status.State == v1alpha2.CAPTenantStateUpgrading || cat.Status.State == v1alpha2.CAPTenantStateDeleting { opType := findCAPTenantOperationTypeFromProcessingState(cat.Status.State) ctop := findLatestCreatedTenantOperation(ops.processed, CAPTenantOperationTypeSelector(opType)) var targetInfo TargetStateHandler @@ -341,14 +341,14 @@ func (c *Controller) handleTenantOperationsForCAPTenant(ctx context.Context, cat return c.handleNewTenantOperations(ctx, cat, ops) } -func (c *Controller) handleNewTenantOperations(ctx context.Context, cat *v1alpha1.CAPTenant, ops *IdentifiedCAPTenantOperations) (*ReconcileResult, error) { +func (c *Controller) handleNewTenantOperations(ctx context.Context, cat *v1alpha2.CAPTenant, ops *IdentifiedCAPTenantOperations) (*ReconcileResult, error) { // (1)) process deletion when Deletion timestamp is set if cat.DeletionTimestamp != nil { if cat.Status.CurrentCAPApplicationVersionInstance == "" { // there is no valid version so far -> deprovisioning is not required - return removeTenantFinalizers(ctx, c, cat, TenantOperationStatusMap[v1alpha1.CAPTenantOperationTypeDeprovisioning].completed.target, nil) + return removeTenantFinalizers(ctx, c, cat, TenantOperationStatusMap[v1alpha2.CAPTenantOperationTypeDeprovisioning].completed.target, nil) } else { - return c.triggerTenantOperation(ctx, cat, v1alpha1.CAPTenantOperationTypeDeprovisioning) + return c.triggerTenantOperation(ctx, cat, v1alpha2.CAPTenantOperationTypeDeprovisioning) } } @@ -359,24 +359,24 @@ func (c *Controller) handleNewTenantOperations(ctx context.Context, cat *v1alpha // (3) start provisioning when there is no current version if cat.Status.CurrentCAPApplicationVersionInstance == "" { - return c.triggerTenantOperation(ctx, cat, v1alpha1.CAPTenantOperationTypeProvisioning) + return c.triggerTenantOperation(ctx, cat, v1alpha2.CAPTenantOperationTypeProvisioning) } // (4) check for newer version to upgrade return c.tryForTenantUpgrade(ctx, cat) } -func (c *Controller) isNewTenantOperationRequired(ctx context.Context, cat *v1alpha1.CAPTenant, ops *IdentifiedCAPTenantOperations) (bool, error) { - if cat.Status.State != v1alpha1.CAPTenantStateProvisioningError && cat.Status.State != v1alpha1.CAPTenantStateUpgradeError { +func (c *Controller) isNewTenantOperationRequired(ctx context.Context, cat *v1alpha2.CAPTenant, ops *IdentifiedCAPTenantOperations) (bool, error) { + if cat.Status.State != v1alpha2.CAPTenantStateProvisioningError && cat.Status.State != v1alpha2.CAPTenantStateUpgradeError { return true, nil } // find existing operation (processed) - there can be no active operations at this point in the code (active operations have already been considered) - var opType v1alpha1.CAPTenantOperationType - if cat.Status.State == v1alpha1.CAPTenantStateProvisioningError { - opType = v1alpha1.CAPTenantOperationTypeProvisioning + var opType v1alpha2.CAPTenantOperationType + if cat.Status.State == v1alpha2.CAPTenantStateProvisioningError { + opType = v1alpha2.CAPTenantOperationTypeProvisioning } else { - opType = v1alpha1.CAPTenantOperationTypeUpgrade + opType = v1alpha2.CAPTenantOperationTypeUpgrade } ctop := findLatestCreatedTenantOperation(ops.processed, CAPTenantOperationTypeSelector(opType)) if ctop == nil { @@ -394,7 +394,7 @@ func (c *Controller) isNewTenantOperationRequired(ctx context.Context, cat *v1al } // create a CAPTenantOperation instance of a specific type (provisioning/deprovisioning/upgrade) -func (c *Controller) createCAPTenantOperation(ctx context.Context, cat *v1alpha1.CAPTenant, opType v1alpha1.CAPTenantOperationType) (*v1alpha1.CAPTenantOperation, error) { +func (c *Controller) createCAPTenantOperation(ctx context.Context, cat *v1alpha2.CAPTenant, opType v1alpha2.CAPTenantOperationType) (*v1alpha2.CAPTenantOperation, error) { // delete all previous tenant operations of the current type labelsMap := map[string]string{ LabelOwnerIdentifierHash: sha1Sum(cat.Namespace, cat.Name), @@ -405,9 +405,9 @@ func (c *Controller) createCAPTenantOperation(ctx context.Context, cat *v1alpha1 if err != nil { return nil, err } - err = c.crdClient.SmeV1alpha1().CAPTenantOperations(cat.Namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector.String()}) + err = c.crdClient.SmeV1alpha2().CAPTenantOperations(cat.Namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector.String()}) if err != nil { - return nil, fmt.Errorf("deletion of previous %ss of type %s failed: %s", v1alpha1.CAPTenantOperationKind, opType, err.Error()) + return nil, fmt.Errorf("deletion of previous %ss of type %s failed: %s", v1alpha2.CAPTenantOperationKind, opType, err.Error()) } // get CAPApplicationVersion to be used for the TenantOperation job @@ -429,26 +429,26 @@ func (c *Controller) createCAPTenantOperation(ctx context.Context, cat *v1alpha1 } // create CAPTenantOperation - ctop := &v1alpha1.CAPTenantOperation{ + ctop := &v1alpha2.CAPTenantOperation{ ObjectMeta: metav1.ObjectMeta{ Namespace: cat.Namespace, GenerateName: cat.Name + "-", - OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cat, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantKind))}, + OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cat, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantKind))}, Finalizers: []string{FinalizerCAPTenantOperation}, }, - Spec: v1alpha1.CAPTenantOperationSpec{ + Spec: v1alpha2.CAPTenantOperationSpec{ Operation: opType, - BTPTenantIdentification: v1alpha1.BTPTenantIdentification{SubDomain: cat.Spec.SubDomain, TenantId: cat.Spec.TenantId}, + BTPTenantIdentification: v1alpha2.BTPTenantIdentification{SubDomain: cat.Spec.SubDomain, TenantId: cat.Spec.TenantId}, CAPApplicationVersionInstance: cav.Name, Steps: steps, }, } addCAPTenantOperationLabels(ctop, cat) // NOTE: this is very important to do here as subsequent reconciliation of tenant will be inconsistent otherwise util.LogInfo("Creating tenant operation", operationTypeMsgMap[opType], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) - return c.crdClient.SmeV1alpha1().CAPTenantOperations(cat.Namespace).Create(ctx, ctop, metav1.CreateOptions{}) + return c.crdClient.SmeV1alpha2().CAPTenantOperations(cat.Namespace).Create(ctx, ctop, metav1.CreateOptions{}) } -func (c *Controller) cleanUpTenantOutputs(ctx context.Context, cat *v1alpha1.CAPTenant) error { +func (c *Controller) cleanUpTenantOutputs(ctx context.Context, cat *v1alpha2.CAPTenant) error { // delete all tenant outputs for this tenant selector, err := labels.ValidatedSelectorFromSet(map[string]string{ LabelTenantId: cat.Spec.TenantId, @@ -456,22 +456,22 @@ func (c *Controller) cleanUpTenantOutputs(ctx context.Context, cat *v1alpha1.CAP if err != nil { return err } - err = c.crdClient.SmeV1alpha1().CAPTenantOutputs(cat.Namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector.String()}) + err = c.crdClient.SmeV1alpha2().CAPTenantOutputs(cat.Namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{LabelSelector: selector.String()}) if err != nil { return fmt.Errorf("deletion of cap tenant outputs failed: %s", err.Error()) } return nil } -func deriveStepsForTenantOperation(cav *v1alpha1.CAPApplicationVersion, opType v1alpha1.CAPTenantOperationType) (steps []v1alpha1.CAPTenantOperationStep, err error) { +func deriveStepsForTenantOperation(cav *v1alpha2.CAPApplicationVersion, opType v1alpha2.CAPTenantOperationType) (steps []v1alpha2.CAPTenantOperationStep, err error) { defaultSteps := func() { // if there are no specified steps, add only one step of type TenantOperation - workload := getRelevantJob(v1alpha1.JobTenantOperation, cav) + workload := getRelevantJob(v1alpha2.JobTenantOperation, cav) if workload == nil { // cannot proceed further without an identified workload - err = fmt.Errorf("could not find workload of type %s in %s %s.%s", v1alpha1.JobTenantOperation, v1alpha1.CAPApplicationVersionKind, cav.Namespace, cav.Name) + err = fmt.Errorf("could not find workload of type %s in %s %s.%s", v1alpha2.JobTenantOperation, v1alpha2.CAPApplicationVersionKind, cav.Namespace, cav.Name) } else { - steps = []v1alpha1.CAPTenantOperationStep{{Name: workload.Name, Type: v1alpha1.JobTenantOperation}} + steps = []v1alpha2.CAPTenantOperationStep{{Name: workload.Name, Type: v1alpha2.JobTenantOperation}} } } @@ -480,13 +480,13 @@ func deriveStepsForTenantOperation(cav *v1alpha1.CAPApplicationVersion, opType v return } - var ops []v1alpha1.TenantOperationWorkloadReference + var ops []v1alpha2.TenantOperationWorkloadReference switch opType { - case v1alpha1.CAPTenantOperationTypeProvisioning: + case v1alpha2.CAPTenantOperationTypeProvisioning: ops = cav.Spec.TenantOperations.Provisioning - case v1alpha1.CAPTenantOperationTypeDeprovisioning: + case v1alpha2.CAPTenantOperationTypeDeprovisioning: ops = cav.Spec.TenantOperations.Deprovisioning - case v1alpha1.CAPTenantOperationTypeUpgrade: + case v1alpha2.CAPTenantOperationTypeUpgrade: ops = cav.Spec.TenantOperations.Upgrade } @@ -495,30 +495,30 @@ func deriveStepsForTenantOperation(cav *v1alpha1.CAPApplicationVersion, opType v return } - steps = []v1alpha1.CAPTenantOperationStep{} + steps = []v1alpha2.CAPTenantOperationStep{} addedTenantOperationJob := false for _, entry := range ops { workload := getWorkloadByName(entry.WorkloadName, cav) switch workload.JobDefinition.Type { - case v1alpha1.JobTenantOperation: + case v1alpha2.JobTenantOperation: addedTenantOperationJob = true fallthrough - case v1alpha1.JobCustomTenantOperation: + case v1alpha2.JobCustomTenantOperation: // continuing the tenant operation on failure is not possible for tenant operation jobs - continueOnFailure := (workload.JobDefinition.Type != v1alpha1.JobTenantOperation) && entry.ContinueOnFailure - steps = append(steps, v1alpha1.CAPTenantOperationStep{Name: entry.WorkloadName, Type: workload.JobDefinition.Type, ContinueOnFailure: continueOnFailure}) + continueOnFailure := (workload.JobDefinition.Type != v1alpha2.JobTenantOperation) && entry.ContinueOnFailure + steps = append(steps, v1alpha2.CAPTenantOperationStep{Name: entry.WorkloadName, Type: workload.JobDefinition.Type, ContinueOnFailure: continueOnFailure}) default: continue // ignore all other types (even if specified) } } if !addedTenantOperationJob { // ensure step of type TenantOperation is added - return nil, fmt.Errorf("specified steps for operation %s does not contain a step of type %s", opType, v1alpha1.JobTenantOperation) + return nil, fmt.Errorf("specified steps for operation %s does not contain a step of type %s", opType, v1alpha2.JobTenantOperation) } return } // trigger CAPTenantOperation creation and change status of tenant -func (c *Controller) triggerTenantOperation(ctx context.Context, cat *v1alpha1.CAPTenant, opType v1alpha1.CAPTenantOperationType) (*ReconcileResult, error) { +func (c *Controller) triggerTenantOperation(ctx context.Context, cat *v1alpha2.CAPTenant, opType v1alpha2.CAPTenantOperationType) (*ReconcileResult, error) { // Create CAPTenantOperation ctop, err := c.createCAPTenantOperation(ctx, cat, opType) if err != nil { @@ -527,11 +527,11 @@ func (c *Controller) triggerTenantOperation(ctx context.Context, cat *v1alpha1.C // call status handler targetInfo := TenantOperationStatusMap[opType].processing - c.Event(cat, ctop, corev1.EventTypeNormal, targetInfo.target.conditionReason, string(targetInfo.target.state), fmt.Sprintf("%s %s.%s of type %s created", v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name, ctop.Spec.Operation)) + c.Event(cat, ctop, corev1.EventTypeNormal, targetInfo.target.conditionReason, string(targetInfo.target.state), fmt.Sprintf("%s %s.%s of type %s created", v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name, ctop.Spec.Operation)) return targetInfo.handler(ctx, c, cat, targetInfo.target, ctop) } -func (c *Controller) getCAPTenantOperationsByType(cat *v1alpha1.CAPTenant, operationTypeSelector CAPTenantOperationTypeSelector) (*IdentifiedCAPTenantOperations, error) { +func (c *Controller) getCAPTenantOperationsByType(cat *v1alpha2.CAPTenant, operationTypeSelector CAPTenantOperationTypeSelector) (*IdentifiedCAPTenantOperations, error) { labelsMap := map[string]string{ LabelOwnerIdentifierHash: sha1Sum(cat.Namespace, cat.Name), } @@ -544,12 +544,12 @@ func (c *Controller) getCAPTenantOperationsByType(cat *v1alpha1.CAPTenant, opera } // Check if tenant operations already exist via cache - ops, err := c.crdInformerFactory.Sme().V1alpha1().CAPTenantOperations().Lister().CAPTenantOperations(cat.Namespace).List(selector) + ops, err := c.crdInformerFactory.Sme().V1alpha2().CAPTenantOperations().Lister().CAPTenantOperations(cat.Namespace).List(selector) if err != nil { return nil, err } - var results = IdentifiedCAPTenantOperations{active: []*v1alpha1.CAPTenantOperation{}, processed: []*v1alpha1.CAPTenantOperation{}} + var results = IdentifiedCAPTenantOperations{active: []*v1alpha2.CAPTenantOperation{}, processed: []*v1alpha2.CAPTenantOperation{}} for _, ctop := range ops { if isCROConditionReady(ctop.Status.GenericStatus) { results.processed = append(results.processed, ctop) @@ -561,13 +561,13 @@ func (c *Controller) getCAPTenantOperationsByType(cat *v1alpha1.CAPTenant, opera return &results, nil } -func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context.Context, cat *v1alpha1.CAPTenant, opType v1alpha1.CAPTenantOperationType) (*v1alpha1.CAPApplicationVersion, error) { +func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context.Context, cat *v1alpha2.CAPTenant, opType v1alpha2.CAPTenantOperationType) (*v1alpha2.CAPApplicationVersion, error) { // get owning CAPApplication ca, _ := c.getCachedCAPApplication(cat.Namespace, cat.Spec.CAPApplicationInstance) // get CAPApplication version switch opType { - case v1alpha1.CAPTenantOperationTypeProvisioning, v1alpha1.CAPTenantOperationTypeUpgrade: // for provisioning or upgrade - use the relevant CAPApplicationVersion + case v1alpha2.CAPTenantOperationTypeProvisioning, v1alpha2.CAPTenantOperationTypeUpgrade: // for provisioning or upgrade - use the relevant CAPApplicationVersion // get relevant CAPApplicationVersion cav, err := c.getRelevantCAPApplicationVersion(ca, cat.Spec.Version) if err != nil { @@ -575,13 +575,13 @@ func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context. } util.LogInfo("Identified application version", operationTypeMsgMap[opType], cat, nil, "tenantId", cat.Spec.TenantId, "version", cav.Spec.Version) return cav, nil - case v1alpha1.CAPTenantOperationTypeDeprovisioning: // for deletion - use the current CAPApplicationVersion (from status) + case v1alpha2.CAPTenantOperationTypeDeprovisioning: // for deletion - use the current CAPApplicationVersion (from status) if cat.Status.CurrentCAPApplicationVersionInstance == "" { - err := fmt.Errorf("cannot identify %s for %s %s.%s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name) + err := fmt.Errorf("cannot identify %s for %s %s.%s", v1alpha2.CAPApplicationVersionKind, v1alpha2.CAPTenantKind, cat.Namespace, cat.Name) util.LogError(err, "Cannot identify application version", string(Deprovisioning), cat, nil, "tenantId", cat.Spec.TenantId) return nil, err } - cav, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions(cat.Namespace).Get(ctx, cat.Status.CurrentCAPApplicationVersionInstance, metav1.GetOptions{}) + cav, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions(cat.Namespace).Get(ctx, cat.Status.CurrentCAPApplicationVersionInstance, metav1.GetOptions{}) if err != nil { return nil, err } @@ -590,19 +590,19 @@ func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context. // In some cases a CAV might get into a non-ready state, but this may not block deprovisioning (e.g. some workloads fail due to issues unrelated to tenant deletion workloads). // Hence, we just log this as an error and attempt to proceed with the deprovisioning. // This is however just a best-case scenario - if the CAV is not ready due to issues also affecting the tenant workloads (e.g. container image not available), the deprovisioning might still fail! - err := fmt.Errorf("%s %s.%s is not %s to be used for %s", v1alpha1.CAPApplicationVersionKind, cav.Namespace, cav.Name, v1alpha1.CAPApplicationVersionStateReady, opType) + err := fmt.Errorf("%s %s.%s is not %s to be used for %s", v1alpha2.CAPApplicationVersionKind, cav.Namespace, cav.Name, v1alpha2.CAPApplicationVersionStateReady, opType) util.LogError(err, "Attempting to delete, despite version not being ready", string(Deprovisioning), cat, cav, "tenantId", cat.Spec.TenantId, "version", cav.Spec.Version) } // verify owner reference if cav.Spec.CAPApplicationInstance != ca.Name { - return nil, fmt.Errorf("found deviating owner references for %s %s.%s and %s %s.%s", v1alpha1.CAPApplicationVersionKind, cav.Namespace, cav.Name, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name) + return nil, fmt.Errorf("found deviating owner references for %s %s.%s and %s %s.%s", v1alpha2.CAPApplicationVersionKind, cav.Namespace, cav.Name, v1alpha2.CAPTenantKind, cat.Namespace, cat.Name) } return cav, nil } - return nil, fmt.Errorf("unknown error when resolving %s for %s %s.%s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name) + return nil, fmt.Errorf("unknown error when resolving %s for %s %s.%s", v1alpha2.CAPApplicationVersionKind, v1alpha2.CAPTenantKind, cat.Namespace, cat.Name) } -func addCAPTenantLabels(cat *v1alpha1.CAPTenant, ca *v1alpha1.CAPApplication) (updated bool) { +func addCAPTenantLabels(cat *v1alpha2.CAPTenant, ca *v1alpha2.CAPApplication) (updated bool) { appMetadata := appMetadataIdentifiers{ providerSubaccountId: ca.Spec.ProviderSubaccountId, appName: ca.Spec.BTPAppName, @@ -622,21 +622,21 @@ func addCAPTenantLabels(cat *v1alpha1.CAPTenant, ca *v1alpha1.CAPApplication) (u return updated } -func (c *Controller) prepareCAPTenant(cat *v1alpha1.CAPTenant) (update bool, err error) { +func (c *Controller) prepareCAPTenant(cat *v1alpha2.CAPTenant) (update bool, err error) { // Do nothing when object is deleted if cat.DeletionTimestamp != nil { return false, nil } ca, err := c.getCachedCAPApplication(cat.Namespace, cat.Spec.CAPApplicationInstance) if err != nil { - msg := fmt.Sprintf("invalid %s reference", v1alpha1.CAPApplicationKind) + msg := fmt.Sprintf("invalid %s reference", v1alpha2.CAPApplicationKind) c.Event(cat, nil, corev1.EventTypeWarning, CAPTenantEventInvalidReference, EventActionPrepare, msg) return false, err } // create owner reference - CAPApplication - if _, ok := getOwnerByKind(cat.OwnerReferences, v1alpha1.CAPApplicationKind); !ok { - cat.OwnerReferences = append(cat.OwnerReferences, *metav1.NewControllerRef(ca, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationKind))) + if _, ok := getOwnerByObject(cat.OwnerReferences, v1alpha2.CAPApplicationKind, ca); !ok { + cat.OwnerReferences = append(cat.OwnerReferences, *metav1.NewControllerRef(ca, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationKind))) update = true } @@ -656,9 +656,9 @@ func (c *Controller) prepareCAPTenant(cat *v1alpha1.CAPTenant) (update bool, err return update, nil } -func (c *Controller) tryForTenantUpgrade(ctx context.Context, cat *v1alpha1.CAPTenant) (*ReconcileResult, error) { +func (c *Controller) tryForTenantUpgrade(ctx context.Context, cat *v1alpha2.CAPTenant) (*ReconcileResult, error) { // try for upgrade only when upgrade strategy is not 'never' - if cat.Spec.VersionUpgradeStrategy == v1alpha1.VersionUpgradeStrategyTypeNever { + if cat.Spec.VersionUpgradeStrategy == v1alpha2.VersionUpgradeStrategyTypeNever { return nil, nil } @@ -676,13 +676,13 @@ func (c *Controller) tryForTenantUpgrade(ctx context.Context, cat *v1alpha1.CAPT // compare with current version if cat.Status.CurrentCAPApplicationVersionInstance != cav.Name { // update status of the CAPTenant - ready for upgrade - return c.triggerTenantOperation(ctx, cat, v1alpha1.CAPTenantOperationTypeUpgrade) + return c.triggerTenantOperation(ctx, cat, v1alpha2.CAPTenantOperationTypeUpgrade) } return nil, nil } -func (c *Controller) updateCAPTenantStatus(ctx context.Context, cat *v1alpha1.CAPTenant) error { +func (c *Controller) updateCAPTenantStatus(ctx context.Context, cat *v1alpha2.CAPTenant) error { if isDeletionImminent(&cat.ObjectMeta) { return nil } @@ -691,7 +691,7 @@ func (c *Controller) updateCAPTenantStatus(ctx context.Context, cat *v1alpha1.CA // initialize conditions - with processing status cat.SetStatusWithReadyCondition(cat.Status.State, metav1.ConditionFalse, CAPTenantEventProcessingStarted, "") } - catUpdated, err := c.crdClient.SmeV1alpha1().CAPTenants(cat.Namespace).UpdateStatus(ctx, cat, metav1.UpdateOptions{}) + catUpdated, err := c.crdClient.SmeV1alpha2().CAPTenants(cat.Namespace).UpdateStatus(ctx, cat, metav1.UpdateOptions{}) // update reference to the resource if catUpdated != nil { *cat = *catUpdated @@ -699,18 +699,16 @@ func (c *Controller) updateCAPTenantStatus(ctx context.Context, cat *v1alpha1.CA return err } -func (*Controller) enforceTenantResourceOwnership(objMeta *metav1.ObjectMeta, typeMeta *metav1.TypeMeta, cat *v1alpha1.CAPTenant) (bool, error) { +func (*Controller) enforceTenantResourceOwnership(objMeta *metav1.ObjectMeta, cat *v1alpha2.CAPTenant) (bool, error) { var update bool // verify owner references - if owner, ok := getOwnerByKind(objMeta.OwnerReferences, v1alpha1.CAPTenantKind); !ok { + if _, ok := getOwnerByObject(objMeta.OwnerReferences, v1alpha2.CAPTenantKind, cat); !ok { // set owner reference if objMeta.OwnerReferences == nil { objMeta.OwnerReferences = []metav1.OwnerReference{} } - objMeta.OwnerReferences = append(objMeta.OwnerReferences, *metav1.NewControllerRef(cat, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantKind))) + objMeta.OwnerReferences = append(objMeta.OwnerReferences, *metav1.NewControllerRef(cat, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantKind))) update = true - } else if owner.Name != cat.Name { - return false, fmt.Errorf("invalid owner reference found for %s %s.%s", typeMeta.Kind, objMeta.Namespace, objMeta.Name) } if addCommonTenantLabels(objMeta, cat) { @@ -720,7 +718,7 @@ func (*Controller) enforceTenantResourceOwnership(objMeta *metav1.ObjectMeta, ty return update, nil } -func addCommonTenantLabels(objMeta *metav1.ObjectMeta, cat *v1alpha1.CAPTenant) (updated bool) { +func addCommonTenantLabels(objMeta *metav1.ObjectMeta, cat *v1alpha2.CAPTenant) (updated bool) { appMetadata := appMetadataIdentifiers{ ownerInfo: &ownerInfo{ ownerNamespace: cat.Namespace, diff --git a/internal/controller/reconcile-captenant_test.go b/internal/controller/reconcile-captenant_test.go index 12302423..47cb9ad6 100644 --- a/internal/controller/reconcile-captenant_test.go +++ b/internal/controller/reconcile-captenant_test.go @@ -9,7 +9,7 @@ import ( "context" "testing" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) func TestInvalidCAPApplication(t *testing.T) { @@ -285,7 +285,7 @@ func TestCAPTenantUpgradeOperationCompleted(t *testing.T) { } func TestCAPTenantUpgradeOperationCompletedPreviousVersionsLimited(t *testing.T) { - t.Setenv(v1alpha1.EnvMaxTenantVersionHistory, "3") + t.Setenv(v1alpha2.EnvMaxTenantVersionHistory, "3") reconcileTestItem( context.TODO(), t, QueueItem{Key: ResourceCAPTenant, ResourceKey: NamespacedResourceKey{Namespace: "default", Name: "test-cap-01-provider"}}, @@ -306,28 +306,6 @@ func TestCAPTenantUpgradeOperationCompletedPreviousVersionsLimited(t *testing.T) ) } -func TestCAPTenantUpgradeRequestCompletedIncorrectVirtualServiceOwner(t *testing.T) { - err := reconcileTestItem( - context.TODO(), t, - QueueItem{Key: ResourceCAPTenant, ResourceKey: NamespacedResourceKey{Namespace: "default", Name: "test-cap-01-provider"}}, - TestData{ - description: "captenant upgrade operation completed, existing virtual service owner wrong", - initialResources: []string{ - "testdata/common/domain-ready.yaml", - "testdata/common/cluster-domain-ready.yaml", - "testdata/common/capapplication.yaml", - "testdata/common/capapplicationversion-v1.yaml", - "testdata/common/capapplicationversion-v2.yaml", - "testdata/captenant/cat-22.initial.yaml", - }, - expectError: true, - }, - ) - if err.Error() != "invalid owner reference found for VirtualService default.test-cap-01-provider" { - t.Error("wrong error message") - } -} - func TestCAPTenantUpgradeRequestCompletedWithDeletionTriggered(t *testing.T) { reconcileTestItem( context.TODO(), t, diff --git a/internal/controller/reconcile-captenantoperation.go b/internal/controller/reconcile-captenantoperation.go index 9e801210..e48ea1db 100644 --- a/internal/controller/reconcile-captenantoperation.go +++ b/internal/controller/reconcile-captenantoperation.go @@ -13,7 +13,7 @@ import ( "time" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -35,9 +35,9 @@ const ( ) type cros struct { - CAPTenant *v1alpha1.CAPTenant - CAPApplication *v1alpha1.CAPApplication - CAPApplicationVersion *v1alpha1.CAPApplicationVersion + CAPTenant *v1alpha2.CAPTenant + CAPApplication *v1alpha2.CAPApplication + CAPApplicationVersion *v1alpha2.CAPApplicationVersion } const ( @@ -54,7 +54,7 @@ const ( ) func (c *Controller) reconcileCAPTenantOperation(ctx context.Context, item QueueItem, _ int) (result *ReconcileResult, err error) { - cached, err := c.crdInformerFactory.Sme().V1alpha1().CAPTenantOperations().Lister().CAPTenantOperations(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) + cached, err := c.crdInformerFactory.Sme().V1alpha2().CAPTenantOperations().Lister().CAPTenantOperations(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) if err != nil { return nil, handleOperatorResourceErrors(err) @@ -83,20 +83,20 @@ func (c *Controller) reconcileCAPTenantOperation(ctx context.Context, item Queue return result, err } -func (c *Controller) updateCAPTenantOperationStatus(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) error { +func (c *Controller) updateCAPTenantOperationStatus(ctx context.Context, ctop *v1alpha2.CAPTenantOperation) error { if isDeletionImminent(&ctop.ObjectMeta) { return nil } if ctop.DeletionTimestamp != nil { // set appropriate state for deletion - ctop.Status.State = v1alpha1.CAPTenantOperationStateDeleting + ctop.Status.State = v1alpha2.CAPTenantOperationStateDeleting } else if ctop.Status.State == "" { // start processing - ctop.Status.State = v1alpha1.CAPTenantOperationStateProcessing + ctop.Status.State = v1alpha2.CAPTenantOperationStateProcessing } - ctopUpdated, err := c.crdClient.SmeV1alpha1().CAPTenantOperations(ctop.Namespace).UpdateStatus(ctx, ctop, metav1.UpdateOptions{}) + ctopUpdated, err := c.crdClient.SmeV1alpha2().CAPTenantOperations(ctop.Namespace).UpdateStatus(ctx, ctop, metav1.UpdateOptions{}) // update reference to the resource if ctopUpdated != nil { *ctop = *ctopUpdated @@ -104,21 +104,21 @@ func (c *Controller) updateCAPTenantOperationStatus(ctx context.Context, ctop *v return err } -func (c *Controller) prepareCAPTenantOperation(ctop *v1alpha1.CAPTenantOperation) (update bool, err error) { +func (c *Controller) prepareCAPTenantOperation(ctop *v1alpha2.CAPTenantOperation) (update bool, err error) { // Do nothing when object is deleted if ctop.DeletionTimestamp != nil { return false, nil } cat, err := c.getCachedCAPTenant(ctop.Namespace, ctop.Spec.TenantId, true) if err != nil { - msg := fmt.Sprintf("invalid %s reference", v1alpha1.CAPTenantKind) + msg := fmt.Sprintf("invalid %s reference", v1alpha2.CAPTenantKind) c.Event(ctop, nil, corev1.EventTypeWarning, CAPTenantOperationEventInvalidReference, EventActionPrepare, msg) return false, err } // create owner reference - CAPTenant - if _, ok := getOwnerByKind(ctop.OwnerReferences, v1alpha1.CAPTenantKind); !ok { - ctop.OwnerReferences = append(ctop.OwnerReferences, *metav1.NewControllerRef(cat, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantKind))) + if _, ok := getOwnerByObject(ctop.OwnerReferences, v1alpha2.CAPTenantKind, cat); !ok { + ctop.OwnerReferences = append(ctop.OwnerReferences, *metav1.NewControllerRef(cat, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantKind))) update = true } @@ -127,7 +127,7 @@ func (c *Controller) prepareCAPTenantOperation(ctop *v1alpha1.CAPTenantOperation } // copy over the subscription context secret from tenant if any - if ctop.Spec.Operation == v1alpha1.CAPTenantOperationTypeProvisioning && cat.Annotations[AnnotationSubscriptionContextSecret] != "" { + if ctop.Spec.Operation == v1alpha2.CAPTenantOperationTypeProvisioning && cat.Annotations[AnnotationSubscriptionContextSecret] != "" { ctop.Annotations[AnnotationSubscriptionContextSecret] = cat.Annotations[AnnotationSubscriptionContextSecret] } @@ -144,18 +144,18 @@ func (c *Controller) prepareCAPTenantOperation(ctop *v1alpha1.CAPTenantOperation return } -func (c *Controller) getCachedCAPTenantFromOwnerReferences(refs []metav1.OwnerReference, namespace string) (*v1alpha1.CAPTenant, error) { +func (c *Controller) getCachedCAPTenantFromOwnerReferences(refs []metav1.OwnerReference, namespace string) (*v1alpha2.CAPTenant, error) { // get owning CAPTenant - owner, ok := getOwnerByKind(refs, v1alpha1.CAPTenantKind) + owner, ok := getOwnerByKind(refs, v1alpha2.CAPTenantKind, v1alpha2.Group) if !ok { - return nil, fmt.Errorf("could not find %s as owner reference", v1alpha1.CAPTenantKind) + return nil, fmt.Errorf("could not find %s as owner reference", v1alpha2.CAPTenantKind) } return c.getCachedCAPTenant(namespace, owner.Name, false) } -func (c *Controller) updateCAPTenantOperation(ctx context.Context, ctop *v1alpha1.CAPTenantOperation, requeue bool) (result *ReconcileResult, err error) { - var ctopUpdated *v1alpha1.CAPTenantOperation - ctopUpdated, err = c.crdClient.SmeV1alpha1().CAPTenantOperations(ctop.Namespace).Update(ctx, ctop, metav1.UpdateOptions{}) +func (c *Controller) updateCAPTenantOperation(ctx context.Context, ctop *v1alpha2.CAPTenantOperation, requeue bool) (result *ReconcileResult, err error) { + var ctopUpdated *v1alpha2.CAPTenantOperation + ctopUpdated, err = c.crdClient.SmeV1alpha2().CAPTenantOperations(ctop.Namespace).Update(ctx, ctop, metav1.UpdateOptions{}) // Update reference to the resource if ctopUpdated != nil { *ctop = *ctopUpdated @@ -166,7 +166,7 @@ func (c *Controller) updateCAPTenantOperation(ctx context.Context, ctop *v1alpha return } -func (c *Controller) handleCAPTenantOperationDeletion(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) { +func (c *Controller) handleCAPTenantOperationDeletion(ctx context.Context, ctop *v1alpha2.CAPTenantOperation) (*ReconcileResult, error) { // remove finalizer if removeFinalizer(&ctop.Finalizers, FinalizerCAPTenantOperation) { util.LogInfo("Removing finalizer; finished deleting this tenant operation", string(Deleting), ctop, nil, "tenantId", ctop.Spec.TenantId, "version", ctop.Labels[LabelCAVVersion]) @@ -175,7 +175,7 @@ func (c *Controller) handleCAPTenantOperationDeletion(ctx context.Context, ctop return nil, nil } -func (c *Controller) reconcileTenantOperationSteps(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) (result *ReconcileResult, err error) { +func (c *Controller) reconcileTenantOperationSteps(ctx context.Context, ctop *v1alpha2.CAPTenantOperation) (result *ReconcileResult, err error) { /* NOTE REGARDING STEPS: * - Initially the the first step (1) is identified and updated in the status * - the job for the current step is created only in the next pass, which ensures that the current step in the status is always consistent @@ -193,8 +193,8 @@ func (c *Controller) reconcileTenantOperationSteps(ctx context.Context, ctop *v1 if ctop.Status.CurrentStep == nil { // set initial step if len(ctop.Spec.Steps) == 0 { - err = fmt.Errorf("operation steps missing in %s %s.%s", v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name) - ctop.SetStatusWithReadyCondition(v1alpha1.CAPTenantOperationStateFailed, metav1.ConditionTrue, CAPTenantOperationConditionReasonStepProcessingError, err.Error()) + err = fmt.Errorf("operation steps missing in %s %s.%s", v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name) + ctop.SetStatusWithReadyCondition(v1alpha2.CAPTenantOperationStateFailed, metav1.ConditionTrue, CAPTenantOperationConditionReasonStepProcessingError, err.Error()) return } var initStep uint32 = 1 @@ -226,7 +226,7 @@ func (c *Controller) reconcileTenantOperationSteps(ctx context.Context, ctop *v1 return } -func (c *Controller) getActiveCAPTenantOperationJob(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) (*batchv1.Job, error) { +func (c *Controller) getActiveCAPTenantOperationJob(ctx context.Context, ctop *v1alpha2.CAPTenantOperation) (*batchv1.Job, error) { // NOTE: read using label selector from the api server (not the cache) currentStep := ctop.Spec.Steps[*ctop.Status.CurrentStep-1] labelsMap := map[string]string{ @@ -248,14 +248,14 @@ func (c *Controller) getActiveCAPTenantOperationJob(ctx context.Context, ctop *v case 1: return &jobs.Items[0], nil default: - return nil, fmt.Errorf("multiple jobs exist for step %v of %s %s.%s", *ctop.Status.CurrentStep, v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name) + return nil, fmt.Errorf("multiple jobs exist for step %v of %s %s.%s", *ctop.Status.CurrentStep, v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name) } } -func (c *Controller) setCAPTenantOperationStatusFromJob(ctop *v1alpha1.CAPTenantOperation, job *batchv1.Job) (result *ReconcileResult) { +func (c *Controller) setCAPTenantOperationStatusFromJob(ctop *v1alpha2.CAPTenantOperation, job *batchv1.Job) (result *ReconcileResult) { var requeueAfter time.Duration = 1 * time.Second status := struct { - state v1alpha1.CAPTenantOperationState + state v1alpha2.CAPTenantOperationState conditionReason string conditionStatus metav1.ConditionStatus conditionMessage string @@ -273,12 +273,12 @@ func (c *Controller) setCAPTenantOperationStatusFromJob(ctop *v1alpha1.CAPTenant util.LogInfo("Tenant operation job "+job.Name+" completed", string(Processing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, "version", ctop.Labels[LabelCAVVersion]) if isFinalStep { - status.state = v1alpha1.CAPTenantOperationStateCompleted + status.state = v1alpha2.CAPTenantOperationStateCompleted status.conditionStatus = metav1.ConditionTrue ctop.SetStatusCurrentStep(nil, nil) util.LogInfo("Completed all tenant operation job(s) successfully", string(Ready), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, "version", ctop.Labels[LabelCAVVersion]) } else { - status.state = v1alpha1.CAPTenantOperationStateProcessing + status.state = v1alpha2.CAPTenantOperationStateProcessing status.conditionStatus = metav1.ConditionFalse nxtStep := *ctop.Status.CurrentStep + 1 ctop.SetStatusCurrentStep(&nxtStep, nil) @@ -299,14 +299,14 @@ func (c *Controller) setCAPTenantOperationStatusFromJob(ctop *v1alpha1.CAPTenant processStepCompletion() // NOTE: condition.reason needs to be set to StepCompleted in this case, as this is looked up by the CAPTenant } else { status.conditionReason = CAPTenantOperationConditionReasonStepFailed - status.state = v1alpha1.CAPTenantOperationStateFailed + status.state = v1alpha2.CAPTenantOperationStateFailed status.conditionStatus = metav1.ConditionTrue ctop.SetStatusCurrentStep(nil, nil) } case JobStateProcessing: status.conditionReason = CAPTenantOperationConditionReasonStepProcessing status.conditionMessage = fmt.Sprintf("step %v/%v : waiting for job %s.%s", *ctop.Status.CurrentStep, len(ctop.Spec.Steps), job.Namespace, job.Name) - status.state = v1alpha1.CAPTenantOperationStateProcessing + status.state = v1alpha2.CAPTenantOperationStateProcessing status.conditionStatus = metav1.ConditionFalse requeueAfter = 15 * time.Second } @@ -319,7 +319,7 @@ func (c *Controller) setCAPTenantOperationStatusFromJob(ctop *v1alpha1.CAPTenant return NewReconcileResultWithResource(ResourceCAPTenantOperation, ctop.Name, ctop.Namespace, requeueAfter) } -func (c *Controller) getCAPResourcesFromCAPTenantOperation(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) (*cros, error) { +func (c *Controller) getCAPResourcesFromCAPTenantOperation(ctx context.Context, ctop *v1alpha2.CAPTenantOperation) (*cros, error) { // get owning CAPTenant cat, err := c.getCachedCAPTenantFromOwnerReferences(ctop.OwnerReferences, ctop.Namespace) if err != nil { @@ -327,9 +327,9 @@ func (c *Controller) getCAPResourcesFromCAPTenantOperation(ctx context.Context, } // get owning CAPApplication - owner, ok := getOwnerByKind(cat.OwnerReferences, v1alpha1.CAPApplicationKind) + owner, ok := getOwnerByKind(cat.OwnerReferences, v1alpha2.CAPApplicationKind, v1alpha2.Group) if !ok { - return nil, fmt.Errorf("%s could not be identified for %s %s.%s", v1alpha1.CAPApplicationKind, v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name) + return nil, fmt.Errorf("%s could not be identified for %s %s.%s", v1alpha2.CAPApplicationKind, v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name) } ca, err := c.getCachedCAPApplication(cat.Namespace, owner.Name) if err != nil { @@ -337,14 +337,14 @@ func (c *Controller) getCAPResourcesFromCAPTenantOperation(ctx context.Context, } // get specified CAPApplicationVersion - cav, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions(ca.Namespace).Get(ctx, ctop.Spec.CAPApplicationVersionInstance, metav1.GetOptions{}) + cav, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions(ca.Namespace).Get(ctx, ctop.Spec.CAPApplicationVersionInstance, metav1.GetOptions{}) if err != nil { return nil, err } // verify status of CAPApplicationVersion if !isCROConditionReady(cav.Status.GenericStatus) { - err := fmt.Errorf("%s %s is not %s to be used in %s %s.%s", v1alpha1.CAPApplicationVersionKind, cav.Name, v1alpha1.CAPApplicationVersionStateReady, v1alpha1.CAPTenantOperationKind, ctop.Namespace, ctop.Name) - if ctop.Spec.Operation != v1alpha1.CAPTenantOperationTypeDeprovisioning { + err := fmt.Errorf("%s %s is not %s to be used in %s %s.%s", v1alpha2.CAPApplicationVersionKind, cav.Name, v1alpha2.CAPApplicationVersionStateReady, v1alpha2.CAPTenantOperationKind, ctop.Namespace, ctop.Name) + if ctop.Spec.Operation != v1alpha2.CAPTenantOperationTypeDeprovisioning { return nil, err } else { // In some cases a CAV might get into a non-ready state, but this may not block deprovisioning (e.g. some workloads fail due to issues unrelated to tenant deletion workloads). @@ -362,7 +362,7 @@ func (c *Controller) getCAPResourcesFromCAPTenantOperation(ctx context.Context, }, nil } -func (c *Controller) initiateJobForCAPTenantOperationStep(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) (result *ReconcileResult, err error) { +func (c *Controller) initiateJobForCAPTenantOperationStep(ctx context.Context, ctop *v1alpha2.CAPTenantOperation) (result *ReconcileResult, err error) { relatedResources, err := c.getCAPResourcesFromCAPTenantOperation(ctx, ctop) if err != nil { return nil, err @@ -372,15 +372,15 @@ func (c *Controller) initiateJobForCAPTenantOperationStep(ctx context.Context, c step := ctop.Spec.Steps[*ctop.Status.CurrentStep-1] workload := getWorkloadByName(step.Name, relatedResources.CAPApplicationVersion) if workload == nil { - return nil, fmt.Errorf("could not find workload %s in %s %s.%s", step.Name, v1alpha1.CAPApplicationVersionKind, relatedResources.CAPApplicationVersion.Namespace, relatedResources.CAPApplicationVersion.Name) + return nil, fmt.Errorf("could not find workload %s in %s %s.%s", step.Name, v1alpha2.CAPApplicationVersionKind, relatedResources.CAPApplicationVersion.Namespace, relatedResources.CAPApplicationVersion.Name) } if workload.JobDefinition == nil { - return nil, fmt.Errorf("workload %s in %s %s.%s has no job definition", step.Name, v1alpha1.CAPApplicationVersionKind, relatedResources.CAPApplicationVersion.Namespace, relatedResources.CAPApplicationVersion.Name) + return nil, fmt.Errorf("workload %s in %s %s.%s has no job definition", step.Name, v1alpha2.CAPApplicationVersionKind, relatedResources.CAPApplicationVersion.Namespace, relatedResources.CAPApplicationVersion.Name) } // create VCAP secret from consumed BTP services consumedServiceInfos := getConsumedServiceInfos(getConsumedServiceMap(workload.ConsumedBTPServices), relatedResources.CAPApplication.Spec.BTP.Services) - vcapSecretName, err := c.createVCAPSecret(ctop.Name+"-"+strings.ToLower(workload.Name), ctop.Namespace, *metav1.NewControllerRef(ctop, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantOperationKind)), consumedServiceInfos) + vcapSecretName, err := c.createVCAPSecret(ctop.Name+"-"+strings.ToLower(workload.Name), ctop.Namespace, *metav1.NewControllerRef(ctop, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantOperationKind)), consumedServiceInfos) if err != nil { return nil, err } @@ -418,7 +418,7 @@ func (c *Controller) initiateJobForCAPTenantOperationStep(ctx context.Context, c } var job *batchv1.Job - if ctop.Spec.Steps[*ctop.Status.CurrentStep-1].Type == v1alpha1.JobTenantOperation { + if ctop.Spec.Steps[*ctop.Status.CurrentStep-1].Type == v1alpha2.JobTenantOperation { job, err = c.createTenantOperationJob(ctx, ctop, workload, params) } else { // custom tenant operation job, err = c.createCustomTenantOperationJob(ctx, ctop, workload, params) @@ -430,7 +430,7 @@ func (c *Controller) initiateJobForCAPTenantOperationStep(ctx context.Context, c msg := fmt.Sprintf("step %v/%v : job %s.%s created", *ctop.Status.CurrentStep, len(ctop.Spec.Steps), job.Namespace, job.Name) util.LogInfo("Tenant operation job "+job.Name+" created successfully", string(Processing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, "version", ctop.Labels[LabelCAVVersion]) - ctop.SetStatusWithReadyCondition(v1alpha1.CAPTenantOperationStateProcessing, metav1.ConditionFalse, CAPTenantOperationConditionReasonStepInitiated, msg) + ctop.SetStatusWithReadyCondition(v1alpha2.CAPTenantOperationStateProcessing, metav1.ConditionFalse, CAPTenantOperationConditionReasonStepInitiated, msg) ctop.SetStatusCurrentStep(ctop.Status.CurrentStep, &job.Name) c.Event(ctop, job, corev1.EventTypeNormal, CAPTenantOperationConditionReasonStepInitiated, EventActionCreateJob, msg) @@ -451,7 +451,7 @@ type jobCreateParams struct { tenantType string } -func (c *Controller) createTenantOperationJob(ctx context.Context, ctop *v1alpha1.CAPTenantOperation, workload *v1alpha1.WorkloadDetails, params *jobCreateParams) (*batchv1.Job, error) { +func (c *Controller) createTenantOperationJob(ctx context.Context, ctop *v1alpha2.CAPTenantOperation, workload *v1alpha2.WorkloadDetails, params *jobCreateParams) (*batchv1.Job, error) { // create job for tenant operation (provisioning / upgrade / deprovisioning) job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ @@ -459,7 +459,7 @@ func (c *Controller) createTenantOperationJob(ctx context.Context, ctop *v1alpha Namespace: ctop.Namespace, Labels: params.labels, Annotations: params.annotations, - OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(ctop, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantOperationKind))}, + OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(ctop, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantOperationKind))}, }, Spec: batchv1.JobSpec{ BackoffLimit: workload.JobDefinition.BackoffLimit, @@ -474,7 +474,7 @@ func (c *Controller) createTenantOperationJob(ctx context.Context, ctop *v1alpha RestartPolicy: getRestartPolicy(workload.JobDefinition.RestartPolicy, true), ImagePullSecrets: params.imagePullSecrets, Containers: getContainers(ctop, workload, params), - InitContainers: *updateInitContainers(workload.JobDefinition.InitContainers, getCTOPEnv(params, ctop, v1alpha1.JobTenantOperation), params.vcapSecretName), + InitContainers: *updateInitContainers(workload.JobDefinition.InitContainers, getCTOPEnv(params, ctop, v1alpha2.JobTenantOperation), params.vcapSecretName), Volumes: workload.JobDefinition.Volumes, ServiceAccountName: workload.JobDefinition.ServiceAccountName, SecurityContext: workload.JobDefinition.PodSecurityContext, @@ -494,12 +494,12 @@ func (c *Controller) createTenantOperationJob(ctx context.Context, ctop *v1alpha return c.kubeClient.BatchV1().Jobs(ctop.Namespace).Create(ctx, job, metav1.CreateOptions{}) } -func getContainers(ctop *v1alpha1.CAPTenantOperation, workload *v1alpha1.WorkloadDetails, params *jobCreateParams) []corev1.Container { +func getContainers(ctop *v1alpha2.CAPTenantOperation, workload *v1alpha2.WorkloadDetails, params *jobCreateParams) []corev1.Container { container := &corev1.Container{ Name: workload.Name, Image: workload.JobDefinition.Image, ImagePullPolicy: workload.JobDefinition.ImagePullPolicy, - Env: append(getCTOPEnv(params, ctop, v1alpha1.JobTenantOperation), workload.JobDefinition.Env...), + Env: append(getCTOPEnv(params, ctop, v1alpha2.JobTenantOperation), workload.JobDefinition.Env...), EnvFrom: getEnvFrom(params.vcapSecretName), VolumeMounts: workload.JobDefinition.VolumeMounts, Resources: workload.JobDefinition.Resources, @@ -513,7 +513,7 @@ func getContainers(ctop *v1alpha1.CAPTenantOperation, workload *v1alpha1.Workloa } else { container.Command = []string{"node", "./node_modules/@sap/cds-mtxs/bin/cds-mtx"} // Use entrypoint for mtxs as the command container.Args = []string{`$(` + EnvCAPOpTenantMtxsOperation + `)`, ctop.Spec.TenantId} - if ctop.Spec.Operation == v1alpha1.CAPTenantOperationTypeProvisioning { + if ctop.Spec.Operation == v1alpha2.CAPTenantOperationTypeProvisioning { container.Args = append(container.Args, "--body", `$(`+EnvCAPOpSubscriptionPayload+`)`) } } @@ -521,7 +521,7 @@ func getContainers(ctop *v1alpha1.CAPTenantOperation, workload *v1alpha1.Workloa return append([]corev1.Container{}, *container) } -func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v1alpha1.CAPTenantOperation, workload *v1alpha1.WorkloadDetails, params *jobCreateParams) (*batchv1.Job, error) { +func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v1alpha2.CAPTenantOperation, workload *v1alpha2.WorkloadDetails, params *jobCreateParams) (*batchv1.Job, error) { // create job for custom tenant operation job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ @@ -529,7 +529,7 @@ func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v Namespace: ctop.Namespace, Labels: params.labels, Annotations: params.annotations, - OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(ctop, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantOperationKind))}, + OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(ctop, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantOperationKind))}, }, Spec: batchv1.JobSpec{ BackoffLimit: workload.JobDefinition.BackoffLimit, @@ -558,7 +558,7 @@ func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v Name: workload.Name, Image: workload.JobDefinition.Image, ImagePullPolicy: workload.JobDefinition.ImagePullPolicy, - Env: append(getCTOPEnv(params, ctop, v1alpha1.JobCustomTenantOperation), workload.JobDefinition.Env...), + Env: append(getCTOPEnv(params, ctop, v1alpha2.JobCustomTenantOperation), workload.JobDefinition.Env...), EnvFrom: getEnvFrom(params.vcapSecretName), VolumeMounts: workload.JobDefinition.VolumeMounts, Command: workload.JobDefinition.Command, @@ -568,7 +568,7 @@ func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v Lifecycle: workload.JobDefinition.Lifecycle, }, }, - InitContainers: *updateInitContainers(workload.JobDefinition.InitContainers, getCTOPEnv(params, ctop, v1alpha1.JobCustomTenantOperation), params.vcapSecretName), + InitContainers: *updateInitContainers(workload.JobDefinition.InitContainers, getCTOPEnv(params, ctop, v1alpha2.JobCustomTenantOperation), params.vcapSecretName), }, }, }, @@ -578,7 +578,7 @@ func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v return c.kubeClient.BatchV1().Jobs(ctop.Namespace).Create(ctx, job, metav1.CreateOptions{}) } -func addCAPTenantOperationLabels(ctop *v1alpha1.CAPTenantOperation, cat *v1alpha1.CAPTenant) (updated bool) { +func addCAPTenantOperationLabels(ctop *v1alpha2.CAPTenantOperation, cat *v1alpha2.CAPTenant) (updated bool) { if addCommonTenantLabels(&ctop.ObjectMeta, cat) { updated = true } @@ -605,7 +605,7 @@ func addCAPTenantOperationLabels(ctop *v1alpha1.CAPTenantOperation, cat *v1alpha return updated } -func getCTOPEnv(params *jobCreateParams, ctop *v1alpha1.CAPTenantOperation, stepType v1alpha1.JobType) []corev1.EnvVar { +func getCTOPEnv(params *jobCreateParams, ctop *v1alpha2.CAPTenantOperation, stepType v1alpha2.JobType) []corev1.EnvVar { env := []corev1.EnvVar{ {Name: EnvCAPOpAppVersion, Value: params.version}, {Name: EnvCAPOpTenantId, Value: ctop.Spec.TenantId}, @@ -625,13 +625,13 @@ func getCTOPEnv(params *jobCreateParams, ctop *v1alpha1.CAPTenantOperation, step env = append(env, corev1.EnvVar{Name: EnvCAPOpProviderSubDomain, Value: params.providerSubdomain}) } - if stepType == v1alpha1.JobTenantOperation { + if stepType == v1alpha2.JobTenantOperation { var operation string switch ctop.Spec.Operation { - case v1alpha1.CAPTenantOperationTypeProvisioning: + case v1alpha2.CAPTenantOperationTypeProvisioning: operation = "subscribe" env = append(env, corev1.EnvVar{Name: EnvCAPOpSubscriptionPayload, ValueFrom: &corev1.EnvVarSource{SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: ctop.Annotations[AnnotationSubscriptionContextSecret]}, Key: SubscriptionContext}}}) - case v1alpha1.CAPTenantOperationTypeUpgrade: + case v1alpha2.CAPTenantOperationTypeUpgrade: operation = "upgrade" default: // deprovisioning operation = "unsubscribe" @@ -643,14 +643,14 @@ func getCTOPEnv(params *jobCreateParams, ctop *v1alpha1.CAPTenantOperation, step } // Collect tenant operation metrics based on the status of the tenant operation -func collectTenantOperationMetrics(ctop *v1alpha1.CAPTenantOperation) { +func collectTenantOperationMetrics(ctop *v1alpha2.CAPTenantOperation) { relevantAppIdHash := ctop.Labels[LabelAppIdHash] if isCROConditionReady(ctop.Status.GenericStatus) { // Collect/Increment overall completed tenant operation metrics TenantOperations.WithLabelValues(relevantAppIdHash, string(ctop.Spec.Operation)).Inc() - if ctop.Status.State == v1alpha1.CAPTenantOperationStateFailed { + if ctop.Status.State == v1alpha2.CAPTenantOperationStateFailed { // Collect/Increment failed tenant operation metrics with CRO details TenantOperationFailures.WithLabelValues(relevantAppIdHash, string(ctop.Spec.Operation), ctop.Spec.TenantId, ctop.Namespace, ctop.Name).Inc() } diff --git a/internal/controller/reconcile-domain.go b/internal/controller/reconcile-domain.go index 02bb7e4c..6bfb9c04 100644 --- a/internal/controller/reconcile-domain.go +++ b/internal/controller/reconcile-domain.go @@ -13,7 +13,7 @@ import ( "time" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "golang.org/x/sync/errgroup" networkingv1 "istio.io/api/networking/v1" istionwv1 "istio.io/client-go/pkg/apis/networking/v1" @@ -37,7 +37,7 @@ const ( ) func (c *Controller) reconcileDomain(ctx context.Context, item QueueItem, _ int) (result *ReconcileResult, err error) { - lister := c.crdInformerFactory.Sme().V1alpha1().Domains().Lister() + lister := c.crdInformerFactory.Sme().V1alpha2().Domains().Lister() cached, err := lister.Domains(item.ResourceKey.Namespace).Get(item.ResourceKey.Name) if err != nil { return nil, handleOperatorResourceErrors(err) @@ -62,7 +62,7 @@ func (c *Controller) reconcileDomain(ctx context.Context, item QueueItem, _ int) } func (c *Controller) reconcileClusterDomain(ctx context.Context, item QueueItem, _ int) (result *ReconcileResult, err error) { - lister := c.crdInformerFactory.Sme().V1alpha1().ClusterDomains().Lister() + lister := c.crdInformerFactory.Sme().V1alpha2().ClusterDomains().Lister() cached, err := lister.ClusterDomains(corev1.NamespaceAll).Get(item.ResourceKey.Name) if err != nil { return nil, handleOperatorResourceErrors(err) @@ -86,8 +86,8 @@ func (c *Controller) reconcileClusterDomain(ctx context.Context, item QueueItem, return reconcileDomainEntity(ctx, c, dom, util.GetNamespace()) } -func (c *Controller) updateDomain(ctx context.Context, dom *v1alpha1.Domain) error { - domUpdated, err := c.crdClient.SmeV1alpha1().Domains(dom.Namespace).Update(ctx, dom, metav1.UpdateOptions{}) +func (c *Controller) updateDomain(ctx context.Context, dom *v1alpha2.Domain) error { + domUpdated, err := c.crdClient.SmeV1alpha2().Domains(dom.Namespace).Update(ctx, dom, metav1.UpdateOptions{}) // Update reference to the resource if domUpdated != nil { *dom = *domUpdated @@ -95,11 +95,11 @@ func (c *Controller) updateDomain(ctx context.Context, dom *v1alpha1.Domain) err return err } -func (c *Controller) updateDomainStatus(ctx context.Context, dom *v1alpha1.Domain) error { +func (c *Controller) updateDomainStatus(ctx context.Context, dom *v1alpha2.Domain) error { if isDeletionImminent(&dom.ObjectMeta) { return nil } - domUpdated, err := c.crdClient.SmeV1alpha1().Domains(dom.Namespace).UpdateStatus(ctx, dom, metav1.UpdateOptions{}) + domUpdated, err := c.crdClient.SmeV1alpha2().Domains(dom.Namespace).UpdateStatus(ctx, dom, metav1.UpdateOptions{}) // update reference to the resource if domUpdated != nil { *dom = *domUpdated @@ -107,8 +107,8 @@ func (c *Controller) updateDomainStatus(ctx context.Context, dom *v1alpha1.Domai return err } -func (c *Controller) updateClusterDomain(ctx context.Context, dom *v1alpha1.ClusterDomain) error { - domUpdated, err := c.crdClient.SmeV1alpha1().ClusterDomains(corev1.NamespaceAll).Update(ctx, dom, metav1.UpdateOptions{}) +func (c *Controller) updateClusterDomain(ctx context.Context, dom *v1alpha2.ClusterDomain) error { + domUpdated, err := c.crdClient.SmeV1alpha2().ClusterDomains(corev1.NamespaceAll).Update(ctx, dom, metav1.UpdateOptions{}) // Update reference to the resource if domUpdated != nil { *dom = *domUpdated @@ -116,11 +116,11 @@ func (c *Controller) updateClusterDomain(ctx context.Context, dom *v1alpha1.Clus return err } -func (c *Controller) updateClusterDomainStatus(ctx context.Context, dom *v1alpha1.ClusterDomain) error { +func (c *Controller) updateClusterDomainStatus(ctx context.Context, dom *v1alpha2.ClusterDomain) error { if isDeletionImminent(&dom.ObjectMeta) { return nil } - domUpdated, err := c.crdClient.SmeV1alpha1().ClusterDomains(corev1.NamespaceAll).UpdateStatus(ctx, dom, metav1.UpdateOptions{}) + domUpdated, err := c.crdClient.SmeV1alpha2().ClusterDomains(corev1.NamespaceAll).UpdateStatus(ctx, dom, metav1.UpdateOptions{}) // update reference to the resource if domUpdated != nil { *dom = *domUpdated @@ -128,7 +128,7 @@ func (c *Controller) updateClusterDomainStatus(ctx context.Context, dom *v1alpha return err } -func reconcileDomainEntity[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, subResourceNamespace string) (result *ReconcileResult, err error) { +func reconcileDomainEntity[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, subResourceNamespace string) (result *ReconcileResult, err error) { // Check if the domain resource is being deleted if dom.GetMetadata().DeletionTimestamp != nil { return handleDomainResourceDeletion(ctx, c, dom) @@ -136,16 +136,16 @@ func reconcileDomainEntity[T v1alpha1.DomainEntity](ctx context.Context, c *Cont if dom.GetStatus().State == "" { // When no status state is set, we set it to processing state first and requeue for processing. - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateProcessing, metav1.ConditionFalse, "Processing", "Processing domain resources") + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateProcessing, metav1.ConditionFalse, "Processing", "Processing domain resources") return NewReconcileResultWithResource(getResourceKeyFromKind(dom), dom.GetName(), dom.GetNamespace(), 0), nil - } else if dom.GetStatus().State != v1alpha1.DomainStateProcessing { + } else if dom.GetStatus().State != v1alpha2.DomainStateProcessing { // If not in processing state, we set it to processing state first and continue without requeuing. This ensures Error scenarios (if any) stay rate limited. - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateProcessing, metav1.ConditionFalse, "Processing", "Processing domain resources") + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateProcessing, metav1.ConditionFalse, "Processing", "Processing domain resources") } defer func() { if err != nil { - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateError, metav1.ConditionFalse, "ProcessingError", err.Error()) + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateError, metav1.ConditionFalse, "ProcessingError", err.Error()) } }() @@ -159,12 +159,12 @@ func reconcileDomainEntity[T v1alpha1.DomainEntity](ctx context.Context, c *Cont } // Resource is ready, so we can set the status to ready - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateReady, metav1.ConditionTrue, "Ready", "Domain resources are ready") + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateReady, metav1.ConditionTrue, "Ready", "Domain resources are ready") return } -func checkDomainResourcesReady[T v1alpha1.DomainEntity](ctx context.Context, dom T, c *Controller) (result *ReconcileResult, err error) { +func checkDomainResourcesReady[T v1alpha2.DomainEntity](ctx context.Context, dom T, c *Controller) (result *ReconcileResult, err error) { var message string var resource string ready := false @@ -198,7 +198,7 @@ func checkDomainResourcesReady[T v1alpha1.DomainEntity](ctx context.Context, dom return } -func processDomainEntity[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, subResourceNamespace string) (result *ReconcileResult, err error) { +func processDomainEntity[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, subResourceNamespace string) (result *ReconcileResult, err error) { // check for duplicate domains if result, err = handleDuplicateDomainHosts(c, dom); err != nil || result != nil { return @@ -258,24 +258,24 @@ func processDomainEntity[T v1alpha1.DomainEntity](ctx context.Context, c *Contro return } -func handleDuplicateDomainHosts[T v1alpha1.DomainEntity](c *Controller, dom T) (requeue *ReconcileResult, err error) { +func handleDuplicateDomainHosts[T v1alpha2.DomainEntity](c *Controller, dom T) (requeue *ReconcileResult, err error) { grp := errgroup.Group{} var ( - doms []*v1alpha1.Domain - cdoms []*v1alpha1.ClusterDomain + doms []*v1alpha2.Domain + cdoms []*v1alpha2.ClusterDomain ) selector := labels.SelectorFromSet(labels.Set{ LabelDomainHostHash: sha1Sum(dom.GetSpec().Domain), }) grp.Go(func() (err error) { - doms, err = c.crdInformerFactory.Sme().V1alpha1().Domains().Lister().List(selector) + doms, err = c.crdInformerFactory.Sme().V1alpha2().Domains().Lister().List(selector) if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to list domains: %w", err) } return nil }) grp.Go(func() (err error) { - cdoms, err = c.crdInformerFactory.Sme().V1alpha1().ClusterDomains().Lister().List(selector) + cdoms, err = c.crdInformerFactory.Sme().V1alpha2().ClusterDomains().Lister().List(selector) if err != nil && !errors.IsNotFound(err) { return fmt.Errorf("failed to list cluster domains: %w", err) } @@ -288,7 +288,7 @@ func handleDuplicateDomainHosts[T v1alpha1.DomainEntity](c *Controller, dom T) ( // there are other domains with the same host // (1) set current domain to error state msg := "Identical domain host is specified in another Domain/ClusterDomain resource" - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateError, metav1.ConditionFalse, "DuplicateDomainHost", msg) + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateError, metav1.ConditionFalse, "DuplicateDomainHost", msg) c.Event(runtime.Object(dom), nil, corev1.EventTypeWarning, DomainEventDuplicateDomainHost, EventActionProcessingDomainResources, msg) // (2) requeue the other domain for setting error state and wait to retry reconciling the current domain resource @@ -300,17 +300,17 @@ func handleDuplicateDomainHosts[T v1alpha1.DomainEntity](c *Controller, dom T) ( return } -func addDuplicateDomainResourcesToQueue[T v1alpha1.DomainEntity, E v1alpha1.DomainEntity](dom T, s []E, requeue *ReconcileResult) { +func addDuplicateDomainResourcesToQueue[T v1alpha2.DomainEntity, E v1alpha2.DomainEntity](dom T, s []E, requeue *ReconcileResult) { for i := range s { if dom.GetKind() != s[i].GetKind() || dom.GetNamespace() != s[i].GetNamespace() || dom.GetName() != s[i].GetName() { - if s[i].GetStatus().State == v1alpha1.DomainStateReady { + if s[i].GetStatus().State == v1alpha2.DomainStateReady { requeue.AddResource(getResourceKeyFromKind(s[i]), s[i].GetName(), s[i].GetNamespace(), 0) } } } } -func notifyReferencingApplications[T v1alpha1.DomainEntity](c *Controller, dom T, requeue *ReconcileResult) (*ReconcileResult, error) { +func notifyReferencingApplications[T v1alpha2.DomainEntity](c *Controller, dom T, requeue *ReconcileResult) (*ReconcileResult, error) { cas, err := getReferencingApplications(c, dom) if err != nil { return nil, err @@ -338,7 +338,7 @@ func notifyReferencingApplications[T v1alpha1.DomainEntity](c *Controller, dom T return requeue, nil } -func prepareDomainEntity[T v1alpha1.DomainEntity](dom T) (update bool) { +func prepareDomainEntity[T v1alpha2.DomainEntity](dom T) (update bool) { // Do nothing when object is deleted if dom.GetMetadata().DeletionTimestamp != nil { return false @@ -367,7 +367,7 @@ func prepareDomainEntity[T v1alpha1.DomainEntity](dom T) (update bool) { return update } -func handleDomainGateway[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, credentialName, name, namespace, ownerId string) (err error) { +func handleDomainGateway[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, credentialName, name, namespace, ownerId string) (err error) { // create a gateway selector from specified labels selector := labels.SelectorFromSet(labels.Set{ LabelOwnerIdentifierHash: sha1Sum(ownerId), @@ -390,7 +390,7 @@ func handleDomainGateway[T v1alpha1.DomainEntity](ctx context.Context, c *Contro } hostPrefix := "*/*." - if dom.GetKind() == v1alpha1.DomainKind { + if dom.GetKind() == v1alpha2.DomainKind { hostPrefix = "./*." } gatewaySpec := &networkingv1.Gateway{ @@ -429,7 +429,7 @@ func handleDomainGateway[T v1alpha1.DomainEntity](ctx context.Context, c *Contro AnnotationOwnerIdentifier: ownerId, }, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(metav1.Object(dom), v1alpha1.SchemeGroupVersion.WithKind(dom.GetKind())), + *metav1.NewControllerRef(metav1.Object(dom), v1alpha2.SchemeGroupVersion.WithKind(dom.GetKind())), }, }, Spec: *gatewaySpec.DeepCopy(), @@ -448,7 +448,7 @@ func handleDomainGateway[T v1alpha1.DomainEntity](ctx context.Context, c *Contro return } -func handleDomainCertificate[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, credentialNamespace, name, namespace, ownerId string) (credentialName string, err error) { +func handleDomainCertificate[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, credentialNamespace, name, namespace, ownerId string) (credentialName string, err error) { h := CreateCertificateManager(c) credentialName = h.GetCredentialName(namespace, name) @@ -479,7 +479,7 @@ func handleDomainCertificate[T v1alpha1.DomainEntity](ctx context.Context, c *Co return credentialName, h.handleCertificate(ctx, info) } -func handleAdditionalCACertificate[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, credentialName, credentialNamespace string, ownerId string) error { +func handleAdditionalCACertificate[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, credentialName, credentialNamespace string, ownerId string) error { secretName := fmt.Sprintf("%s-cacert", credentialName) // Try to get the existing secret @@ -534,7 +534,7 @@ func handleAdditionalCACertificate[T v1alpha1.DomainEntity](ctx context.Context, }) } -func extractAdditionalCACert[T v1alpha1.DomainEntity](dom T) string { +func extractAdditionalCACert[T v1alpha2.DomainEntity](dom T) string { if dom.GetSpec().CertConfig != nil { return dom.GetSpec().CertConfig.AdditionalCACertificate } @@ -562,7 +562,7 @@ func createAdditionalCACertificateSecret(ctx context.Context, c *Controller, nam } // #region Ingress Gateway Info -func getIngressInfo[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T) (ingGwInfo *ingressGatewayInfo, err error) { +func getIngressInfo[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T) (ingGwInfo *ingressGatewayInfo, err error) { // create ingress gateway selector from specified labels ingressLabelSelector, err := labels.ValidatedSelectorFromSet(dom.GetSpec().IngressSelector) if err != nil { @@ -621,7 +621,7 @@ func getIngressInfo[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, return &ingressGatewayInfo{Namespace: namespace, DNSTarget: dnsTarget}, nil } -func getDNSTargetFromIngressLoadbalancerService[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, namespace string, relevantPodNames map[string]struct{}, dom T) (string, error) { +func getDNSTargetFromIngressLoadbalancerService[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, namespace string, relevantPodNames map[string]struct{}, dom T) (string, error) { loadbalancerServices, err := c.getLoadBalancerServices(ctx, namespace) if err != nil { return "", err @@ -695,33 +695,33 @@ func getDNSTarget(ingressGWSvc *corev1.Service) string { //#endregion -func formOwnerIdFromDomain[T v1alpha1.DomainEntity](dom T) string { +func formOwnerIdFromDomain[T v1alpha2.DomainEntity](dom T) string { ownerId := dom.GetKind() - if ownerId == v1alpha1.DomainKind { + if ownerId == v1alpha2.DomainKind { ownerId = ownerId + "." + dom.GetNamespace() } ownerId = ownerId + "." + dom.GetName() return ownerId } -func getResourceKeyFromKind[T v1alpha1.DomainEntity](dom T) int { +func getResourceKeyFromKind[T v1alpha2.DomainEntity](dom T) int { switch dom.GetKind() { - case v1alpha1.DomainKind: + case v1alpha2.DomainKind: return ResourceDomain default: return ResourceClusterDomain } } -func getReferencingApplications[T v1alpha1.DomainEntity](c *Controller, dom T) ([]*v1alpha1.CAPApplication, error) { - cas, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().List(labels.Everything()) +func getReferencingApplications[T v1alpha2.DomainEntity](c *Controller, dom T) ([]*v1alpha2.CAPApplication, error) { + cas, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().List(labels.Everything()) if err != nil { return nil, fmt.Errorf("failed to list CAPApplications: %w", err) } - sources := []*v1alpha1.CAPApplication{} + sources := []*v1alpha2.CAPApplication{} for i := range cas { ca := cas[i] - if dom.GetKind() == v1alpha1.DomainKind && ca.Namespace != dom.GetNamespace() { + if dom.GetKind() == v1alpha2.DomainKind && ca.Namespace != dom.GetNamespace() { continue // skip application if it is not in the same namespace } if len(ca.Spec.DomainRefs) == 0 { @@ -742,7 +742,7 @@ func getReferencingApplications[T v1alpha1.DomainEntity](c *Controller, dom T) ( return sources, nil } -func handleDomainNetworkPolicies[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, ownerId, subResourceName string) (err error) { +func handleDomainNetworkPolicies[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, ownerId, subResourceName string) (err error) { cas, err := getReferencingApplications(c, dom) if err != nil { return err @@ -796,7 +796,7 @@ func handleDomainNetworkPolicies[T v1alpha1.DomainEntity](ctx context.Context, c return updGrp.Wait() } -func handleDomainNetworkPolicyForNamespace[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T, ownerId, subResourceName, namespace string, netpol *k8snwv1.NetworkPolicy) (err error) { +func handleDomainNetworkPolicyForNamespace[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T, ownerId, subResourceName, namespace string, netpol *k8snwv1.NetworkPolicy) (err error) { spec := k8snwv1.NetworkPolicySpec{ PolicyTypes: []k8snwv1.PolicyType{k8snwv1.PolicyTypeIngress}, PodSelector: metav1.LabelSelector{ // to workload pods managed by the operator @@ -838,7 +838,7 @@ func handleDomainNetworkPolicyForNamespace[T v1alpha1.DomainEntity](ctx context. AnnotationOwnerIdentifier: ownerId, }, OwnerReferences: []metav1.OwnerReference{ - *metav1.NewControllerRef(metav1.Object(dom), v1alpha1.SchemeGroupVersion.WithKind(dom.GetKind())), + *metav1.NewControllerRef(metav1.Object(dom), v1alpha2.SchemeGroupVersion.WithKind(dom.GetKind())), }, }, Spec: spec, @@ -853,19 +853,19 @@ func handleDomainNetworkPolicyForNamespace[T v1alpha1.DomainEntity](ctx context. return err } -func fetchDomainResourcesFromCache(c *Controller, refs []v1alpha1.DomainRef, namespace string) ([]*v1alpha1.Domain, []*v1alpha1.ClusterDomain, error) { - doms := []*v1alpha1.Domain{} - cdoms := []*v1alpha1.ClusterDomain{} +func fetchDomainResourcesFromCache(c *Controller, refs []v1alpha2.DomainRef, namespace string) ([]*v1alpha2.Domain, []*v1alpha2.ClusterDomain, error) { + doms := []*v1alpha2.Domain{} + cdoms := []*v1alpha2.ClusterDomain{} for _, ref := range refs { switch ref.Kind { - case v1alpha1.DomainKind: - dom, err := c.crdInformerFactory.Sme().V1alpha1().Domains().Lister().Domains(namespace).Get(ref.Name) + case v1alpha2.DomainKind: + dom, err := c.crdInformerFactory.Sme().V1alpha2().Domains().Lister().Domains(namespace).Get(ref.Name) if err != nil { return nil, nil, fmt.Errorf("failed to get domain %s.%s: %w", namespace, ref.Name, err) } doms = append(doms, dom) - case v1alpha1.ClusterDomainKind: - cdom, err := c.crdInformerFactory.Sme().V1alpha1().ClusterDomains().Lister().ClusterDomains(corev1.NamespaceAll).Get(ref.Name) + case v1alpha2.ClusterDomainKind: + cdom, err := c.crdInformerFactory.Sme().V1alpha2().ClusterDomains().Lister().ClusterDomains(corev1.NamespaceAll).Get(ref.Name) if err != nil { return nil, nil, fmt.Errorf("failed to get cluster domain %s: %w", ref.Name, err) } @@ -876,7 +876,7 @@ func fetchDomainResourcesFromCache(c *Controller, refs []v1alpha1.DomainRef, nam return doms, cdoms, nil } -func getDomainHosts[T v1alpha1.DomainEntity](s []T, subdomain string) []string { +func getDomainHosts[T v1alpha2.DomainEntity](s []T, subdomain string) []string { hosts := []string{} for _, dom := range s { v := dom.GetSpec().Domain @@ -888,12 +888,12 @@ func getDomainHosts[T v1alpha1.DomainEntity](s []T, subdomain string) []string { return hosts } -func getDomainGatewayReferences[T v1alpha1.DomainEntity](s []T) []string { +func getDomainGatewayReferences[T v1alpha2.DomainEntity](s []T) []string { gateways := []string{} for _, dom := range s { if dom.GetStatus().GatewayName != "" { - if dom.GetKind() == v1alpha1.DomainKind { + if dom.GetKind() == v1alpha2.DomainKind { gateways = append(gateways, dom.GetStatus().GatewayName) } else { // for ClusterDomain, the gateway name is prefixed with the operator namespace @@ -904,13 +904,13 @@ func getDomainGatewayReferences[T v1alpha1.DomainEntity](s []T) []string { return gateways } -func areDomainResourcesReady[T v1alpha1.DomainEntity](doms []T) (bool, error) { +func areDomainResourcesReady[T v1alpha2.DomainEntity](doms []T) (bool, error) { if len(doms) == 0 { return true, nil } for _, dom := range doms { s := dom.GetStatus() - if s.State == v1alpha1.DomainStateError { + if s.State == v1alpha2.DomainStateError { return false, fmt.Errorf("%s in state %s: %s", formOwnerIdFromDomain(dom), s.State, dom.GetStatusReadyConditionMessage()) } if !isCROConditionReady(s.GenericStatus) { @@ -920,7 +920,7 @@ func areDomainResourcesReady[T v1alpha1.DomainEntity](doms []T) (bool, error) { return true, nil } -func deleteDomainCertificates[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, _ T, ownerId string) error { +func deleteDomainCertificates[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, _ T, ownerId string) error { selector := labels.SelectorFromSet(labels.Set{ LabelOwnerIdentifierHash: sha1Sum(ownerId), }) @@ -939,7 +939,7 @@ func deleteDomainCertificates[T v1alpha1.DomainEntity](ctx context.Context, c *C return nil } -func deleteAdditionalCACertificateSecret[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, _ T, ownerId string) error { +func deleteAdditionalCACertificateSecret[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, _ T, ownerId string) error { selector := labels.SelectorFromSet(labels.Set{ LabelOwnerIdentifierHash: sha1Sum(ownerId), }) @@ -966,7 +966,7 @@ func deleteAdditionalCACertificateSecret[T v1alpha1.DomainEntity](ctx context.Co return nil } -func handleDomainResourceDeletion[T v1alpha1.DomainEntity](ctx context.Context, c *Controller, dom T) (*ReconcileResult, error) { +func handleDomainResourceDeletion[T v1alpha2.DomainEntity](ctx context.Context, c *Controller, dom T) (*ReconcileResult, error) { cas, err := getReferencingApplications(c, dom) if err != nil { return nil, err @@ -981,13 +981,13 @@ func handleDomainResourceDeletion[T v1alpha1.DomainEntity](ctx context.Context, if len(cas) > 0 { // keep ready condition intact - block deletion - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateDeleting, readyStatus, "DeletionBlocked", "deletion blocked by referencing applications") + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateDeleting, readyStatus, "DeletionBlocked", "deletion blocked by referencing applications") // requeue to attempt after a delay return NewReconcileResultWithResource(getResourceKeyFromKind(dom), dom.GetName(), dom.GetNamespace(), 30*time.Second), nil } - if dom.GetStatus().State != v1alpha1.DomainStateDeleting || readyStatus == metav1.ConditionTrue { - dom.SetStatusWithReadyCondition(v1alpha1.DomainStateDeleting, metav1.ConditionFalse, "Deleting", "deleting domain resources") + if dom.GetStatus().State != v1alpha2.DomainStateDeleting || readyStatus == metav1.ConditionTrue { + dom.SetStatusWithReadyCondition(v1alpha2.DomainStateDeleting, metav1.ConditionFalse, "Deleting", "deleting domain resources") return NewReconcileResultWithResource(getResourceKeyFromKind(dom), dom.GetName(), dom.GetNamespace(), 0), nil } @@ -1005,9 +1005,9 @@ func handleDomainResourceDeletion[T v1alpha1.DomainEntity](ctx context.Context, // remove finalizer from domain if removeFinalizer(&dom.GetMetadata().Finalizers, FinalizerDomain) { switch v := any(dom).(type) { - case *v1alpha1.Domain: + case *v1alpha2.Domain: err = c.updateDomain(ctx, v) - case *v1alpha1.ClusterDomain: + case *v1alpha2.ClusterDomain: err = c.updateClusterDomain(ctx, v) } @@ -1016,7 +1016,7 @@ func handleDomainResourceDeletion[T v1alpha1.DomainEntity](ctx context.Context, return nil, err } -func createDomainMap[T v1alpha1.DomainEntity](doms []T, in map[string]string) (out map[string]string) { +func createDomainMap[T v1alpha2.DomainEntity](doms []T, in map[string]string) (out map[string]string) { out = in if out == nil { out = map[string]string{} @@ -1027,15 +1027,15 @@ func createDomainMap[T v1alpha1.DomainEntity](doms []T, in map[string]string) (o return } -func convertOwnerIdsToDomainReferences(ownerIds []string) (refs []v1alpha1.DomainRef) { - refs = []v1alpha1.DomainRef{} +func convertOwnerIdsToDomainReferences(ownerIds []string) (refs []v1alpha2.DomainRef) { + refs = []v1alpha2.DomainRef{} for _, id := range ownerIds { parts := strings.Split(id, ".") switch len(parts) { case 2: - refs = append(refs, v1alpha1.DomainRef{Kind: parts[0], Name: parts[1]}) + refs = append(refs, v1alpha2.DomainRef{Kind: parts[0], Name: parts[1]}) default: // case 3: - refs = append(refs, v1alpha1.DomainRef{Kind: parts[0], Name: parts[2]}) + refs = append(refs, v1alpha2.DomainRef{Kind: parts[0], Name: parts[2]}) } } return diff --git a/internal/controller/reconcile-networking.go b/internal/controller/reconcile-networking.go index 7114ed29..dd278135 100644 --- a/internal/controller/reconcile-networking.go +++ b/internal/controller/reconcile-networking.go @@ -14,7 +14,7 @@ import ( "strings" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "google.golang.org/protobuf/types/known/durationpb" networkingv1 "istio.io/api/networking/v1" istionwv1 "istio.io/client-go/pkg/apis/networking/v1" @@ -40,7 +40,7 @@ const ( // This region is for handling DestinationRule creation for stickiness based on the configuration in CAPApplicationVersion. // #region Destination Rule for stickiness -func (c *Controller) handleDestinationRule(ctx context.Context, drName string, stickiness *v1alpha1.Stickiness, cav *v1alpha1.CAPApplicationVersion) (err error) { +func (c *Controller) handleDestinationRule(ctx context.Context, drName string, stickiness *v1alpha2.Stickiness, cav *v1alpha2.CAPApplicationVersion) (err error) { drSpec := getDestinationRuleFromConfig(drName, cav.Namespace, stickiness) if drSpec == nil { // if no valid stickiness configuration is found, ignore creation @@ -54,7 +54,7 @@ func (c *Controller) handleDestinationRule(ctx context.Context, drName string, s Name: drName, Namespace: cav.Namespace, Labels: map[string]string{}, - OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind))}, + OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind))}, }, Spec: *drSpec.DeepCopy(), } @@ -66,7 +66,7 @@ func (c *Controller) handleDestinationRule(ctx context.Context, drName string, s return err } -func getDestinationRuleFromConfig(drName, namespace string, stickiness *v1alpha1.Stickiness) *networkingv1.DestinationRule { +func getDestinationRuleFromConfig(drName, namespace string, stickiness *v1alpha2.Stickiness) *networkingv1.DestinationRule { if stickiness.Hash == nil { return nil } @@ -131,7 +131,7 @@ func getDestinationRuleFromConfig(drName, namespace string, stickiness *v1alpha1 // #endregion -func (c *Controller) reconcileTenantNetworking(ctx context.Context, cat *v1alpha1.CAPTenant, cavName string, ca *v1alpha1.CAPApplication) (err error) { +func (c *Controller) reconcileTenantNetworking(ctx context.Context, cat *v1alpha2.CAPTenant, cavName string, ca *v1alpha2.CAPApplication) (err error) { var ( reason, message string vsModified bool @@ -168,7 +168,7 @@ func (c *Controller) reconcileTenantNetworking(ctx context.Context, cat *v1alpha return } -func (c *Controller) reconcileTenantVirtualService(ctx context.Context, cat *v1alpha1.CAPTenant, cavName string, ca *v1alpha1.CAPApplication) (modified bool, err error) { +func (c *Controller) reconcileTenantVirtualService(ctx context.Context, cat *v1alpha2.CAPTenant, cavName string, ca *v1alpha2.CAPApplication) (modified bool, err error) { var ( create, update bool vs *istionwv1.VirtualService @@ -181,7 +181,7 @@ func (c *Controller) reconcileTenantVirtualService(ctx context.Context, cat *v1a Name: cat.Name, // keep the same name as CAPTenant to avoid duplicates Namespace: cat.Namespace, Labels: map[string]string{}, - OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cat, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPTenantKind))}, + OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(cat, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPTenantKind))}, }, } create = true @@ -205,9 +205,9 @@ func (c *Controller) reconcileTenantVirtualService(ctx context.Context, cat *v1a return create || update, err } -func (c *Controller) getUpdatedTenantVirtualServiceObject(cat *v1alpha1.CAPTenant, vs *istionwv1.VirtualService, cavName string, ca *v1alpha1.CAPApplication) (modified bool, err error) { +func (c *Controller) getUpdatedTenantVirtualServiceObject(cat *v1alpha2.CAPTenant, vs *istionwv1.VirtualService, cavName string, ca *v1alpha2.CAPApplication) (modified bool, err error) { // verify owner reference - modified, err = c.enforceTenantResourceOwnership(&vs.ObjectMeta, &vs.TypeMeta, cat) + modified, err = c.enforceTenantResourceOwnership(&vs.ObjectMeta, cat) if err != nil { return modified, err } @@ -264,16 +264,16 @@ func (c *Controller) getUpdatedTenantVirtualServiceObject(cat *v1alpha1.CAPTenan return modified, err } -func (c *Controller) getVirtualServiceHttpRoutes(cat *v1alpha1.CAPTenant, currentCavName string, headers *networkingv1.Headers) ([]*networkingv1.HTTPRoute, error) { +func (c *Controller) getVirtualServiceHttpRoutes(cat *v1alpha2.CAPTenant, currentCavName string, headers *networkingv1.Headers) ([]*networkingv1.HTTPRoute, error) { type prevCavInfo struct { - cav *v1alpha1.CAPApplicationVersion + cav *v1alpha2.CAPApplicationVersion dest *networkingv1.Destination } // Get all previous CAVs (skip any that are missing or have no router port info) var prevCavs []prevCavInfo for _, prevCavName := range cat.Status.PreviousCAPApplicationVersions { - prevCav, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister().CAPApplicationVersions(cat.Namespace).Get(prevCavName) + prevCav, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister().CAPApplicationVersions(cat.Namespace).Get(prevCavName) if err != nil { continue } @@ -289,7 +289,7 @@ func (c *Controller) getVirtualServiceHttpRoutes(cat *v1alpha1.CAPTenant, curren if err != nil { return nil, err } - currentCav, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister().CAPApplicationVersions(cat.Namespace).Get(currentCavName) + currentCav, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister().CAPApplicationVersions(cat.Namespace).Get(currentCavName) if err != nil { return nil, err } @@ -414,7 +414,7 @@ func expiredCookie(cavName string) string { return sessionCookie(cavName) + ";Max-Age=0" } -func (c *Controller) updateVirtualServiceSpecFromDomainReferences(spec *networkingv1.VirtualService, subdomain string, ca *v1alpha1.CAPApplication) error { +func (c *Controller) updateVirtualServiceSpecFromDomainReferences(spec *networkingv1.VirtualService, subdomain string, ca *v1alpha2.CAPApplication) error { doms, cdoms, err := fetchDomainResourcesFromCache(c, ca.Spec.DomainRefs, ca.Namespace) if err != nil { return err @@ -433,7 +433,7 @@ func (c *Controller) updateVirtualServiceSpecFromDomainReferences(spec *networki return nil } -func (c *Controller) reconcileServiceNetworking(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) (err error) { +func (c *Controller) reconcileServiceNetworking(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) (err error) { var ( reason, message string vsModified bool @@ -466,8 +466,8 @@ func (c *Controller) reconcileServiceNetworking(ctx context.Context, ca *v1alpha return } -func (c *Controller) reconcileServiceVirtualServices(ctx context.Context, cav *v1alpha1.CAPApplicationVersion, ca *v1alpha1.CAPApplication) (modified bool, err error) { - ownerHash := sha1Sum(v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name) +func (c *Controller) reconcileServiceVirtualServices(ctx context.Context, cav *v1alpha2.CAPApplicationVersion, ca *v1alpha2.CAPApplication) (modified bool, err error) { + ownerHash := sha1Sum(v1alpha2.CAPApplicationKind, ca.Namespace, ca.Name) labelSelector := labels.SelectorFromSet(map[string]string{LabelOwnerIdentifierHash: ownerHash}).String() vsList, err := c.istioClient.NetworkingV1().VirtualServices(ca.Namespace).List(ctx, metav1.ListOptions{LabelSelector: labelSelector}) @@ -475,7 +475,7 @@ func (c *Controller) reconcileServiceVirtualServices(ctx context.Context, cav *v return } - ownerRef := *metav1.NewControllerRef(ca, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationKind)) + ownerRef := *metav1.NewControllerRef(ca, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationKind)) aFoundIndex := []int{} for _, serviceExposure := range cav.Spec.ServiceExposures { @@ -503,7 +503,7 @@ func (c *Controller) reconcileServiceVirtualServices(ctx context.Context, cav *v return modified, err } -func (c *Controller) modifyServiceExposure(ctx context.Context, vsList *istionwv1.VirtualServiceList, serviceExposure v1alpha1.ServiceExposure, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, ownerHash string, ownerRef metav1.OwnerReference) (iIndex int, modified bool, err error) { +func (c *Controller) modifyServiceExposure(ctx context.Context, vsList *istionwv1.VirtualServiceList, serviceExposure v1alpha2.ServiceExposure, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, ownerHash string, ownerRef metav1.OwnerReference) (iIndex int, modified bool, err error) { var ( create, update bool vs *istionwv1.VirtualService @@ -548,13 +548,11 @@ func (c *Controller) modifyServiceExposure(ctx context.Context, vsList *istionwv return } -func (c *Controller) getUpdatedServiceVirtualServiceObject(vs *istionwv1.VirtualService, serviceExposure v1alpha1.ServiceExposure, ownerRef metav1.OwnerReference, ca *v1alpha1.CAPApplication, cavName string) (modified bool, err error) { +func (c *Controller) getUpdatedServiceVirtualServiceObject(vs *istionwv1.VirtualService, serviceExposure v1alpha2.ServiceExposure, ownerRef metav1.OwnerReference, ca *v1alpha2.CAPApplication, cavName string) (modified bool, err error) { // update owner reference - if owner, ok := getOwnerByKind(vs.OwnerReferences, v1alpha1.CAPApplicationKind); !ok { + if _, ok := getOwnerByObject(vs.OwnerReferences, v1alpha2.CAPApplicationKind, ca); !ok { vs.OwnerReferences = append(vs.OwnerReferences, ownerRef) modified = true - } else if owner.Name != ca.Name { - return false, fmt.Errorf("invalid owner reference found for %s %s.%s", vs.Kind, vs.Namespace, vs.Name) } headers, err := getNetworkingHeaders(ca) @@ -605,7 +603,7 @@ func (c *Controller) getUpdatedServiceVirtualServiceObject(vs *istionwv1.Virtual return modified, err } -func getNetworkingHeaders(ca *v1alpha1.CAPApplication) (nwHeaders *networkingv1.Headers, err error) { +func getNetworkingHeaders(ca *v1alpha2.CAPApplication) (nwHeaders *networkingv1.Headers, err error) { extractHeaders := func(annotation string) (headerOps *networkingv1.Headers_HeaderOperations, err error) { headers := map[string]string{} headersJson := ca.Annotations[annotation] diff --git a/internal/controller/reconcile.go b/internal/controller/reconcile.go index 4f829395..ecb3cec5 100644 --- a/internal/controller/reconcile.go +++ b/internal/controller/reconcile.go @@ -14,7 +14,7 @@ import ( "strings" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "golang.org/x/mod/semver" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" @@ -165,13 +165,13 @@ func (c *Controller) Event(main runtime.Object, related runtime.Object, eventTyp c.eventRecorder.Eventf(main, related, eventType, reason, action, message) } -func (c *Controller) getCachedCAPApplication(namespace, name string) (*v1alpha1.CAPApplication, error) { - lister := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister() +func (c *Controller) getCachedCAPApplication(namespace, name string) (*v1alpha2.CAPApplication, error) { + lister := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister() return lister.CAPApplications(namespace).Get(name) } -func (c *Controller) getCachedCAPTenant(namespace, value string, valueIsTenantId bool) (*v1alpha1.CAPTenant, error) { - lister := c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister() +func (c *Controller) getCachedCAPTenant(namespace, value string, valueIsTenantId bool) (*v1alpha2.CAPTenant, error) { + lister := c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister() if !valueIsTenantId { // fetch with name return lister.CAPTenants(namespace).Get(value) @@ -197,13 +197,13 @@ func (c *Controller) getCachedCAPTenant(namespace, value string, valueIsTenantId /* fetch the latest CAPApplicationVersion in Ready state, for a specified CAPApplication */ -func (c *Controller) getLatestReadyCAPApplicationVersion(ca *v1alpha1.CAPApplication, avoidNotFound bool) (*v1alpha1.CAPApplicationVersion, error) { +func (c *Controller) getLatestReadyCAPApplicationVersion(ca *v1alpha2.CAPApplication, avoidNotFound bool) (*v1alpha2.CAPApplicationVersion, error) { cavs, err := c.getCachedCAPApplicationVersions(ca) if err != nil { return nil, err } - var latestCav *v1alpha1.CAPApplicationVersion + var latestCav *v1alpha2.CAPApplicationVersion for _, cav := range cavs { // determine the latest semantic version if isCROConditionReady(cav.Status.GenericStatus) && @@ -213,7 +213,7 @@ func (c *Controller) getLatestReadyCAPApplicationVersion(ca *v1alpha1.CAPApplica } if latestCav == nil && !avoidNotFound { - err = fmt.Errorf("could not find a %s with status %s for %s %s.%s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPApplicationVersionStateReady, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name) + err = fmt.Errorf("could not find a %s with status %s for %s %s.%s", v1alpha2.CAPApplicationVersionKind, v1alpha2.CAPApplicationVersionStateReady, v1alpha2.CAPApplicationKind, ca.Namespace, ca.Name) } return latestCav, err @@ -222,13 +222,13 @@ func (c *Controller) getLatestReadyCAPApplicationVersion(ca *v1alpha1.CAPApplica /* fetch the latest CAPApplicationVersion, for a specified CAPApplication */ -func (c *Controller) getLatestCAPApplicationVersion(ca *v1alpha1.CAPApplication) (*v1alpha1.CAPApplicationVersion, error) { +func (c *Controller) getLatestCAPApplicationVersion(ca *v1alpha2.CAPApplication) (*v1alpha2.CAPApplicationVersion, error) { cavs, err := c.getCachedCAPApplicationVersions(ca) if err != nil { return nil, err } - var latestCav *v1alpha1.CAPApplicationVersion + var latestCav *v1alpha2.CAPApplicationVersion for _, cav := range cavs { // determine the latest semantic version if latestCav == nil || semver.Compare("v"+cav.Spec.Version, "v"+latestCav.Spec.Version) == 1 { @@ -237,7 +237,7 @@ func (c *Controller) getLatestCAPApplicationVersion(ca *v1alpha1.CAPApplication) } if latestCav == nil { - err = fmt.Errorf("could not find a %s for %s %s.%s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name) + err = fmt.Errorf("could not find a %s for %s %s.%s", v1alpha2.CAPApplicationVersionKind, v1alpha2.CAPApplicationKind, ca.Namespace, ca.Name) } return latestCav, err @@ -248,13 +248,13 @@ func (c *Controller) getLatestCAPApplicationVersion(ca *v1alpha1.CAPApplication) fetch the relevant CAPApplicationVersion in Ready state, for a specified CAPApplication and version string */ -func (c *Controller) getRelevantCAPApplicationVersion(ca *v1alpha1.CAPApplication, version string) (*v1alpha1.CAPApplicationVersion, error) { +func (c *Controller) getRelevantCAPApplicationVersion(ca *v1alpha2.CAPApplication, version string) (*v1alpha2.CAPApplicationVersion, error) { cavs, err := c.getCachedCAPApplicationVersions(ca) if err != nil { return nil, err } - var latestCav *v1alpha1.CAPApplicationVersion + var latestCav *v1alpha2.CAPApplicationVersion for _, cav := range cavs { // determine the matching semantic version and return if isCROConditionReady(cav.Status.GenericStatus) && cav.Spec.Version == version { @@ -264,13 +264,13 @@ func (c *Controller) getRelevantCAPApplicationVersion(ca *v1alpha1.CAPApplicatio } if latestCav == nil { - err = fmt.Errorf("could not find a %s with status %s for %s %s.%s and version %s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPApplicationVersionStateReady, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name, version) + err = fmt.Errorf("could not find a %s with status %s for %s %s.%s and version %s", v1alpha2.CAPApplicationVersionKind, v1alpha2.CAPApplicationVersionStateReady, v1alpha2.CAPApplicationKind, ca.Namespace, ca.Name, version) } return latestCav, err } -func (c *Controller) getCachedCAPApplicationVersions(ca *v1alpha1.CAPApplication) ([]*v1alpha1.CAPApplicationVersion, error) { +func (c *Controller) getCachedCAPApplicationVersions(ca *v1alpha2.CAPApplication) ([]*v1alpha2.CAPApplicationVersion, error) { selector, err := labels.ValidatedSelectorFromSet(map[string]string{ LabelOwnerIdentifierHash: sha1Sum(ca.Namespace, ca.Name), }) @@ -279,10 +279,10 @@ func (c *Controller) getCachedCAPApplicationVersions(ca *v1alpha1.CAPApplication return nil, err } - return c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister().List(selector) + return c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister().List(selector) } -func (c *Controller) checkSecretsExist(serviceInfos []v1alpha1.ServiceInfo, namespace string) error { +func (c *Controller) checkSecretsExist(serviceInfos []v1alpha2.ServiceInfo, namespace string) error { var err error secretNSLister := c.kubeInformerFactory.Core().V1().Secrets().Lister().Secrets(namespace) @@ -296,9 +296,9 @@ func (c *Controller) checkSecretsExist(serviceInfos []v1alpha1.ServiceInfo, name } // Services Only will be set to true if there are jobs of type content (if any jobs exist) in CAV and the provider section is empty in CA -func (c *Controller) checkServicesOnly(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion) error { - servicesOnly := !slices.ContainsFunc(cav.Spec.Workloads, func(wd v1alpha1.WorkloadDetails) bool { - return wd.JobDefinition != nil && wd.JobDefinition.Type != v1alpha1.JobContent +func (c *Controller) checkServicesOnly(ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion) error { + servicesOnly := !slices.ContainsFunc(cav.Spec.Workloads, func(wd v1alpha2.WorkloadDetails) bool { + return wd.JobDefinition != nil && wd.JobDefinition.Type != v1alpha2.JobContent }) && ca.IsProviderEmpty() // Check if the CAP Application is already marked with ServicesOnly from a previous version only once the Status is set! @@ -332,8 +332,8 @@ func getConsumedServiceMap(consumedServices []string) map[string]string { return consumedServicesMap } -func getConsumedServiceInfos(consumedServicesMap map[string]string, serviceInfos []v1alpha1.ServiceInfo) []v1alpha1.ServiceInfo { - consumedServiceInfo := []v1alpha1.ServiceInfo{} +func getConsumedServiceInfos(consumedServicesMap map[string]string, serviceInfos []v1alpha2.ServiceInfo) []v1alpha2.ServiceInfo { + consumedServiceInfo := []v1alpha2.ServiceInfo{} for _, serviceInfo := range serviceInfos { if serviceInfo.Name == consumedServicesMap[serviceInfo.Name] { @@ -343,7 +343,7 @@ func getConsumedServiceInfos(consumedServicesMap map[string]string, serviceInfos return consumedServiceInfo } -func generateVCAPEnv(ns string, serviceInfos []v1alpha1.ServiceInfo, kubeInformerFactory informers.SharedInformerFactory) ([]byte, error) { +func generateVCAPEnv(ns string, serviceInfos []v1alpha2.ServiceInfo, kubeInformerFactory informers.SharedInformerFactory) ([]byte, error) { envVCAPServices := map[string][]map[string]any{} for _, serviceInfo := range serviceInfos { entry, err := util.CreateVCAPEntryFromSecret(&serviceInfo, ns, nil, kubeInformerFactory) @@ -363,7 +363,7 @@ func generateVCAPEnv(ns string, serviceInfos []v1alpha1.ServiceInfo, kubeInforme return json.Marshal(envVCAPServices) } -func (c *Controller) createVCAPSecret(namePrefix string, ns string, ownerRef metav1.OwnerReference, serviceInfos []v1alpha1.ServiceInfo) (string, error) { +func (c *Controller) createVCAPSecret(namePrefix string, ns string, ownerRef metav1.OwnerReference, serviceInfos []v1alpha2.ServiceInfo) (string, error) { // Generate VCAP_SERVICES env. variable vcapEnv, err := generateVCAPEnv(ns, serviceInfos, c.kubeInformerFactory) if err != nil { @@ -424,7 +424,7 @@ func errorEnv(workloadType, entry string) error { return fmt.Errorf("invalid env configuration for workload: %s, remove entry: %s from configuration", workloadType, entry) } -func getRelevantJob(workloadType v1alpha1.JobType, cav *v1alpha1.CAPApplicationVersion) *v1alpha1.WorkloadDetails { +func getRelevantJob(workloadType v1alpha2.JobType, cav *v1alpha2.CAPApplicationVersion) *v1alpha2.WorkloadDetails { for _, workload := range cav.Spec.Workloads { if workload.JobDefinition != nil && workload.JobDefinition.Type == workloadType { return &workload @@ -433,7 +433,7 @@ func getRelevantJob(workloadType v1alpha1.JobType, cav *v1alpha1.CAPApplicationV return nil } -func getRelevantDeployment(workloadType v1alpha1.DeploymentType, cav *v1alpha1.CAPApplicationVersion) *v1alpha1.WorkloadDetails { +func getRelevantDeployment(workloadType v1alpha2.DeploymentType, cav *v1alpha2.CAPApplicationVersion) *v1alpha2.WorkloadDetails { workloads := getDeployments(workloadType, cav) if len(workloads) == 0 { return nil @@ -441,8 +441,8 @@ func getRelevantDeployment(workloadType v1alpha1.DeploymentType, cav *v1alpha1.C return &workloads[0] } -func getDeployments(workloadType v1alpha1.DeploymentType, cav *v1alpha1.CAPApplicationVersion) []v1alpha1.WorkloadDetails { - deployments := []v1alpha1.WorkloadDetails{} +func getDeployments(workloadType v1alpha2.DeploymentType, cav *v1alpha2.CAPApplicationVersion) []v1alpha2.WorkloadDetails { + deployments := []v1alpha2.WorkloadDetails{} for _, workload := range cav.Spec.Workloads { if workload.DeploymentDefinition != nil && workload.DeploymentDefinition.Type == workloadType { deployments = append(deployments, workload) @@ -451,7 +451,7 @@ func getDeployments(workloadType v1alpha1.DeploymentType, cav *v1alpha1.CAPAppli return deployments } -func getWorkloadByName(name string, cav *v1alpha1.CAPApplicationVersion) *v1alpha1.WorkloadDetails { +func getWorkloadByName(name string, cav *v1alpha2.CAPApplicationVersion) *v1alpha2.WorkloadDetails { for _, workload := range cav.Spec.Workloads { if workload.Name == name { return &workload @@ -488,7 +488,7 @@ func isDeletionImminent(m *metav1.ObjectMeta) bool { return len(m.Finalizers) == 0 } -func getRelevantServicePortInfo(cav *v1alpha1.CAPApplicationVersion) []servicePortInfo { +func getRelevantServicePortInfo(cav *v1alpha2.CAPApplicationVersion) []servicePortInfo { overallPortInfos := []servicePortInfo{} for _, workload := range cav.Spec.Workloads { var workloadPortInfo *servicePortInfo @@ -503,7 +503,7 @@ func getRelevantServicePortInfo(cav *v1alpha1.CAPApplicationVersion) []servicePo return overallPortInfos } -func getWorkloadPortInfo(workload v1alpha1.WorkloadDetails, cavName string) *servicePortInfo { +func getWorkloadPortInfo(workload v1alpha2.WorkloadDetails, cavName string) *servicePortInfo { var servicePorts []corev1.ServicePort var destinationDetails []destinationInfo var clusterPorts []int32 @@ -519,7 +519,7 @@ func getWorkloadPortInfo(workload v1alpha1.WorkloadDetails, cavName string) *ser Port: port.Port, }) } - if port.NetworkPolicy == v1alpha1.PortNetworkPolicyTypeCluster { + if port.NetworkPolicy == v1alpha2.PortNetworkPolicyTypeCluster { clusterPorts = append(clusterPorts, port.Port) } } @@ -528,16 +528,16 @@ func getWorkloadPortInfo(workload v1alpha1.WorkloadDetails, cavName string) *ser return workloadPortInfo } -func updateWorkloadPortInfo(cavName, workloadName string, deploymentType v1alpha1.DeploymentType, servicePorts []corev1.ServicePort, destinationDetails []destinationInfo, clusterPorts []int32) *servicePortInfo { +func updateWorkloadPortInfo(cavName, workloadName string, deploymentType v1alpha2.DeploymentType, servicePorts []corev1.ServicePort, destinationDetails []destinationInfo, clusterPorts []int32) *servicePortInfo { var workloadPortInfo *servicePortInfo if len(servicePorts) == 0 { // Use fallback defaults switch deploymentType { - case v1alpha1.DeploymentRouter: + case v1alpha2.DeploymentRouter: servicePorts = []corev1.ServicePort{ {Name: "router-svc-port", Port: defaultRouterPort}, } - case v1alpha1.DeploymentCAP: + case v1alpha2.DeploymentCAP: servicePorts = []corev1.ServicePort{ {Name: "server-svc-port", Port: defaultServerPort}, } @@ -573,12 +573,12 @@ func getServicePortInfoByWorkloadName(items []servicePortInfo, cavName, workload } func (c *Controller) getRouterServicePortInfo(cavName, namespace string) (*servicePortInfo, error) { - cav, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister().CAPApplicationVersions(namespace).Get(cavName) + cav, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister().CAPApplicationVersions(namespace).Get(cavName) if err != nil { return nil, err } - routerWorkload := getRelevantDeployment(v1alpha1.DeploymentRouter, cav) + routerWorkload := getRelevantDeployment(v1alpha2.DeploymentRouter, cav) return getWorkloadPortInfo(*routerWorkload, cavName), nil } diff --git a/internal/controller/reconcile_test.go b/internal/controller/reconcile_test.go index 30e605cf..dfef4bac 100644 --- a/internal/controller/reconcile_test.go +++ b/internal/controller/reconcile_test.go @@ -27,7 +27,7 @@ import ( dnsv1alpha1 "github.com/gardener/external-dns-management/pkg/apis/dns/v1alpha1" dnsfake "github.com/gardener/external-dns-management/pkg/client/dns/clientset/versioned/fake" promopFake "github.com/prometheus-operator/prometheus-operator/pkg/client/versioned/fake" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "github.com/sap/cap-operator/pkg/client/clientset/versioned/fake" istionwv1 "istio.io/client-go/pkg/apis/networking/v1" istiofake "istio.io/client-go/pkg/clientset/versioned/fake" @@ -53,10 +53,10 @@ type ingressResources struct { } type testResources struct { - cas []*v1alpha1.CAPApplication - cavs []*v1alpha1.CAPApplicationVersion - cats []*v1alpha1.CAPTenant - ctops []*v1alpha1.CAPTenantOperation + cas []*v1alpha2.CAPApplication + cavs []*v1alpha2.CAPApplicationVersion + cats []*v1alpha2.CAPTenant + ctops []*v1alpha2.CAPTenantOperation ingressGW []*ingressResources gateway *istionwv1.Gateway gardenerCert *certv1alpha1.Certificate @@ -65,35 +65,21 @@ type testResources struct { preventStart bool } -func createCaCRO(name string, withFinalizer bool) *v1alpha1.CAPApplication { - ca := &v1alpha1.CAPApplication{ +func createCaCRO(name string, withFinalizer bool) *v1alpha2.CAPApplication { + ca := &v1alpha2.CAPApplication{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPApplicationSpec{ - Domains: v1alpha1.ApplicationDomains{ - Primary: primaryDomain, - Secondary: []string{secondaryDomain}, - IstioIngressGatewayLabels: []v1alpha1.NameValue{ - { - Name: "istio", - Value: "ingressgateway", - }, - { - Name: "app", - Value: "istio-ingressgateway", - }, - }, - }, + Spec: v1alpha2.CAPApplicationSpec{ ProviderSubaccountId: providerSubaccountId, BTPAppName: btpApplicationName, - Provider: &v1alpha1.BTPTenantIdentification{ + Provider: &v1alpha2.BTPTenantIdentification{ SubDomain: providerSubDomain, TenantId: providerTenantId, }, - BTP: v1alpha1.BTP{ - Services: []v1alpha1.ServiceInfo{ + BTP: v1alpha2.BTP{ + Services: []v1alpha2.ServiceInfo{ { Class: "xsuaa", Name: "test-xsuaa", @@ -136,12 +122,12 @@ func createCaCRO(name string, withFinalizer bool) *v1alpha1.CAPApplication { return ca } -func createCavCRO(name string, state v1alpha1.CAPApplicationVersionState, version string) *v1alpha1.CAPApplicationVersion { +func createCavCRO(name string, state v1alpha2.CAPApplicationVersionState, version string) *v1alpha2.CAPApplicationVersion { status := metav1.ConditionFalse - if state == v1alpha1.CAPApplicationVersionStateReady || state == v1alpha1.CAPApplicationVersionStateDeleting { + if state == v1alpha2.CAPApplicationVersionStateReady || state == v1alpha2.CAPApplicationVersionStateDeleting { status = metav1.ConditionTrue } - return &v1alpha1.CAPApplicationVersion{ + return &v1alpha2.CAPApplicationVersion{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: metav1.NamespaceDefault, @@ -149,19 +135,19 @@ func createCavCRO(name string, state v1alpha1.CAPApplicationVersionState, versio LabelOwnerIdentifierHash: sha1Sum(metav1.NamespaceDefault, caCroName), }, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caCroName, Version: version, - Workloads: []v1alpha1.WorkloadDetails{ + Workloads: []v1alpha2.WorkloadDetails{ { Name: "cap-backend-server", ConsumedBTPServices: []string{ "test-xsuaa", "test-saas", }, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - Type: v1alpha1.DeploymentCAP, - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + Type: v1alpha2.DeploymentCAP, + CommonDetails: v1alpha2.CommonDetails{ Image: "test://image", }, }, @@ -169,20 +155,20 @@ func createCavCRO(name string, state v1alpha1.CAPApplicationVersionState, versio { Name: "app-router", ConsumedBTPServices: []string{}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{ + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{ Image: "test://image", }, }, }, }, }, - Status: v1alpha1.CAPApplicationVersionStatus{ - GenericStatus: v1alpha1.GenericStatus{ + Status: v1alpha2.CAPApplicationVersionStatus{ + GenericStatus: v1alpha2.GenericStatus{ Conditions: []metav1.Condition{ { Status: status, - Type: string(v1alpha1.ConditionTypeReady), + Type: string(v1alpha2.ConditionTypeReady), }, }, }, @@ -203,20 +189,20 @@ func generateMetaObjName(obj any) { } } -func createCatCRO(caName string, tenantType string, withFinalizers bool) *v1alpha1.CAPTenant { - cat := &v1alpha1.CAPTenant{ +func createCatCRO(caName string, tenantType string, withFinalizers bool) *v1alpha2.CAPTenant { + cat := &v1alpha2.CAPTenant{ ObjectMeta: metav1.ObjectMeta{ Name: strings.Join([]string{caName, tenantType}, "-"), Namespace: metav1.NamespaceDefault, }, - Spec: v1alpha1.CAPTenantSpec{ + Spec: v1alpha2.CAPTenantSpec{ CAPApplicationInstance: caCroName, - BTPTenantIdentification: v1alpha1.BTPTenantIdentification{}, + BTPTenantIdentification: v1alpha2.BTPTenantIdentification{}, Version: defaultVersion, }, - Status: v1alpha1.CAPTenantStatus{ + Status: v1alpha2.CAPTenantStatus{ CurrentCAPApplicationVersionInstance: cavCroName, - GenericStatus: v1alpha1.GenericStatus{}, + GenericStatus: v1alpha2.GenericStatus{}, }, } @@ -300,25 +286,25 @@ func getTestController(resources testResources) *Controller { for _, ca := range resources.cas { if ca != nil { - c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Informer().GetIndexer().Add(ca) + c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Informer().GetIndexer().Add(ca) } } for _, cav := range resources.cavs { if cav != nil { - c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Informer().GetIndexer().Add(cav) + c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Informer().GetIndexer().Add(cav) } } for _, cat := range resources.cats { if cat != nil { - c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Informer().GetIndexer().Add(cat) + c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Informer().GetIndexer().Add(cat) } } for _, ctop := range resources.ctops { if ctop != nil { - c.crdInformerFactory.Sme().V1alpha1().CAPTenantOperations().Informer().GetIndexer().Add(ctop) + c.crdInformerFactory.Sme().V1alpha2().CAPTenantOperations().Informer().GetIndexer().Add(ctop) } } @@ -371,7 +357,7 @@ func TestMain(m *testing.M) { func TestGetLatestReadyCAPApplicationVersion(t *testing.T) { tests := []struct { testName string - status v1alpha1.CAPApplicationVersionState + status v1alpha2.CAPApplicationVersionState number int expectedVersion string }{ @@ -383,19 +369,19 @@ func TestGetLatestReadyCAPApplicationVersion(t *testing.T) { }, { testName: "when getLatestReadyCAPApplicationVersion() is called with one CAV in ready state", - status: v1alpha1.CAPApplicationVersionStateReady, + status: v1alpha2.CAPApplicationVersionStateReady, number: 1, expectedVersion: "0.0.1", }, { testName: "when getLatestReadyCAPApplicationVersion() is called with one CAV in processing (not ready) state", - status: v1alpha1.CAPApplicationVersionStateProcessing, + status: v1alpha2.CAPApplicationVersionStateProcessing, number: 9, expectedVersion: "", }, { testName: "when getLatestReadyCAPApplicationVersion() is called with multiple CAVs in ready states", - status: v1alpha1.CAPApplicationVersionStateReady, + status: v1alpha2.CAPApplicationVersionStateReady, number: 18, expectedVersion: "0.9.0", }, @@ -409,16 +395,16 @@ func TestGetLatestReadyCAPApplicationVersion(t *testing.T) { for _, test := range tests { t.Run(test.testName, func(t *testing.T) { ca := createCaCRO(caCroName, true) - var cavs []*v1alpha1.CAPApplicationVersion + var cavs []*v1alpha2.CAPApplicationVersion for i := 1; i <= test.number; i++ { - var state v1alpha1.CAPApplicationVersionState + var state v1alpha2.CAPApplicationVersionState // for mixed states - mark the latest versions in processing (not-ready) state if test.status == "mixed" { if i > 9 { - state = v1alpha1.CAPApplicationVersionStateProcessing + state = v1alpha2.CAPApplicationVersionStateProcessing } else { - state = v1alpha1.CAPApplicationVersionStateReady + state = v1alpha2.CAPApplicationVersionStateReady } } else { state = test.status @@ -440,13 +426,13 @@ func TestGetLatestReadyCAPApplicationVersion(t *testing.T) { defer deregisterMetrics() c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, + cas: []*v1alpha2.CAPApplication{ca}, cavs: cavs, }) latestCav, err := c.getLatestReadyCAPApplicationVersion(ca, false) - if test.status == v1alpha1.CAPApplicationVersionStateReady || test.status == "mixed" { + if test.status == v1alpha2.CAPApplicationVersionStateReady || test.status == "mixed" { if err != nil { t.Fatal("Error should not be thrown") } @@ -504,19 +490,19 @@ func TestGetLatestCAPApplicationVersion(t *testing.T) { for _, test := range tests { t.Run(test.testName, func(t *testing.T) { ca := createCaCRO(caCroName, true) - var cavs []*v1alpha1.CAPApplicationVersion + var cavs []*v1alpha2.CAPApplicationVersion for i := 1; i <= test.number; i++ { - var state v1alpha1.CAPApplicationVersionState + var state v1alpha2.CAPApplicationVersionState // for mixed states - mark the latest versions in processing (not-ready) state if test.status == "mixed" { if i > 9 { - state = v1alpha1.CAPApplicationVersionStateProcessing + state = v1alpha2.CAPApplicationVersionStateProcessing } else { - state = v1alpha1.CAPApplicationVersionStateReady + state = v1alpha2.CAPApplicationVersionStateReady } } else { - state = v1alpha1.CAPApplicationVersionStateReady + state = v1alpha2.CAPApplicationVersionStateReady } indexString := strconv.Itoa(i) @@ -535,7 +521,7 @@ func TestGetLatestCAPApplicationVersion(t *testing.T) { defer deregisterMetrics() c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, + cas: []*v1alpha2.CAPApplication{ca}, cavs: cavs, }) diff --git a/internal/controller/rollout-manager.go b/internal/controller/rollout-manager.go index 057cb1bd..016cfff3 100644 --- a/internal/controller/rollout-manager.go +++ b/internal/controller/rollout-manager.go @@ -15,7 +15,7 @@ import ( "time" "github.com/sap/cap-operator/internal/util" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" appsv1 "k8s.io/api/apps/v1" k8sErrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -152,7 +152,7 @@ func (m *rolloutManager) Start(ctx context.Context) { // enqueue namespace/secrets from all relevant CAs (RolloutOnCredentialUpdate=true), to potentially handle missed updates (e.g. during a crash) func (m *rolloutManager) enqueuePendingRollouts() error { - cas, err := m.ctrl.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().List(labels.Everything()) + cas, err := m.ctrl.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().List(labels.Everything()) if err != nil { return fmt.Errorf("error listing CAPApplications for startup rollout check: %w", err) } @@ -187,7 +187,7 @@ func (m *rolloutManager) processNamespace(ctx context.Context, namespace string, return nil } - cas, err := m.ctrl.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().CAPApplications(namespace).List(labels.Everything()) + cas, err := m.ctrl.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().CAPApplications(namespace).List(labels.Everything()) if err != nil { return fmt.Errorf("error listing CAPApplications in namespace %s: %w", namespace, err) } @@ -208,7 +208,7 @@ func (m *rolloutManager) processNamespace(ctx context.Context, namespace string, } // returns the set of BTP service names in the CA that refer to the provided affected secrets. -func btpServicesForSecrets(ca *v1alpha1.CAPApplication, affectedSecrets map[string]struct{}) map[string]struct{} { +func btpServicesForSecrets(ca *v1alpha2.CAPApplication, affectedSecrets map[string]struct{}) map[string]struct{} { result := map[string]struct{}{} for _, serviceInfo := range ca.Spec.BTP.Services { if _, ok := affectedSecrets[serviceInfo.Secret]; ok { @@ -219,7 +219,7 @@ func btpServicesForSecrets(ca *v1alpha1.CAPApplication, affectedSecrets map[stri } // triggers processing of all relevant CAVs for the CA -func (m *rolloutManager) processAffectedApplication(ctx context.Context, ca *v1alpha1.CAPApplication, affectedServiceNames map[string]struct{}) error { +func (m *rolloutManager) processAffectedApplication(ctx context.Context, ca *v1alpha2.CAPApplication, affectedServiceNames map[string]struct{}) error { relevantCAVs, err := m.ctrl.collectRelevantCAVs(ca) if err != nil { return fmt.Errorf("error collecting CAVs for %s: %w", ca.Name, err) @@ -234,8 +234,8 @@ func (m *rolloutManager) processAffectedApplication(ctx context.Context, ca *v1a } // collects all affected deployment workloads and rolls out those that consume at least one of the affected BTP services. -func (m *rolloutManager) processAffectedVersion(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, affectedServiceNames map[string]struct{}) error { - ownerRef := *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)) +func (m *rolloutManager) processAffectedVersion(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, affectedServiceNames map[string]struct{}) error { + ownerRef := *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)) for i := range cav.Spec.Workloads { workload := &cav.Spec.Workloads[i] if workload.DeploymentDefinition == nil || !workloadConsumesAffectedService(workload, affectedServiceNames) { @@ -250,7 +250,7 @@ func (m *rolloutManager) processAffectedVersion(ctx context.Context, ca *v1alpha } // reports whether the workload consumes any service from affectedServiceNames -func workloadConsumesAffectedService(workload *v1alpha1.WorkloadDetails, affectedServiceNames map[string]struct{}) bool { +func workloadConsumesAffectedService(workload *v1alpha2.WorkloadDetails, affectedServiceNames map[string]struct{}) bool { for _, svcName := range workload.ConsumedBTPServices { if _, ok := affectedServiceNames[svcName]; ok { return true @@ -260,8 +260,8 @@ func workloadConsumesAffectedService(workload *v1alpha1.WorkloadDetails, affecte } // returns the latest ready CAV plus all ready CAVs currently in use by tenants. -func (c *Controller) collectRelevantCAVs(ca *v1alpha1.CAPApplication) (map[string]*v1alpha1.CAPApplicationVersion, error) { - relevantCAVs := map[string]*v1alpha1.CAPApplicationVersion{} +func (c *Controller) collectRelevantCAVs(ca *v1alpha2.CAPApplication) (map[string]*v1alpha2.CAPApplicationVersion, error) { + relevantCAVs := map[string]*v1alpha2.CAPApplicationVersion{} latestCav, err := c.getLatestReadyCAPApplicationVersion(ca, true) if err != nil { @@ -278,20 +278,20 @@ func (c *Controller) collectRelevantCAVs(ca *v1alpha1.CAPApplication) (map[strin } // appends all ready CAVs referenced by ready tenants of the CA into the provided map. -func (c *Controller) addTenantCAVs(ca *v1alpha1.CAPApplication, relevantCAVs map[string]*v1alpha1.CAPApplicationVersion) error { +func (c *Controller) addTenantCAVs(ca *v1alpha2.CAPApplication, relevantCAVs map[string]*v1alpha2.CAPApplicationVersion) error { tenants, err := c.getRelevantTenantsForCA(ca) if err != nil { return err } for _, tenant := range tenants { - if tenant.Status.State != v1alpha1.CAPTenantStateReady || tenant.Status.CurrentCAPApplicationVersionInstance == "" { + if tenant.Status.State != v1alpha2.CAPTenantStateReady || tenant.Status.CurrentCAPApplicationVersionInstance == "" { continue } cavName := tenant.Status.CurrentCAPApplicationVersionInstance if _, seen := relevantCAVs[cavName]; seen { continue } - cav, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister().CAPApplicationVersions(ca.Namespace).Get(cavName) + cav, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister().CAPApplicationVersions(ca.Namespace).Get(cavName) if err != nil { util.LogError(err, "error getting CAPApplicationVersion for credential rollout", "controller", ca, nil, "application", ca.Name, "version", cavName) continue @@ -305,7 +305,7 @@ func (c *Controller) addTenantCAVs(ca *v1alpha1.CAPApplication, relevantCAVs map // rotates the VCAP secret used by the affected deployment workload and updates the deployment's envFrom reference to trigger a // Kubernetes rollout with fresh credentials. -func (c *Controller) rolloutWorkloadDeployment(ctx context.Context, ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion, workload *v1alpha1.WorkloadDetails, ownerRef metav1.OwnerReference) error { +func (c *Controller) rolloutWorkloadDeployment(ctx context.Context, ca *v1alpha2.CAPApplication, cav *v1alpha2.CAPApplicationVersion, workload *v1alpha2.WorkloadDetails, ownerRef metav1.OwnerReference) error { deploymentName := getWorkloadName(cav.Name, workload.Name) deployment, err := c.kubeClient.AppsV1().Deployments(cav.Namespace).Get(ctx, deploymentName, metav1.GetOptions{}) diff --git a/internal/controller/rollout-manager_test.go b/internal/controller/rollout-manager_test.go index 3b314e3e..846caf9e 100644 --- a/internal/controller/rollout-manager_test.go +++ b/internal/controller/rollout-manager_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -24,8 +24,8 @@ import ( // buildCA creates a CAPApplication with the given services and the // RolloutOnCredentialUpdate flag set to enabled. -func buildCA(name string, rolloutEnabled bool, services []v1alpha1.ServiceInfo) *v1alpha1.CAPApplication { - return &v1alpha1.CAPApplication{ +func buildCA(name string, rolloutEnabled bool, services []v1alpha2.ServiceInfo) *v1alpha2.CAPApplication { + return &v1alpha2.CAPApplication{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: metav1.NamespaceDefault, @@ -33,11 +33,11 @@ func buildCA(name string, rolloutEnabled bool, services []v1alpha1.ServiceInfo) LabelAppIdHash: sha1Sum(providerSubaccountId, btpApplicationName), }, }, - Spec: v1alpha1.CAPApplicationSpec{ + Spec: v1alpha2.CAPApplicationSpec{ ProviderSubaccountId: providerSubaccountId, BTPAppName: btpApplicationName, RolloutOnCredentialUpdate: rolloutEnabled, - BTP: v1alpha1.BTP{ + BTP: v1alpha2.BTP{ Services: services, }, }, @@ -45,8 +45,8 @@ func buildCA(name string, rolloutEnabled bool, services []v1alpha1.ServiceInfo) } // buildReadyCAV creates a CAPApplicationVersion in Ready state with the given workloads. -func buildReadyCAV(name, caName string, workloads []v1alpha1.WorkloadDetails) *v1alpha1.CAPApplicationVersion { - return &v1alpha1.CAPApplicationVersion{ +func buildReadyCAV(name, caName string, workloads []v1alpha2.WorkloadDetails) *v1alpha2.CAPApplicationVersion { + return &v1alpha2.CAPApplicationVersion{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: metav1.NamespaceDefault, @@ -54,25 +54,25 @@ func buildReadyCAV(name, caName string, workloads []v1alpha1.WorkloadDetails) *v LabelOwnerIdentifierHash: sha1Sum(metav1.NamespaceDefault, caName), }, }, - Spec: v1alpha1.CAPApplicationVersionSpec{ + Spec: v1alpha2.CAPApplicationVersionSpec{ CAPApplicationInstance: caName, Version: "1.0.0", Workloads: workloads, }, - Status: v1alpha1.CAPApplicationVersionStatus{ - GenericStatus: v1alpha1.GenericStatus{ + Status: v1alpha2.CAPApplicationVersionStatus{ + GenericStatus: v1alpha2.GenericStatus{ Conditions: []metav1.Condition{ - {Type: string(v1alpha1.ConditionTypeReady), Status: metav1.ConditionTrue}, + {Type: string(v1alpha2.ConditionTypeReady), Status: metav1.ConditionTrue}, }, }, - State: v1alpha1.CAPApplicationVersionStateReady, + State: v1alpha2.CAPApplicationVersionStateReady, }, } } // buildReadyTenant creates a CAPTenant in Ready state pointing to cavName. -func buildReadyTenant(name, caName, cavName string) *v1alpha1.CAPTenant { - return &v1alpha1.CAPTenant{ +func buildReadyTenant(name, caName, cavName string) *v1alpha2.CAPTenant { + return &v1alpha2.CAPTenant{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: metav1.NamespaceDefault, @@ -81,19 +81,19 @@ func buildReadyTenant(name, caName, cavName string) *v1alpha1.CAPTenant { LabelTenantId: providerTenantId, }, }, - Spec: v1alpha1.CAPTenantSpec{ + Spec: v1alpha2.CAPTenantSpec{ CAPApplicationInstance: caName, - BTPTenantIdentification: v1alpha1.BTPTenantIdentification{ + BTPTenantIdentification: v1alpha2.BTPTenantIdentification{ SubDomain: providerSubDomain, TenantId: providerTenantId, }, }, - Status: v1alpha1.CAPTenantStatus{ - State: v1alpha1.CAPTenantStateReady, + Status: v1alpha2.CAPTenantStatus{ + State: v1alpha2.CAPTenantStateReady, CurrentCAPApplicationVersionInstance: cavName, - GenericStatus: v1alpha1.GenericStatus{ + GenericStatus: v1alpha2.GenericStatus{ Conditions: []metav1.Condition{ - {Type: string(v1alpha1.ConditionTypeReady), Status: metav1.ConditionTrue}, + {Type: string(v1alpha2.ConditionTypeReady), Status: metav1.ConditionTrue}, }, }, }, @@ -122,8 +122,8 @@ func buildDeployment(cavName, workloadName, namespace string) *appsv1.Deployment } // btpServices returns a reusable set of service definitions matching the common credential-secrets. -func btpServices() []v1alpha1.ServiceInfo { - return []v1alpha1.ServiceInfo{ +func btpServices() []v1alpha2.ServiceInfo { + return []v1alpha2.ServiceInfo{ {Class: "xsuaa", Name: "cap-uaa", Secret: "cap-cap-01-uaa-bind-cf"}, {Class: "saas-registry", Name: "cap-saas-registry", Secret: "cap-cap-01-saas-bind-cf"}, {Class: "service-manager", Name: "cap-service-manager", Secret: "cap-cap-01-svc-man-bind-cf"}, @@ -221,7 +221,7 @@ func TestBtpServicesForSecrets_EmptySecretSet(t *testing.T) { // --------------------------------------------------------------------------- func TestWorkloadConsumesAffectedService_Matches(t *testing.T) { - workload := &v1alpha1.WorkloadDetails{ + workload := &v1alpha2.WorkloadDetails{ Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa", "cap-service-manager"}, } @@ -232,7 +232,7 @@ func TestWorkloadConsumesAffectedService_Matches(t *testing.T) { } func TestWorkloadConsumesAffectedService_NoMatch(t *testing.T) { - workload := &v1alpha1.WorkloadDetails{ + workload := &v1alpha2.WorkloadDetails{ Name: "app-router", ConsumedBTPServices: []string{"cap-uaa"}, } @@ -243,7 +243,7 @@ func TestWorkloadConsumesAffectedService_NoMatch(t *testing.T) { } func TestWorkloadConsumesAffectedService_EmptyConsumed(t *testing.T) { - workload := &v1alpha1.WorkloadDetails{ + workload := &v1alpha2.WorkloadDetails{ Name: "app-router", ConsumedBTPServices: []string{}, } @@ -410,19 +410,19 @@ func TestProcessNamespace_EmptyAffectedSecrets(t *testing.T) { func TestProcessNamespace_RolloutDisabledOnCA(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", false /* rollout disabled */, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) m := newRolloutManager(c) @@ -446,19 +446,19 @@ func TestProcessNamespace_RolloutDisabledOnCA(t *testing.T) { func TestProcessNamespace_NoMatchingServicesForSecrets(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) m := newRolloutManager(c) @@ -488,7 +488,7 @@ func TestProcessAffectedApplication_NoRelevantCAVs(t *testing.T) { ca := buildCA("test-cap-01", true, btpServices()) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, + cas: []*v1alpha2.CAPApplication{ca}, }) m := newRolloutManager(c) @@ -501,12 +501,12 @@ func TestProcessAffectedApplication_NoRelevantCAVs(t *testing.T) { func TestProcessAffectedApplication_WithLatestReadyCAV(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) @@ -519,8 +519,8 @@ func TestProcessAffectedApplication_WithLatestReadyCAV(t *testing.T) { } c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) // add objects to fake clients directly c.kubeClient.(*k8sfake.Clientset).Tracker().Add(deploy) @@ -561,7 +561,7 @@ func TestProcessAffectedApplication_WithLatestReadyCAV(t *testing.T) { func TestProcessAffectedVersion_WorkloadWithNoDeploymentDef(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { // job workload — no DeploymentDefinition Name: "content-job", @@ -570,8 +570,8 @@ func TestProcessAffectedVersion_WorkloadWithNoDeploymentDef(t *testing.T) { }) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) m := newRolloutManager(c) err := m.processAffectedVersion(context.TODO(), ca, cav, map[string]struct{}{"cap-uaa": {}}) @@ -590,19 +590,19 @@ func TestProcessAffectedVersion_WorkloadWithNoDeploymentDef(t *testing.T) { func TestProcessAffectedVersion_DeploymentNotYetCreated(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) m := newRolloutManager(c) // No deployment pre-created → should silently skip (not an error) @@ -772,11 +772,11 @@ func TestUpdateDeploymentVCAPRef_UpdatesContainersAndInitContainers(t *testing.T func TestCollectRelevantCAVs_LatestReadyOnly(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{}) + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{}) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) relevant, err := c.collectRelevantCAVs(ca) @@ -794,15 +794,15 @@ func TestCollectRelevantCAVs_LatestReadyOnly(t *testing.T) { func TestCollectRelevantCAVs_DeduplicatesLatestAndTenantCAV(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{}) + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{}) // Tenant also references the same CAV tenant := buildReadyTenant("test-cap-01-provider", ca.Name, cav.Name) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, - cats: []*v1alpha1.CAPTenant{tenant}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, + cats: []*v1alpha2.CAPTenant{tenant}, }) relevant, err := c.collectRelevantCAVs(ca) @@ -820,19 +820,19 @@ func TestCollectRelevantCAVs_TenantReferencesAdditionalCAV(t *testing.T) { ca := buildCA("test-cap-01", true, btpServices()) // Latest ready CAV - latestCAV := buildReadyCAV("test-cap-01-cav-v2", ca.Name, []v1alpha1.WorkloadDetails{}) + latestCAV := buildReadyCAV("test-cap-01-cav-v2", ca.Name, []v1alpha2.WorkloadDetails{}) latestCAV.Spec.Version = "2.0.0" // Older CAV still in use by a tenant - oldCAV := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{}) + oldCAV := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{}) oldCAV.Spec.Version = "1.0.0" tenant := buildReadyTenant("test-cap-01-provider", ca.Name, oldCAV.Name) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{latestCAV, oldCAV}, - cats: []*v1alpha1.CAPTenant{tenant}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{latestCAV, oldCAV}, + cats: []*v1alpha2.CAPTenant{tenant}, }) relevant, err := c.collectRelevantCAVs(ca) @@ -858,7 +858,7 @@ func TestEnqueuePendingRollouts_NoRelevantCAs(t *testing.T) { defer deregisterMetrics() // CA with rollout disabled — nothing should be enqueued ca := buildCA("test-cap-01", false, btpServices()) - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca}}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca}}) m := newRolloutManager(c) defer m.queue.ShutDown() @@ -873,7 +873,7 @@ func TestEnqueuePendingRollouts_NoRelevantCAs(t *testing.T) { func TestEnqueuePendingRollouts_EnqueuesNamespaceForRelevantCA(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca}}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca}}) m := newRolloutManager(c) defer m.queue.ShutDown() @@ -897,14 +897,14 @@ func TestEnqueuePendingRollouts_MultipleCAsSameNamespaceDeduplicatesSecrets(t *t defer deregisterMetrics() // Two CAs in the same namespace sharing one secret — should only enqueue it once sharedSecret := "shared-secret" - ca1 := buildCA("test-cap-01", true, []v1alpha1.ServiceInfo{ + ca1 := buildCA("test-cap-01", true, []v1alpha2.ServiceInfo{ {Class: "xsuaa", Name: "svc-a", Secret: sharedSecret}, }) - ca2 := buildCA("test-cap-02", true, []v1alpha1.ServiceInfo{ + ca2 := buildCA("test-cap-02", true, []v1alpha2.ServiceInfo{ {Class: "xsuaa", Name: "svc-b", Secret: sharedSecret}, {Class: "saas-registry", Name: "svc-c", Secret: "unique-secret"}, }) - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca1, ca2}}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca1, ca2}}) m := newRolloutManager(c) defer m.queue.ShutDown() @@ -926,20 +926,20 @@ func TestProcessNamespace_FullRollout(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, { // App-router does NOT consume cap-uaa, should not be rolled out Name: "app-router", ConsumedBTPServices: []string{"cap-saas-registry"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) @@ -953,8 +953,8 @@ func TestProcessNamespace_FullRollout(t *testing.T) { } c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) for _, obj := range []interface{ GetName() string }{backendDeploy, routerDeploy} { switch o := obj.(type) { @@ -996,12 +996,12 @@ func TestProcessNamespace_SkipsRolloutWhenVCAPUnchanged(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) @@ -1014,8 +1014,8 @@ func TestProcessNamespace_SkipsRolloutWhenVCAPUnchanged(t *testing.T) { } c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) c.kubeClient.(*k8sfake.Clientset).Tracker().Add(backendDeploy) c.kubeInformerFactory.Apps().V1().Deployments().Informer().GetIndexer().Add(backendDeploy) @@ -1025,7 +1025,7 @@ func TestProcessNamespace_SkipsRolloutWhenVCAPUnchanged(t *testing.T) { // Pre-compute the VCAP content that rolloutWorkloadDeployment would generate, // then seed a secret with that exact content so checkVCAPSecret returns unchanged=true. deploymentName := getWorkloadName(cav.Name, "cap-backend") - ownerRef := *metav1.NewControllerRef(cav, v1alpha1.SchemeGroupVersion.WithKind(v1alpha1.CAPApplicationVersionKind)) + ownerRef := *metav1.NewControllerRef(cav, v1alpha2.SchemeGroupVersion.WithKind(v1alpha2.CAPApplicationVersionKind)) consumedServiceInfos := getConsumedServiceInfos(getConsumedServiceMap([]string{"cap-uaa"}), ca.Spec.BTP.Services) vcapEnv, err := generateVCAPEnv(metav1.NamespaceDefault, consumedServiceInfos, c.kubeInformerFactory) if err != nil { @@ -1097,7 +1097,7 @@ func TestStartWorker_SuccessPath(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca}}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca}}) m := newFastRolloutManager(c) ctx, cancel := context.WithCancel(context.Background()) @@ -1128,12 +1128,12 @@ func TestStartWorker_ErrorPathRestoresSecretsAndRequeues(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha1.WorkloadDetails{ + cav := buildReadyCAV("test-cap-01-cav-v1", ca.Name, []v1alpha2.WorkloadDetails{ { Name: "cap-backend", ConsumedBTPServices: []string{"cap-uaa"}, - DeploymentDefinition: &v1alpha1.DeploymentDetails{ - CommonDetails: v1alpha1.CommonDetails{Image: "test://image"}, + DeploymentDefinition: &v1alpha2.DeploymentDetails{ + CommonDetails: v1alpha2.CommonDetails{Image: "test://image"}, }, }, }) @@ -1141,8 +1141,8 @@ func TestStartWorker_ErrorPathRestoresSecretsAndRequeues(t *testing.T) { deploy := buildDeployment(cav.Name, "cap-backend", metav1.NamespaceDefault) c := getTestController(testResources{ - cas: []*v1alpha1.CAPApplication{ca}, - cavs: []*v1alpha1.CAPApplicationVersion{cav}, + cas: []*v1alpha2.CAPApplication{ca}, + cavs: []*v1alpha2.CAPApplicationVersion{cav}, }) c.kubeClient.(*k8sfake.Clientset).Tracker().Add(deploy) c.kubeInformerFactory.Apps().V1().Deployments().Informer().GetIndexer().Add(deploy) @@ -1205,7 +1205,7 @@ func TestStartWorker_DrainSecretsCalledBeforeProcessing(t *testing.T) { defer deregisterMetrics() ca := buildCA("test-cap-01", true, btpServices()) - c := getTestController(testResources{cas: []*v1alpha1.CAPApplication{ca}}) + c := getTestController(testResources{cas: []*v1alpha2.CAPApplication{ca}}) m := newFastRolloutManager(c) // Pre-populate two secrets for the same namespace. diff --git a/internal/controller/testdata/capapplication/ca-01.expected.yaml b/internal/controller/testdata/capapplication/ca-01.expected.yaml index df42ec50..40c4acaa 100644 --- a/internal/controller/testdata/capapplication/ca-01.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-01.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-01.initial.yaml b/internal/controller/testdata/capapplication/ca-01.initial.yaml index c5f62e5c..c47103c8 100644 --- a/internal/controller/testdata/capapplication/ca-01.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-01.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-02.expected.yaml b/internal/controller/testdata/capapplication/ca-02.expected.yaml index bbec1bfc..389cb39e 100644 --- a/internal/controller/testdata/capapplication/ca-02.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-02.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-02.initial.yaml b/internal/controller/testdata/capapplication/ca-02.initial.yaml index ced24d9a..39299cdc 100644 --- a/internal/controller/testdata/capapplication/ca-02.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-02.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-03.expected.yaml b/internal/controller/testdata/capapplication/ca-03.expected.yaml index 171c6cf8..e26e0a1a 100644 --- a/internal/controller/testdata/capapplication/ca-03.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-03.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-03.initial.yaml b/internal/controller/testdata/capapplication/ca-03.initial.yaml index ced24d9a..39299cdc 100644 --- a/internal/controller/testdata/capapplication/ca-03.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-03.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-04.expected.yaml b/internal/controller/testdata/capapplication/ca-04.expected.yaml index 0e4fb268..8d120d42 100644 --- a/internal/controller/testdata/capapplication/ca-04.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-04.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-04.initial.yaml b/internal/controller/testdata/capapplication/ca-04.initial.yaml index c4101b6a..7ed593cc 100644 --- a/internal/controller/testdata/capapplication/ca-04.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-04.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-05.expected.yaml b/internal/controller/testdata/capapplication/ca-05.expected.yaml index 171c6cf8..e26e0a1a 100644 --- a/internal/controller/testdata/capapplication/ca-05.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-05.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-05.initial.yaml b/internal/controller/testdata/capapplication/ca-05.initial.yaml index ced24d9a..39299cdc 100644 --- a/internal/controller/testdata/capapplication/ca-05.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-05.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-06.expected.yaml b/internal/controller/testdata/capapplication/ca-06.expected.yaml index 5ffd7973..be8ae344 100644 --- a/internal/controller/testdata/capapplication/ca-06.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-06.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-06.initial.yaml b/internal/controller/testdata/capapplication/ca-06.initial.yaml index 8283ccb4..6663c4ef 100644 --- a/internal/controller/testdata/capapplication/ca-06.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-06.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-09.expected.yaml b/internal/controller/testdata/capapplication/ca-09.expected.yaml index 54d24813..f8e99760 100644 --- a/internal/controller/testdata/capapplication/ca-09.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-09.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-09.initial.yaml b/internal/controller/testdata/capapplication/ca-09.initial.yaml index 8283ccb4..6663c4ef 100644 --- a/internal/controller/testdata/capapplication/ca-09.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-09.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-12.expected.yaml b/internal/controller/testdata/capapplication/ca-12.expected.yaml index 2abfd235..249a9de4 100644 --- a/internal/controller/testdata/capapplication/ca-12.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-12.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-12.initial.yaml b/internal/controller/testdata/capapplication/ca-12.initial.yaml index 8283ccb4..6663c4ef 100644 --- a/internal/controller/testdata/capapplication/ca-12.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-12.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-13.expected.yaml b/internal/controller/testdata/capapplication/ca-13.expected.yaml index 29e2671e..c04ce047 100644 --- a/internal/controller/testdata/capapplication/ca-13.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-13.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-13.initial.yaml b/internal/controller/testdata/capapplication/ca-13.initial.yaml index ea83e29b..b140ca8c 100644 --- a/internal/controller/testdata/capapplication/ca-13.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-13.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: generation: 2 diff --git a/internal/controller/testdata/capapplication/ca-14.expected.yaml b/internal/controller/testdata/capapplication/ca-14.expected.yaml index a2943096..aa095f9b 100644 --- a/internal/controller/testdata/capapplication/ca-14.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-14.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: deletionTimestamp: "2022-03-22T13:24:38Z" diff --git a/internal/controller/testdata/capapplication/ca-14.initial.yaml b/internal/controller/testdata/capapplication/ca-14.initial.yaml index cbc2d7b2..45cebde5 100644 --- a/internal/controller/testdata/capapplication/ca-14.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-14.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: deletionTimestamp: "2022-03-22T13:24:38Z" diff --git a/internal/controller/testdata/capapplication/ca-15.expected.yaml b/internal/controller/testdata/capapplication/ca-15.expected.yaml index 204d7e52..022d35fd 100644 --- a/internal/controller/testdata/capapplication/ca-15.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-15.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-15.initial.yaml b/internal/controller/testdata/capapplication/ca-15.initial.yaml index 86c12bce..0538f24f 100644 --- a/internal/controller/testdata/capapplication/ca-15.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-15.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-16.expected.yaml b/internal/controller/testdata/capapplication/ca-16.expected.yaml index 3f3f5536..9a816ad6 100644 --- a/internal/controller/testdata/capapplication/ca-16.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-16.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: [] diff --git a/internal/controller/testdata/capapplication/ca-16.initial.yaml b/internal/controller/testdata/capapplication/ca-16.initial.yaml index 65a53d7b..032c8a01 100644 --- a/internal/controller/testdata/capapplication/ca-16.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-16.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: deletionTimestamp: "2022-03-22T13:24:38Z" diff --git a/internal/controller/testdata/capapplication/ca-17.expected.yaml b/internal/controller/testdata/capapplication/ca-17.expected.yaml index 2001c17c..cbcf2b94 100644 --- a/internal/controller/testdata/capapplication/ca-17.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-17.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-17.initial.yaml b/internal/controller/testdata/capapplication/ca-17.initial.yaml index 6ec1546d..e30f703f 100644 --- a/internal/controller/testdata/capapplication/ca-17.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-17.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: deletionTimestamp: "2022-03-22T13:24:38Z" diff --git a/internal/controller/testdata/capapplication/ca-18.expected.yaml b/internal/controller/testdata/capapplication/ca-18.expected.yaml index f5c6fc6b..8ac2ffcc 100644 --- a/internal/controller/testdata/capapplication/ca-18.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-18.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: [] diff --git a/internal/controller/testdata/capapplication/ca-18.initial.yaml b/internal/controller/testdata/capapplication/ca-18.initial.yaml index bfefa5e2..ff3e2d93 100644 --- a/internal/controller/testdata/capapplication/ca-18.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-18.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: deletionTimestamp: "2022-03-22T13:24:38Z" diff --git a/internal/controller/testdata/capapplication/ca-19.expected.yaml b/internal/controller/testdata/capapplication/ca-19.expected.yaml index 396ff44e..db909bdc 100644 --- a/internal/controller/testdata/capapplication/ca-19.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-19.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: [] diff --git a/internal/controller/testdata/capapplication/ca-19.initial.yaml b/internal/controller/testdata/capapplication/ca-19.initial.yaml index 2796746b..b30017b8 100644 --- a/internal/controller/testdata/capapplication/ca-19.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-19.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: deletionTimestamp: "2022-03-22T13:24:38Z" diff --git a/internal/controller/testdata/capapplication/ca-29.expected.yaml b/internal/controller/testdata/capapplication/ca-29.expected.yaml index 7c420752..ece029b0 100644 --- a/internal/controller/testdata/capapplication/ca-29.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-29.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-29.initial.yaml b/internal/controller/testdata/capapplication/ca-29.initial.yaml index 7e6446ee..5f8773db 100644 --- a/internal/controller/testdata/capapplication/ca-29.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-29.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-30.expected.yaml b/internal/controller/testdata/capapplication/ca-30.expected.yaml index 424deb6a..45ff9206 100644 --- a/internal/controller/testdata/capapplication/ca-30.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-30.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-30.initial.yaml b/internal/controller/testdata/capapplication/ca-30.initial.yaml index 0a7e0e8b..cd0fec3b 100644 --- a/internal/controller/testdata/capapplication/ca-30.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-30.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-31-1.expected.yaml b/internal/controller/testdata/capapplication/ca-31-1.expected.yaml index 4205f0a3..e0b763a9 100644 --- a/internal/controller/testdata/capapplication/ca-31-1.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-31-1.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-31.expected.yaml b/internal/controller/testdata/capapplication/ca-31.expected.yaml index 00331843..2ccc022c 100644 --- a/internal/controller/testdata/capapplication/ca-31.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-31.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-31.initial.yaml b/internal/controller/testdata/capapplication/ca-31.initial.yaml index cc6c0b78..d8c01e23 100644 --- a/internal/controller/testdata/capapplication/ca-31.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-31.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-33.expected.yaml b/internal/controller/testdata/capapplication/ca-33.expected.yaml index 32cdda29..57c9a722 100644 --- a/internal/controller/testdata/capapplication/ca-33.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-33.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-33.initial.yaml b/internal/controller/testdata/capapplication/ca-33.initial.yaml index de4ea819..b4096f59 100644 --- a/internal/controller/testdata/capapplication/ca-33.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-33.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-42.expected.yaml b/internal/controller/testdata/capapplication/ca-42.expected.yaml index 4c289fe1..3fcad87f 100644 --- a/internal/controller/testdata/capapplication/ca-42.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-42.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-42.initial.yaml b/internal/controller/testdata/capapplication/ca-42.initial.yaml index df42ec50..40c4acaa 100644 --- a/internal/controller/testdata/capapplication/ca-42.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-42.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-43.expected.yaml b/internal/controller/testdata/capapplication/ca-43.expected.yaml index 3299fd77..1ef639aa 100644 --- a/internal/controller/testdata/capapplication/ca-43.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-43.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: @@ -37,7 +37,7 @@ spec: status: conditions: - reason: ProviderTenantError - message: "mocked api error (captenants.sme.sap.com/v1alpha1)" + message: "mocked api error (captenants.sme.sap.com/v1alpha2)" observedGeneration: 2 status: "False" type: Ready diff --git a/internal/controller/testdata/capapplication/ca-43.initial.yaml b/internal/controller/testdata/capapplication/ca-43.initial.yaml index 935e742c..db95e5eb 100644 --- a/internal/controller/testdata/capapplication/ca-43.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-43.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-45.expected.yaml b/internal/controller/testdata/capapplication/ca-45.expected.yaml index f69c1649..8c166707 100644 --- a/internal/controller/testdata/capapplication/ca-45.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-45.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-45.initial.yaml b/internal/controller/testdata/capapplication/ca-45.initial.yaml index 0b28c9c1..021e2208 100644 --- a/internal/controller/testdata/capapplication/ca-45.initial.yaml +++ b/internal/controller/testdata/capapplication/ca-45.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-processing-domainRefs.yaml b/internal/controller/testdata/capapplication/ca-processing-domainRefs.yaml index 54419cd7..828a810e 100644 --- a/internal/controller/testdata/capapplication/ca-processing-domainRefs.yaml +++ b/internal/controller/testdata/capapplication/ca-processing-domainRefs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-services-hostUpdated.yaml b/internal/controller/testdata/capapplication/ca-services-hostUpdated.yaml index 851b3e3f..a89b0f0c 100644 --- a/internal/controller/testdata/capapplication/ca-services-hostUpdated.yaml +++ b/internal/controller/testdata/capapplication/ca-services-hostUpdated.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-services-ready.yaml b/internal/controller/testdata/capapplication/ca-services-ready.yaml index 9f1e5160..ce6966a7 100644 --- a/internal/controller/testdata/capapplication/ca-services-ready.yaml +++ b/internal/controller/testdata/capapplication/ca-services-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-services.yaml b/internal/controller/testdata/capapplication/ca-services.yaml index 252265cf..fc5d629b 100644 --- a/internal/controller/testdata/capapplication/ca-services.yaml +++ b/internal/controller/testdata/capapplication/ca-services.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/capapplication/ca-with-cap-service-workloads.expected.yaml b/internal/controller/testdata/capapplication/ca-with-cap-service-workloads.expected.yaml index 681ebe17..19bdf621 100644 --- a/internal/controller/testdata/capapplication/ca-with-cap-service-workloads.expected.yaml +++ b/internal/controller/testdata/capapplication/ca-with-cap-service-workloads.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: @@ -67,7 +67,7 @@ metadata: generateName: test-cap-01 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-consumer-no-finalizers-ready.yaml b/internal/controller/testdata/capapplication/cat-consumer-no-finalizers-ready.yaml index 6de5905f..b3b81b28 100644 --- a/internal/controller/testdata/capapplication/cat-consumer-no-finalizers-ready.yaml +++ b/internal/controller/testdata/capapplication/cat-consumer-no-finalizers-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: annotations: @@ -14,7 +14,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-consumer-upg-never-deleting.yaml b/internal/controller/testdata/capapplication/cat-consumer-upg-never-deleting.yaml index 31e65a5e..933e08e7 100644 --- a/internal/controller/testdata/capapplication/cat-consumer-upg-never-deleting.yaml +++ b/internal/controller/testdata/capapplication/cat-consumer-upg-never-deleting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: labels: @@ -14,7 +14,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-consumer-upg-never-ready.yaml b/internal/controller/testdata/capapplication/cat-consumer-upg-never-ready.yaml index e3cc570b..06be3e4b 100644 --- a/internal/controller/testdata/capapplication/cat-consumer-upg-never-ready.yaml +++ b/internal/controller/testdata/capapplication/cat-consumer-upg-never-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: labels: @@ -14,7 +14,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-consumer-upgrading.yaml b/internal/controller/testdata/capapplication/cat-consumer-upgrading.yaml index ce64b68d..6c0b9f6f 100644 --- a/internal/controller/testdata/capapplication/cat-consumer-upgrading.yaml +++ b/internal/controller/testdata/capapplication/cat-consumer-upgrading.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: labels: @@ -14,7 +14,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-provider-error.yaml b/internal/controller/testdata/capapplication/cat-provider-error.yaml index e6867292..62047e7b 100644 --- a/internal/controller/testdata/capapplication/cat-provider-error.yaml +++ b/internal/controller/testdata/capapplication/cat-provider-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-provider-no-finalizers-ready.yaml b/internal/controller/testdata/capapplication/cat-provider-no-finalizers-ready.yaml index 6cda5ab8..73a271a7 100644 --- a/internal/controller/testdata/capapplication/cat-provider-no-finalizers-ready.yaml +++ b/internal/controller/testdata/capapplication/cat-provider-no-finalizers-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: annotations: @@ -13,7 +13,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cat-provider-upgrade-error.yaml b/internal/controller/testdata/capapplication/cat-provider-upgrade-error.yaml index 757d160c..ddb3b7b4 100644 --- a/internal/controller/testdata/capapplication/cat-provider-upgrade-error.yaml +++ b/internal/controller/testdata/capapplication/cat-provider-upgrade-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cav-33-version-updated-ready.yaml b/internal/controller/testdata/capapplication/cav-33-version-updated-ready.yaml index 2d5d146a..1005c1dc 100644 --- a/internal/controller/testdata/capapplication/cav-33-version-updated-ready.yaml +++ b/internal/controller/testdata/capapplication/cav-33-version-updated-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cav-error.yaml b/internal/controller/testdata/capapplication/cav-error.yaml index 48f6e2b8..2c6cc891 100644 --- a/internal/controller/testdata/capapplication/cav-error.yaml +++ b/internal/controller/testdata/capapplication/cav-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplication/cav-name-modified-ready.yaml b/internal/controller/testdata/capapplication/cav-name-modified-ready.yaml index 0756c295..421c4b2f 100644 --- a/internal/controller/testdata/capapplication/cav-name-modified-ready.yaml +++ b/internal/controller/testdata/capapplication/cav-name-modified-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1-modified namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed-content-suffix.yaml b/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed-content-suffix.yaml index 51cfeb9b..616698f2 100644 --- a/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed-content-suffix.yaml +++ b/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed-content-suffix.yaml @@ -7,7 +7,7 @@ metadata: name: test-cap-01-cav-v1-content-job-1-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -76,7 +76,7 @@ metadata: name: test-cap-01-cav-v1-content-job-2-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -152,7 +152,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -189,7 +189,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed.yaml b/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed.yaml index ff42514f..99835fc5 100644 --- a/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed.yaml +++ b/internal/controller/testdata/capapplicationversion/all-mulitple-content-job-completed.yaml @@ -7,7 +7,7 @@ metadata: name: test-cap-01-cav-v1-content-job-1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -76,7 +76,7 @@ metadata: name: test-cap-01-cav-v1-content-job-2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -152,7 +152,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -189,7 +189,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/cat-provider-version.yaml b/internal/controller/testdata/capapplicationversion/cat-provider-version.yaml index bf650746..49a742bd 100644 --- a/internal/controller/testdata/capapplicationversion/cat-provider-version.yaml +++ b/internal/controller/testdata/capapplicationversion/cat-provider-version.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-affinity.yaml b/internal/controller/testdata/capapplicationversion/cav-affinity.yaml index 41fdb54b..e3bc3f80 100644 --- a/internal/controller/testdata/capapplicationversion/cav-affinity.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-affinity.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-annotations.yaml b/internal/controller/testdata/capapplicationversion/cav-annotations.yaml index b63f6dce..0536e035 100644 --- a/internal/controller/testdata/capapplicationversion/cav-annotations.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-annotations.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-cluster-netpol-port.yaml b/internal/controller/testdata/capapplicationversion/cav-cluster-netpol-port.yaml index 5593029f..3d80f27f 100644 --- a/internal/controller/testdata/capapplicationversion/cav-cluster-netpol-port.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-cluster-netpol-port.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-custom-destination-config.yaml b/internal/controller/testdata/capapplicationversion/cav-custom-destination-config.yaml index 7b3f8928..a536b903 100644 --- a/internal/controller/testdata/capapplicationversion/cav-custom-destination-config.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-custom-destination-config.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-custom-labels.yaml b/internal/controller/testdata/capapplicationversion/cav-custom-labels.yaml index b1226db9..4cb868bd 100644 --- a/internal/controller/testdata/capapplicationversion/cav-custom-labels.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-custom-labels.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-empty-status.yaml b/internal/controller/testdata/capapplicationversion/cav-empty-status.yaml index 813cd8a2..6f5f4027 100644 --- a/internal/controller/testdata/capapplicationversion/cav-empty-status.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-empty-status.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" diff --git a/internal/controller/testdata/capapplicationversion/cav-error-condition-status.yaml b/internal/controller/testdata/capapplicationversion/cav-error-condition-status.yaml index af3db22f..03f07f42 100644 --- a/internal/controller/testdata/capapplicationversion/cav-error-condition-status.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-error-condition-status.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" diff --git a/internal/controller/testdata/capapplicationversion/cav-error-status.yaml b/internal/controller/testdata/capapplicationversion/cav-error-status.yaml index 18a7c12a..73cd29e4 100644 --- a/internal/controller/testdata/capapplicationversion/cav-error-status.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-error-status.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" diff --git a/internal/controller/testdata/capapplicationversion/cav-failed-content-job.yaml b/internal/controller/testdata/capapplicationversion/cav-failed-content-job.yaml index d3165492..85767dfe 100644 --- a/internal/controller/testdata/capapplicationversion/cav-failed-content-job.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-failed-content-job.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-hpa.yaml b/internal/controller/testdata/capapplicationversion/cav-hpa.yaml index c8057c0b..d676e648 100644 --- a/internal/controller/testdata/capapplicationversion/cav-hpa.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-hpa.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-init.yaml b/internal/controller/testdata/capapplicationversion/cav-init.yaml index 5fcca23f..52e1ded7 100644 --- a/internal/controller/testdata/capapplicationversion/cav-init.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-init.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-invalid-ca.yaml b/internal/controller/testdata/capapplicationversion/cav-invalid-ca.yaml index bcdf5bd9..b8e47802 100644 --- a/internal/controller/testdata/capapplicationversion/cav-invalid-ca.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-invalid-ca.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" diff --git a/internal/controller/testdata/capapplicationversion/cav-invalid-env-cap.yaml b/internal/controller/testdata/capapplicationversion/cav-invalid-env-cap.yaml index 0fb10aaa..094649b0 100644 --- a/internal/controller/testdata/capapplicationversion/cav-invalid-env-cap.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-invalid-env-cap.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-invalid-env-content.yaml b/internal/controller/testdata/capapplicationversion/cav-invalid-env-content.yaml index 5441c667..871c68f3 100644 --- a/internal/controller/testdata/capapplicationversion/cav-invalid-env-content.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-invalid-env-content.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-invalid-env-job-worker.yaml b/internal/controller/testdata/capapplicationversion/cav-invalid-env-job-worker.yaml index 3f92e47a..ee88a7a7 100644 --- a/internal/controller/testdata/capapplicationversion/cav-invalid-env-job-worker.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-invalid-env-job-worker.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-merged-destinations-router.yaml b/internal/controller/testdata/capapplicationversion/cav-merged-destinations-router.yaml index 1faacba8..1d1b7c0e 100644 --- a/internal/controller/testdata/capapplicationversion/cav-merged-destinations-router.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-merged-destinations-router.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-node-prio.yaml b/internal/controller/testdata/capapplicationversion/cav-node-prio.yaml index 76b64751..fae680e2 100644 --- a/internal/controller/testdata/capapplicationversion/cav-node-prio.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-node-prio.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-node-selector.yaml b/internal/controller/testdata/capapplicationversion/cav-node-selector.yaml index 5048e116..f1e5b633 100644 --- a/internal/controller/testdata/capapplicationversion/cav-node-selector.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-node-selector.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-pod-lifecycle.yaml b/internal/controller/testdata/capapplicationversion/cav-pod-lifecycle.yaml index 5256b5aa..78ff977c 100644 --- a/internal/controller/testdata/capapplicationversion/cav-pod-lifecycle.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-pod-lifecycle.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-pod-security-context.yaml b/internal/controller/testdata/capapplicationversion/cav-pod-security-context.yaml index b6a0840c..82daeaf1 100644 --- a/internal/controller/testdata/capapplicationversion/cav-pod-security-context.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-pod-security-context.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-probes-and-resources.yaml b/internal/controller/testdata/capapplicationversion/cav-probes-and-resources.yaml index aa48c891..c4cadf95 100644 --- a/internal/controller/testdata/capapplicationversion/cav-probes-and-resources.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-probes-and-resources.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-processing-job-finished.yaml b/internal/controller/testdata/capapplicationversion/cav-processing-job-finished.yaml index a1d480b4..ca9d2c46 100644 --- a/internal/controller/testdata/capapplicationversion/cav-processing-job-finished.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-processing-job-finished.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-processing-with-multiple-content-jobs.yaml b/internal/controller/testdata/capapplicationversion/cav-processing-with-multiple-content-jobs.yaml index 4691446e..3e2da712 100644 --- a/internal/controller/testdata/capapplicationversion/cav-processing-with-multiple-content-jobs.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-processing-with-multiple-content-jobs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-processing-with-no-content-job.yaml b/internal/controller/testdata/capapplicationversion/cav-processing-with-no-content-job.yaml index 92d31c2b..6133ba60 100644 --- a/internal/controller/testdata/capapplicationversion/cav-processing-with-no-content-job.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-processing-with-no-content-job.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-processing.yaml b/internal/controller/testdata/capapplicationversion/cav-processing.yaml index 6da4792d..f2c8155b 100644 --- a/internal/controller/testdata/capapplicationversion/cav-processing.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-ready-deleting.yaml b/internal/controller/testdata/capapplicationversion/cav-ready-deleting.yaml index 0b69bbfa..b0a1c645 100644 --- a/internal/controller/testdata/capapplicationversion/cav-ready-deleting.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-ready-deleting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -16,7 +16,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-ready-with-multiple-content-jobs-content-suffix.yaml b/internal/controller/testdata/capapplicationversion/cav-ready-with-multiple-content-jobs-content-suffix.yaml index 87bce47d..8bedadfd 100644 --- a/internal/controller/testdata/capapplicationversion/cav-ready-with-multiple-content-jobs-content-suffix.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-ready-with-multiple-content-jobs-content-suffix.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-security-context.yaml b/internal/controller/testdata/capapplicationversion/cav-security-context.yaml index 3d9060ea..9b9f25ab 100644 --- a/internal/controller/testdata/capapplicationversion/cav-security-context.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-security-context.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-stickiness-http-cookie-custom.yaml b/internal/controller/testdata/capapplicationversion/cav-stickiness-http-cookie-custom.yaml index a03c33e4..a678db05 100644 --- a/internal/controller/testdata/capapplicationversion/cav-stickiness-http-cookie-custom.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-stickiness-http-cookie-custom.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-stickiness-http-header.yaml b/internal/controller/testdata/capapplicationversion/cav-stickiness-http-header.yaml index d1f7a7f7..dc79eabd 100644 --- a/internal/controller/testdata/capapplicationversion/cav-stickiness-http-header.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-stickiness-http-header.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-stickiness-query-param.yaml b/internal/controller/testdata/capapplicationversion/cav-stickiness-query-param.yaml index 161a285f..b33ee4cc 100644 --- a/internal/controller/testdata/capapplicationversion/cav-stickiness-query-param.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-stickiness-query-param.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-stickiness-source-ip.yaml b/internal/controller/testdata/capapplicationversion/cav-stickiness-source-ip.yaml index a5510c98..9f5af9bd 100644 --- a/internal/controller/testdata/capapplicationversion/cav-stickiness-source-ip.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-stickiness-source-ip.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-toleration.yaml b/internal/controller/testdata/capapplicationversion/cav-toleration.yaml index f1dbdf85..074da797 100644 --- a/internal/controller/testdata/capapplicationversion/cav-toleration.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-toleration.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-topology-nolabel.yaml b/internal/controller/testdata/capapplicationversion/cav-topology-nolabel.yaml index 1f604577..2dfc403b 100644 --- a/internal/controller/testdata/capapplicationversion/cav-topology-nolabel.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-topology-nolabel.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-topology.yaml b/internal/controller/testdata/capapplicationversion/cav-topology.yaml index c101caf2..c8d41229 100644 --- a/internal/controller/testdata/capapplicationversion/cav-topology.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-topology.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-unknown-deleting.yaml b/internal/controller/testdata/capapplicationversion/cav-unknown-deleting.yaml index 03c01d47..89f7f576 100644 --- a/internal/controller/testdata/capapplicationversion/cav-unknown-deleting.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-unknown-deleting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -14,7 +14,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-valid-env-config.yaml b/internal/controller/testdata/capapplicationversion/cav-valid-env-config.yaml index ae984229..52b7d7d7 100644 --- a/internal/controller/testdata/capapplicationversion/cav-valid-env-config.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-valid-env-config.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/cav-vol.yaml b/internal/controller/testdata/capapplicationversion/cav-vol.yaml index 6f305fa3..f362c314 100644 --- a/internal/controller/testdata/capapplicationversion/cav-vol.yaml +++ b/internal/controller/testdata/capapplicationversion/cav-vol.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/content-job-completed.yaml b/internal/controller/testdata/capapplicationversion/content-job-completed.yaml index 291534fb..4731d8d2 100644 --- a/internal/controller/testdata/capapplicationversion/content-job-completed.yaml +++ b/internal/controller/testdata/capapplicationversion/content-job-completed.yaml @@ -7,11 +7,11 @@ metadata: name: test-cap-01-cav-v1-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion - name: test-cap-01-cav-v1-content + name: test-cap-01-cav-v1 uid: 5e64489b-7346-4984-8617-e8c37338b3d8 resourceVersion: "150625273" uid: afb8bcad-72ce-4567-8337-12fc67ef55acb diff --git a/internal/controller/testdata/capapplicationversion/content-job-failed.yaml b/internal/controller/testdata/capapplicationversion/content-job-failed.yaml index 4e2ebf0d..18ad68d4 100644 --- a/internal/controller/testdata/capapplicationversion/content-job-failed.yaml +++ b/internal/controller/testdata/capapplicationversion/content-job-failed.yaml @@ -7,11 +7,11 @@ metadata: name: test-cap-01-cav-v1-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion - name: test-cap-01-cav-v1-content + name: test-cap-01-cav-v1 uid: 5e64489b-7346-4984-8617-e8c37338b3d8 resourceVersion: "150625273" uid: afb8bcad-72ce-4567-8337-12fc67ef55acb diff --git a/internal/controller/testdata/capapplicationversion/content-job-pending.yaml b/internal/controller/testdata/capapplicationversion/content-job-pending.yaml index 8bd09eea..dbacd84d 100644 --- a/internal/controller/testdata/capapplicationversion/content-job-pending.yaml +++ b/internal/controller/testdata/capapplicationversion/content-job-pending.yaml @@ -7,11 +7,11 @@ metadata: name: test-cap-01-cav-v1-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion - name: test-cap-01-cav-v1-content + name: test-cap-01-cav-v1 uid: 5e64489b-7346-4984-8617-e8c37338b3d8 resourceVersion: "150625273" uid: afb8bcad-72ce-4567-8337-12fc67ef55acb diff --git a/internal/controller/testdata/capapplicationversion/deployments-failure.yaml b/internal/controller/testdata/capapplicationversion/deployments-failure.yaml index 569c997d..ba74e6bd 100644 --- a/internal/controller/testdata/capapplicationversion/deployments-failure.yaml +++ b/internal/controller/testdata/capapplicationversion/deployments-failure.yaml @@ -15,7 +15,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -64,7 +64,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/deployments-ready.yaml b/internal/controller/testdata/capapplicationversion/deployments-ready.yaml index bdadbbcb..d5bd71e6 100644 --- a/internal/controller/testdata/capapplicationversion/deployments-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/deployments-ready.yaml @@ -15,7 +15,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -52,7 +52,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-deleted-unknown.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-deleted-unknown.yaml index b33aa083..80013ef3 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-deleted-unknown.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-deleted-unknown.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -14,7 +14,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-deleted.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-deleted.yaml index e3ad7669..cdccf0fc 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-deleted.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-deleted.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: namespace: default finalizers: [] ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-deleting.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-deleting.yaml index 783c8a79..d026df1c 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-deleting.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-deleting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -16,7 +16,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-error-condition-processing.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-error-condition-processing.yaml index 82fdf37b..27d91547 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-error-condition-processing.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-error-condition-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-error-deployment-failure.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-error-deployment-failure.yaml index 897de856..5c04d36c 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-error-deployment-failure.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-error-deployment-failure.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-error-processing.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-error-processing.yaml index 82fdf37b..27d91547 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-error-processing.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-error-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-failed-content-job.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-failed-content-job.yaml index 3c12ae49..45b764c0 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-failed-content-job.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-failed-content-job.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-cap.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-cap.yaml index cc3baf7d..a2274a04 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-cap.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-cap.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-content.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-content.yaml index d1765b1a..aac527f8 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-content.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-content.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-job-worker.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-job-worker.yaml index cbb9d829..52c6f32c 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-job-worker.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-failed-env-job-worker.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-failed-with-multiple-content-jobs.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-failed-with-multiple-content-jobs.yaml index b5665534..9177fb17 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-failed-with-multiple-content-jobs.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-failed-with-multiple-content-jobs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-hpa-ready.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-hpa-ready.yaml index dae24c0e..61612441 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-hpa-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-hpa-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -109,7 +109,7 @@ metadata: name: test-ca-01-cav-v1-cap-backend-service namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -139,7 +139,7 @@ metadata: name: test-ca-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-missing-secrets.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-missing-secrets.yaml index ab0e52ce..685ff7ee 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-missing-secrets.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-missing-secrets.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-pdb-ready.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-pdb-ready.yaml index 158c5772..127f19cd 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-pdb-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-pdb-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -107,7 +107,7 @@ metadata: name: test-ca-01-cav-v1-cap-backend-service namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -141,7 +141,7 @@ metadata: name: test-ca-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-multiple-content-jobs.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-multiple-content-jobs.yaml index c362b64f..d7b52ebf 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-multiple-content-jobs.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-multiple-content-jobs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-none-complete-content-jobs.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-none-complete-content-jobs.yaml index 8606aacd..ba345465 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-none-complete-content-jobs.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-processing-with-none-complete-content-jobs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -83,7 +83,7 @@ metadata: name: test-cap-01-cav-v1-content-job-1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-processing.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-processing.yaml index 1815f7af..e3c311bb 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-processing.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-affinity.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-affinity.yaml index f4a901c0..06538999 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-affinity.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-affinity.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -205,7 +205,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-annotations.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-annotations.yaml index 2f650bc9..f34cd2d8 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-annotations.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-annotations.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -198,7 +198,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -300,7 +300,7 @@ metadata: name: test-cap-01-cav-v1-app-router-svc namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-cluster-netpol-port.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-cluster-netpol-port.yaml index c21045c6..a7922ee1 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-cluster-netpol-port.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-cluster-netpol-port.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -179,7 +179,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -261,7 +261,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-content-job.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-content-job.yaml index b74d5412..71dc937b 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-content-job.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-content-job.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-destination-config.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-destination-config.yaml index f4359e5d..56ba4167 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-destination-config.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-destination-config.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -97,7 +97,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-labels-config.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-labels-config.yaml index a1aa8d38..8bfd3927 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-labels-config.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-custom-labels-config.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -129,7 +129,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-init.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-init.yaml index 9783f73c..b8023f07 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-init.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-init.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -230,7 +230,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-merged-destinations-router.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-merged-destinations-router.yaml index ab9bae27..be82ed55 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-merged-destinations-router.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-merged-destinations-router.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -92,7 +92,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-prio.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-prio.yaml index 7e8887d1..747a3702 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-prio.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-prio.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -189,7 +189,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-selector.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-selector.yaml index edf88bdc..f6bc502d 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-selector.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-node-selector.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -189,7 +189,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-lifecycle.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-lifecycle.yaml index 177414cb..0ba23255 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-lifecycle.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-lifecycle.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -100,7 +100,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -162,7 +162,7 @@ metadata: name: test-cap-01-cav-v1-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-security-context.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-security-context.yaml index 81f591a3..99d82f2a 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-security-context.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-pod-security-context.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -193,7 +193,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-probes-and-resources.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-probes-and-resources.yaml index e667b8db..b53841b0 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-probes-and-resources.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-probes-and-resources.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -177,7 +177,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-security-context.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-security-context.yaml index ec6d6d67..d87cf7e9 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-security-context.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-security-context.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -182,7 +182,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-cookie-custom.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-cookie-custom.yaml index cacf2e67..0f5b0b5b 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-cookie-custom.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-cookie-custom.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -99,7 +99,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -152,7 +152,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -174,7 +174,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-header.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-header.yaml index 725f0498..36379e53 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-header.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-http-header.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -93,7 +93,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -146,7 +146,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -168,7 +168,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-query-param.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-query-param.yaml index cfc74c54..837d8f2d 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-query-param.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-query-param.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -93,7 +93,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -146,7 +146,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -168,7 +168,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-source-ip.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-source-ip.yaml index e354b338..328d181e 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-source-ip.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-stickiness-source-ip.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -93,7 +93,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -146,7 +146,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -168,7 +168,7 @@ metadata: name: test-cap-01-cav-v1-cap-backend-srv namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-toleration.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-toleration.yaml index 9907d355..0053cbf2 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-toleration.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-toleration.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -197,7 +197,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology-autolabel.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology-autolabel.yaml index c0c99949..f1987b23 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology-autolabel.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology-autolabel.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -191,7 +191,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology.yaml index e39d6385..e0eab373 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-topology.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -196,7 +196,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-valid-env-config.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-valid-env-config.yaml index d406fe0f..a3bab5d0 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-valid-env-config.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-valid-env-config.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -117,7 +117,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -177,7 +177,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-vol.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-vol.yaml index 29f900a2..e01ad4af 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-vol.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-vol.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -198,7 +198,7 @@ metadata: name: test-cap-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-multiple-content-jobs.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-multiple-content-jobs.yaml index b1271cc3..fca854dd 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-multiple-content-jobs.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-multiple-content-jobs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-no-content-job.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-no-content-job.yaml index 0f185428..73b0ce7d 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-no-content-job.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-ready-with-no-content-job.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-services-not-ready.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-services-not-ready.yaml index c5dcdaf5..d5660392 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-services-not-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-services-not-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-services-ready.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-services-ready.yaml index b343c07c..26a4b461 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-services-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-services-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/expected/cav-waiting.yaml b/internal/controller/testdata/capapplicationversion/expected/cav-waiting.yaml index 82fdf37b..27d91547 100644 --- a/internal/controller/testdata/capapplicationversion/expected/cav-waiting.yaml +++ b/internal/controller/testdata/capapplicationversion/expected/cav-waiting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-07-18T06:13:52Z" @@ -15,7 +15,7 @@ metadata: finalizers: - "sme.sap.com/capapplicationversion" ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-completed.yaml b/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-completed.yaml index f037dd33..6bcc6178 100644 --- a/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-completed.yaml +++ b/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-completed.yaml @@ -7,7 +7,7 @@ metadata: name: test-cap-01-cav-v1-content-job-1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-failed.yaml b/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-failed.yaml index b3a518e9..58c9e17b 100644 --- a/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-failed.yaml +++ b/internal/controller/testdata/capapplicationversion/one-of-mulitple-content-job-failed.yaml @@ -7,7 +7,7 @@ metadata: name: test-cap-01-cav-v1-content-job-1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/pdb-ready.yaml b/internal/controller/testdata/capapplicationversion/pdb-ready.yaml index cb378b2f..b24c1fa1 100644 --- a/internal/controller/testdata/capapplicationversion/pdb-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/pdb-ready.yaml @@ -16,7 +16,7 @@ metadata: name: test-ca-01-cav-v1-cap-backend-service namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -53,7 +53,7 @@ metadata: name: test-ca-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/capapplicationversion/service-content-job-completed.yaml b/internal/controller/testdata/capapplicationversion/service-content-job-completed.yaml index 4c29cae4..000eac8f 100644 --- a/internal/controller/testdata/capapplicationversion/service-content-job-completed.yaml +++ b/internal/controller/testdata/capapplicationversion/service-content-job-completed.yaml @@ -7,11 +7,11 @@ metadata: name: test-ca-01-cav-v1-content namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion - name: test-ca-01-cav-v1-content + name: test-ca-01-cav-v1 uid: 5e64489b-7346-4984-8617-e8c37338b3d8 resourceVersion: "150625273" uid: afb8bcad-72ce-4567-8337-12fc67ef55acb diff --git a/internal/controller/testdata/capapplicationversion/services-ready.yaml b/internal/controller/testdata/capapplicationversion/services-ready.yaml index cf4505f8..f3c1d06d 100644 --- a/internal/controller/testdata/capapplicationversion/services-ready.yaml +++ b/internal/controller/testdata/capapplicationversion/services-ready.yaml @@ -16,7 +16,7 @@ metadata: name: test-ca-01-cav-v1-cap-backend-service namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion @@ -53,7 +53,7 @@ metadata: name: test-ca-01-cav-v1-app-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/testdata/captenant/cat-01.initial.yaml b/internal/controller/testdata/captenant/cat-01.initial.yaml index 0a098bf9..76abffdd 100644 --- a/internal/controller/testdata/captenant/cat-01.initial.yaml +++ b/internal/controller/testdata/captenant/cat-01.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: name: test-cap-01-provider diff --git a/internal/controller/testdata/captenant/cat-02.expected.yaml b/internal/controller/testdata/captenant/cat-02.expected.yaml index 836135f0..806d50be 100644 --- a/internal/controller/testdata/captenant/cat-02.expected.yaml +++ b/internal/controller/testdata/captenant/cat-02.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-02.initial.yaml b/internal/controller/testdata/captenant/cat-02.initial.yaml index 4a0f0506..6fe94e63 100644 --- a/internal/controller/testdata/captenant/cat-02.initial.yaml +++ b/internal/controller/testdata/captenant/cat-02.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: name: test-cap-01-consumer diff --git a/internal/controller/testdata/captenant/cat-03.expected.yaml b/internal/controller/testdata/captenant/cat-03.expected.yaml index b615a3ea..cf591e5e 100644 --- a/internal/controller/testdata/captenant/cat-03.expected.yaml +++ b/internal/controller/testdata/captenant/cat-03.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -38,7 +38,7 @@ status: reason: ProvisioningOperationCreated message: "waiting for CAPTenantOperation default.test-cap-01-consumer-gen of type provisioning to complete" --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-consumer- @@ -58,7 +58,7 @@ metadata: sme.sap.com/tenant-type: consumer sme.sap.com/subscription-guid: 12abcde3-4f56-7f89-0edc-09876b54321a ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-03.initial.yaml b/internal/controller/testdata/captenant/cat-03.initial.yaml index a29ed675..3317f2e6 100644 --- a/internal/controller/testdata/captenant/cat-03.initial.yaml +++ b/internal/controller/testdata/captenant/cat-03.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-04.expected.yaml b/internal/controller/testdata/captenant/cat-04.expected.yaml index e0279410..afa66090 100644 --- a/internal/controller/testdata/captenant/cat-04.expected.yaml +++ b/internal/controller/testdata/captenant/cat-04.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -49,7 +49,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-04.initial.yaml b/internal/controller/testdata/captenant/cat-04.initial.yaml index be7f7672..9e368c3c 100644 --- a/internal/controller/testdata/captenant/cat-04.initial.yaml +++ b/internal/controller/testdata/captenant/cat-04.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -35,7 +35,7 @@ status: type: Ready state: Provisioning --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -50,7 +50,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-05.expected.yaml b/internal/controller/testdata/captenant/cat-05.expected.yaml index a89c983f..d2a33c7a 100644 --- a/internal/controller/testdata/captenant/cat-05.expected.yaml +++ b/internal/controller/testdata/captenant/cat-05.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-05.initial.yaml b/internal/controller/testdata/captenant/cat-05.initial.yaml index 49275740..799e9a90 100644 --- a/internal/controller/testdata/captenant/cat-05.initial.yaml +++ b/internal/controller/testdata/captenant/cat-05.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -35,7 +35,7 @@ status: type: Ready state: Provisioning --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -50,7 +50,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-06.expected.yaml b/internal/controller/testdata/captenant/cat-06.expected.yaml index 52cd6787..9b0e51d0 100644 --- a/internal/controller/testdata/captenant/cat-06.expected.yaml +++ b/internal/controller/testdata/captenant/cat-06.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-06.initial.yaml b/internal/controller/testdata/captenant/cat-06.initial.yaml index 607b7b4d..73d28c31 100644 --- a/internal/controller/testdata/captenant/cat-06.initial.yaml +++ b/internal/controller/testdata/captenant/cat-06.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -35,7 +35,7 @@ status: type: Ready state: Provisioning --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -50,7 +50,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-07.expected.yaml b/internal/controller/testdata/captenant/cat-07.expected.yaml index 46cdb40b..3aca15a0 100644 --- a/internal/controller/testdata/captenant/cat-07.expected.yaml +++ b/internal/controller/testdata/captenant/cat-07.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -36,7 +36,7 @@ status: state: Upgrading currentCAPApplicationVersionInstance: test-cap-01-cav-v1 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -54,7 +54,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-07.initial.yaml b/internal/controller/testdata/captenant/cat-07.initial.yaml index 0431686d..044bd545 100644 --- a/internal/controller/testdata/captenant/cat-07.initial.yaml +++ b/internal/controller/testdata/captenant/cat-07.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-08.expected.yaml b/internal/controller/testdata/captenant/cat-08.expected.yaml index 8fbd970d..06766704 100644 --- a/internal/controller/testdata/captenant/cat-08.expected.yaml +++ b/internal/controller/testdata/captenant/cat-08.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-08.initial.yaml b/internal/controller/testdata/captenant/cat-08.initial.yaml index 8fbd970d..06766704 100644 --- a/internal/controller/testdata/captenant/cat-08.initial.yaml +++ b/internal/controller/testdata/captenant/cat-08.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-09.expected.yaml b/internal/controller/testdata/captenant/cat-09.expected.yaml index 1194345c..52adecab 100644 --- a/internal/controller/testdata/captenant/cat-09.expected.yaml +++ b/internal/controller/testdata/captenant/cat-09.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -37,7 +37,7 @@ status: state: Deleting currentCAPApplicationVersionInstance: test-cap-01-cav-v1 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -55,7 +55,7 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-09.initial.yaml b/internal/controller/testdata/captenant/cat-09.initial.yaml index 51071e03..39666fbe 100644 --- a/internal/controller/testdata/captenant/cat-09.initial.yaml +++ b/internal/controller/testdata/captenant/cat-09.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-10.expected.yaml b/internal/controller/testdata/captenant/cat-10.expected.yaml index 3420cd5f..a80a5574 100644 --- a/internal/controller/testdata/captenant/cat-10.expected.yaml +++ b/internal/controller/testdata/captenant/cat-10.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-10.initial.yaml b/internal/controller/testdata/captenant/cat-10.initial.yaml index c73f740f..67e3c447 100644 --- a/internal/controller/testdata/captenant/cat-10.initial.yaml +++ b/internal/controller/testdata/captenant/cat-10.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -37,7 +37,7 @@ status: state: Deleting currentCAPApplicationVersionInstance: test-cap-01-cav-v1 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -52,7 +52,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-11.expected.yaml b/internal/controller/testdata/captenant/cat-11.expected.yaml index 6c616866..9cb86947 100644 --- a/internal/controller/testdata/captenant/cat-11.expected.yaml +++ b/internal/controller/testdata/captenant/cat-11.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-11.initial.yaml b/internal/controller/testdata/captenant/cat-11.initial.yaml index ee370cca..cc67629d 100644 --- a/internal/controller/testdata/captenant/cat-11.initial.yaml +++ b/internal/controller/testdata/captenant/cat-11.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-13.expected.yaml b/internal/controller/testdata/captenant/cat-13.expected.yaml index 85f9611a..609558c1 100644 --- a/internal/controller/testdata/captenant/cat-13.expected.yaml +++ b/internal/controller/testdata/captenant/cat-13.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -54,7 +54,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-13.initial.yaml b/internal/controller/testdata/captenant/cat-13.initial.yaml index a4a33d93..9aa79507 100644 --- a/internal/controller/testdata/captenant/cat-13.initial.yaml +++ b/internal/controller/testdata/captenant/cat-13.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -37,7 +37,7 @@ status: state: Upgrading currentCAPApplicationVersionInstance: test-cap-01-cav-v1 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -53,7 +53,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-14.initial.yaml b/internal/controller/testdata/captenant/cat-14.initial.yaml index 882b7b3c..7f189944 100644 --- a/internal/controller/testdata/captenant/cat-14.initial.yaml +++ b/internal/controller/testdata/captenant/cat-14.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-15.expected.yaml b/internal/controller/testdata/captenant/cat-15.expected.yaml index 0cdf6002..db4119c8 100644 --- a/internal/controller/testdata/captenant/cat-15.expected.yaml +++ b/internal/controller/testdata/captenant/cat-15.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 3 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -52,7 +52,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-15.initial.yaml b/internal/controller/testdata/captenant/cat-15.initial.yaml index 9b0cd94e..5ae8de0c 100644 --- a/internal/controller/testdata/captenant/cat-15.initial.yaml +++ b/internal/controller/testdata/captenant/cat-15.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 3 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -52,7 +52,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-20.expected.yaml b/internal/controller/testdata/captenant/cat-20.expected.yaml index b3c01847..42c06a2a 100644 --- a/internal/controller/testdata/captenant/cat-20.expected.yaml +++ b/internal/controller/testdata/captenant/cat-20.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-20.initial.yaml b/internal/controller/testdata/captenant/cat-20.initial.yaml index 52cd6787..9b0e51d0 100644 --- a/internal/controller/testdata/captenant/cat-20.initial.yaml +++ b/internal/controller/testdata/captenant/cat-20.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-21.expected.yaml b/internal/controller/testdata/captenant/cat-21.expected.yaml index a832fd30..32d1efff 100644 --- a/internal/controller/testdata/captenant/cat-21.expected.yaml +++ b/internal/controller/testdata/captenant/cat-21.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -17,7 +17,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -55,7 +55,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-21.initial.yaml b/internal/controller/testdata/captenant/cat-21.initial.yaml index e3327c49..bc746f61 100644 --- a/internal/controller/testdata/captenant/cat-21.initial.yaml +++ b/internal/controller/testdata/captenant/cat-21.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -17,7 +17,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -38,7 +38,7 @@ status: state: Upgrading currentCAPApplicationVersionInstance: test-cap-01-cav-v1 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -54,7 +54,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -87,7 +87,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-22.initial.yaml b/internal/controller/testdata/captenant/cat-22.initial.yaml index 559dbc55..9dfe3517 100644 --- a/internal/controller/testdata/captenant/cat-22.initial.yaml +++ b/internal/controller/testdata/captenant/cat-22.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -37,7 +37,7 @@ status: state: Upgrading currentCAPApplicationVersionInstance: test-cap-01-cav-v1 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -53,7 +53,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -84,7 +84,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-23.expected.yaml b/internal/controller/testdata/captenant/cat-23.expected.yaml index 94ac0a61..9b045730 100644 --- a/internal/controller/testdata/captenant/cat-23.expected.yaml +++ b/internal/controller/testdata/captenant/cat-23.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-23.initial.yaml b/internal/controller/testdata/captenant/cat-23.initial.yaml index 65284010..922ee51f 100644 --- a/internal/controller/testdata/captenant/cat-23.initial.yaml +++ b/internal/controller/testdata/captenant/cat-23.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -39,7 +39,7 @@ status: currentCAPApplicationVersionInstance: test-cap-01-cav-v1 observedGeneration: 2 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: annotations: @@ -52,7 +52,7 @@ metadata: name: test-cap-01-provider-upg namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-24.expected.yaml b/internal/controller/testdata/captenant/cat-24.expected.yaml index c735b889..6af4342f 100644 --- a/internal/controller/testdata/captenant/cat-24.expected.yaml +++ b/internal/controller/testdata/captenant/cat-24.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 3 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -39,7 +39,7 @@ status: currentCAPApplicationVersionInstance: test-cap-01-cav-v1 observedGeneration: 3 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -57,7 +57,7 @@ metadata: sme.sap.com/cav-version: "11.12.13" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-24.initial.yaml b/internal/controller/testdata/captenant/cat-24.initial.yaml index 0870a73b..6179ffd5 100644 --- a/internal/controller/testdata/captenant/cat-24.initial.yaml +++ b/internal/controller/testdata/captenant/cat-24.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 3 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -38,7 +38,7 @@ status: currentCAPApplicationVersionInstance: test-cap-01-cav-v1 observedGeneration: 2 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: annotations: @@ -51,7 +51,7 @@ metadata: name: test-cap-01-provider-upg namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-25.expected.yaml b/internal/controller/testdata/captenant/cat-25.expected.yaml index 5fa99d78..660b8a69 100644 --- a/internal/controller/testdata/captenant/cat-25.expected.yaml +++ b/internal/controller/testdata/captenant/cat-25.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -39,7 +39,7 @@ status: currentCAPApplicationVersionInstance: test-cap-01-cav-v1 observedGeneration: 2 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -57,7 +57,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-25.initial.yaml b/internal/controller/testdata/captenant/cat-25.initial.yaml index d9c3dd3f..5e766659 100644 --- a/internal/controller/testdata/captenant/cat-25.initial.yaml +++ b/internal/controller/testdata/captenant/cat-25.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-26.initial.yaml b/internal/controller/testdata/captenant/cat-26.initial.yaml index 19f50da2..fb8ca7f5 100644 --- a/internal/controller/testdata/captenant/cat-26.initial.yaml +++ b/internal/controller/testdata/captenant/cat-26.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -35,7 +35,7 @@ status: type: Ready state: Provisioning --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -50,7 +50,7 @@ metadata: finalizers: - sme.sap.com/mtxrequest ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-28.expected.yaml b/internal/controller/testdata/captenant/cat-28.expected.yaml index 5d5dba2f..77d8c1f5 100644 --- a/internal/controller/testdata/captenant/cat-28.expected.yaml +++ b/internal/controller/testdata/captenant/cat-28.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -38,7 +38,7 @@ status: reason: ProvisioningOperationCreated message: "waiting for CAPTenantOperation default.test-cap-01-consumer-gen of type provisioning to complete" --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-consumer- @@ -58,7 +58,7 @@ metadata: sme.sap.com/tenant-type: consumer sme.sap.com/subscription-guid: 12abcde3-4f56-7f89-0edc-09876b54321a ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-28.initial.yaml b/internal/controller/testdata/captenant/cat-28.initial.yaml index 4004878f..bb387644 100644 --- a/internal/controller/testdata/captenant/cat-28.initial.yaml +++ b/internal/controller/testdata/captenant/cat-28.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-29.expected.yaml b/internal/controller/testdata/captenant/cat-29.expected.yaml index 42f1e857..34f26ae3 100644 --- a/internal/controller/testdata/captenant/cat-29.expected.yaml +++ b/internal/controller/testdata/captenant/cat-29.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-29.initial.yaml b/internal/controller/testdata/captenant/cat-29.initial.yaml index 432603ee..b45fdb83 100644 --- a/internal/controller/testdata/captenant/cat-29.initial.yaml +++ b/internal/controller/testdata/captenant/cat-29.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -41,7 +41,7 @@ status: - old-version-2 - old-version-3 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -57,7 +57,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-30.expected.yaml b/internal/controller/testdata/captenant/cat-30.expected.yaml index 38082e63..29918bf3 100644 --- a/internal/controller/testdata/captenant/cat-30.expected.yaml +++ b/internal/controller/testdata/captenant/cat-30.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 3 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -52,7 +52,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-30.initial.yaml b/internal/controller/testdata/captenant/cat-30.initial.yaml index 96059f95..919a0b37 100644 --- a/internal/controller/testdata/captenant/cat-30.initial.yaml +++ b/internal/controller/testdata/captenant/cat-30.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 3 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -52,7 +52,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-deleting.expected.yaml b/internal/controller/testdata/captenant/cat-deleting.expected.yaml index 7bbe739b..d9f687fd 100644 --- a/internal/controller/testdata/captenant/cat-deleting.expected.yaml +++ b/internal/controller/testdata/captenant/cat-deleting.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -37,7 +37,7 @@ status: state: Deleting currentCAPApplicationVersionInstance: test-cap-01-cav-v2 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -55,7 +55,7 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-deleting.initial.yaml b/internal/controller/testdata/captenant/cat-deleting.initial.yaml index 77fe55ab..0dbb056e 100644 --- a/internal/controller/testdata/captenant/cat-deleting.initial.yaml +++ b/internal/controller/testdata/captenant/cat-deleting.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: deletionTimestamp: "2022-03-22T13:24:38Z" @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-with-no-version.yaml b/internal/controller/testdata/captenant/cat-with-no-version.yaml index b539fd19..e750e65c 100644 --- a/internal/controller/testdata/captenant/cat-with-no-version.yaml +++ b/internal/controller/testdata/captenant/cat-with-no-version.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-disabled-dr-vs.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-disabled-dr-vs.yaml index 4eba85c6..2f222591 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-disabled-dr-vs.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-disabled-dr-vs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: generation: 2 @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -54,7 +54,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-headers.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-headers.yaml index 96ffba83..8e6dda5d 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-headers.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-headers.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -49,7 +49,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-logout-endpoint.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-logout-endpoint.yaml index 701a5f19..906f9f4a 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-logout-endpoint.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-logout-endpoint.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -49,7 +49,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-prev-cav-removed.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-prev-cav-removed.yaml index bf4ad4c2..8545a370 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-prev-cav-removed.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-prev-cav-removed.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -54,7 +54,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.expected.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.expected.yaml index ea4adea2..c6c679af 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.expected.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -55,7 +55,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.yaml index 0dd6011a..ae39906b 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade-to-cav-v3.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -42,7 +42,7 @@ status: - test-cap-01-cav-v1 - test-cap-01-cav-v2 --- -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: generateName: test-cap-01-provider- @@ -58,7 +58,7 @@ metadata: finalizers: - sme.sap.com/captenantoperation ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -91,7 +91,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade.yaml index 5fbd9682..6d1443a4 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs-upgrade.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -54,7 +54,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs.yaml b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs.yaml index a58a5394..b50029b3 100644 --- a/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs.yaml +++ b/internal/controller/testdata/captenant/cat-with-session-affinity-dr-vs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -49,7 +49,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenant/provider-tenant-vs-v1.yaml b/internal/controller/testdata/captenant/provider-tenant-vs-v1.yaml index 8c1f2a1b..a7aae3de 100644 --- a/internal/controller/testdata/captenant/provider-tenant-vs-v1.yaml +++ b/internal/controller/testdata/captenant/provider-tenant-vs-v1.yaml @@ -11,7 +11,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml index 62a6bc9a..4f076192 100644 --- a/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-01.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-01.initial.yaml index 99008d2c..c49384bc 100644 --- a/internal/controller/testdata/captenantoperation/ctop-01.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-01.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd diff --git a/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml index c2a2e25f..c7fc0b4f 100644 --- a/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml index acb98d29..cd3915bd 100644 --- a/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml index 780f6a75..e9bcc736 100644 --- a/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml index f23526ad..146caef2 100644 --- a/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml index 566c64e2..6ef9fd85 100644 --- a/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml index 5342033b..199809b7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-05.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-05.initial.yaml index 39895fc0..837e3ad9 100644 --- a/internal/controller/testdata/captenantoperation/ctop-05.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-05.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd diff --git a/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml index 6d7119d3..2e385ea8 100644 --- a/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml index b8fe23c1..00567ca8 100644 --- a/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml index 1695d95e..ea574e19 100644 --- a/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -62,7 +62,7 @@ metadata: name: test-cap-01-provider-custom-say-xyz namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml index 0db2bfa5..0fae3427 100644 --- a/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -62,7 +62,7 @@ metadata: name: test-cap-01-provider-custom-say-xyz namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml index 48f0e563..055c79ea 100644 --- a/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-ten-op-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml index 2d2d5d4e..21618afa 100644 --- a/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml index 8c25ab85..5f2b9880 100644 --- a/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml index 154d59b7..91b07f6a 100644 --- a/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -62,7 +62,7 @@ metadata: name: test-cap-01-provider-mtx-xyz namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml index 4c1fb767..6d0940f9 100644 --- a/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml index ffe4544f..13a11d70 100644 --- a/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -62,7 +62,7 @@ metadata: name: test-cap-01-provider-custom-say-xyz namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml index 5c5a98c4..d60a97c3 100644 --- a/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml index 114d1e2d..7e2d9413 100644 --- a/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-xyz namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml index e4e76efb..d9a1eb87 100644 --- a/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml index 44944a3a..a378247b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-ten-op-xyz namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml index 160c3cdb..a2fbb9af 100644 --- a/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml index 2adf4225..ebb0aa7f 100644 --- a/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-15.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-15.expected.yaml index 3749af1d..809d5b66 100644 --- a/internal/controller/testdata/captenantoperation/ctop-15.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-15.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-invalid-tenant-op diff --git a/internal/controller/testdata/captenantoperation/ctop-15.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-15.initial.yaml index 80102444..84bc977c 100644 --- a/internal/controller/testdata/captenantoperation/ctop-15.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-15.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-invalid-tenant-op diff --git a/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml index 4ea978f9..a53a2b2c 100644 --- a/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -59,7 +59,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml index 00176f05..c5638fd3 100644 --- a/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml index ce068568..ffb8ac3a 100644 --- a/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -59,7 +59,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml index b324fcbb..085eab2f 100644 --- a/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -58,7 +58,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml index f501d0fc..f4715d64 100644 --- a/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml index ab46aaa9..45b4299b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -59,7 +59,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml index 00176f05..c5638fd3 100644 --- a/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml index d09747c7..59df70a2 100644 --- a/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -59,7 +59,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml index 3d3cb896..d60d163a 100644 --- a/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml index 41c15197..974652b0 100644 --- a/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml index e610c881..40389399 100644 --- a/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml index b52fcb2e..c98fda7a 100644 --- a/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml index 7eab865f..31e63bf5 100644 --- a/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -62,7 +62,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml index 65aa99ae..5d0446b9 100644 --- a/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -65,7 +65,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml index f0261457..3c446076 100644 --- a/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -59,7 +59,7 @@ metadata: name: test-cap-01-provider-ten-op-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml index 007a76d8..293d1389 100644 --- a/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-27.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-27.expected.yaml index bc91fb40..dae0254e 100644 --- a/internal/controller/testdata/captenantoperation/ctop-27.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-27.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-27.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-27.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-27.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-27.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-deprovisioning.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-deprovisioning.expected.yaml index 152f1dd7..9a3125ac 100644 --- a/internal/controller/testdata/captenantoperation/ctop-deprovisioning.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-deprovisioning.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -59,7 +59,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-deprovisioning.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-deprovisioning.initial.yaml index ee30f122..6f343e6f 100644 --- a/internal/controller/testdata/captenantoperation/ctop-deprovisioning.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-deprovisioning.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml index 2f3c6923..15a678f0 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml index 40498cda..c362639f 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-no-provider.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-no-provider.expected.yaml index 4bf494ee..d99bfb56 100644 --- a/internal/controller/testdata/captenantoperation/ctop-no-provider.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-no-provider.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-consumer-abcd @@ -19,7 +19,7 @@ metadata: sme.sap.com/tenant-type: consumer sme.sap.com/subscription-guid: 12abcde3-4f56-7f89-0edc-09876b54321a ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -62,7 +62,7 @@ metadata: name: test-cap-01-consumer-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-no-provider.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-no-provider.initial.yaml index e15ad88c..95f1c94c 100644 --- a/internal/controller/testdata/captenantoperation/ctop-no-provider.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-no-provider.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-consumer-abcd @@ -19,7 +19,7 @@ metadata: sme.sap.com/tenant-type: consumer sme.sap.com/subscription-guid: 12abcde3-4f56-7f89-0edc-09876b54321a ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-provisioning.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-provisioning.initial.yaml index 2f5a3430..ba56b999 100644 --- a/internal/controller/testdata/captenantoperation/ctop-provisioning.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-provisioning.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml index eaf9a858..37638c4e 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml index 1bffcc42..df8ba29e 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml index f3a86b2d..af5b2391 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: 8.9.10 sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -63,7 +63,7 @@ metadata: name: test-cap-01-provider-custom-say-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml index 31c74442..443ec4a7 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "8.9.10" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml index dd1e5fb0..1560113e 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -17,7 +17,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant @@ -60,7 +60,7 @@ metadata: name: test-cap-01-provider-mtx-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenantOperation diff --git a/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml index bfbc4461..e2bc19cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenantOperation metadata: name: test-cap-01-provider-abcd @@ -16,7 +16,7 @@ metadata: sme.sap.com/cav-version: "5.6.7" sme.sap.com/tenant-type: provider ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPTenant diff --git a/internal/controller/testdata/common/ca-services.yaml b/internal/controller/testdata/common/ca-services.yaml index 0ec6cd94..0914a3f3 100644 --- a/internal/controller/testdata/common/ca-services.yaml +++ b/internal/controller/testdata/common/ca-services.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplication-empty-provider.yaml b/internal/controller/testdata/common/capapplication-empty-provider.yaml index 2d8b83c6..b1f3d416 100644 --- a/internal/controller/testdata/common/capapplication-empty-provider.yaml +++ b/internal/controller/testdata/common/capapplication-empty-provider.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplication-multi-xsuaa.yaml b/internal/controller/testdata/common/capapplication-multi-xsuaa.yaml index 9867be2c..1d9dc660 100644 --- a/internal/controller/testdata/common/capapplication-multi-xsuaa.yaml +++ b/internal/controller/testdata/common/capapplication-multi-xsuaa.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: annotations: diff --git a/internal/controller/testdata/common/capapplication-no-provider.yaml b/internal/controller/testdata/common/capapplication-no-provider.yaml index 78b7bbdf..4e8c8695 100644 --- a/internal/controller/testdata/common/capapplication-no-provider.yaml +++ b/internal/controller/testdata/common/capapplication-no-provider.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplication-session-affinity-vs-headers.yaml b/internal/controller/testdata/common/capapplication-session-affinity-vs-headers.yaml index 9527fa87..25ef9e8a 100644 --- a/internal/controller/testdata/common/capapplication-session-affinity-vs-headers.yaml +++ b/internal/controller/testdata/common/capapplication-session-affinity-vs-headers.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: annotations: diff --git a/internal/controller/testdata/common/capapplication-session-affinity.yaml b/internal/controller/testdata/common/capapplication-session-affinity.yaml index 882b2321..4a1fddb6 100644 --- a/internal/controller/testdata/common/capapplication-session-affinity.yaml +++ b/internal/controller/testdata/common/capapplication-session-affinity.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: annotations: diff --git a/internal/controller/testdata/common/capapplication-vs-headers-error-req.yaml b/internal/controller/testdata/common/capapplication-vs-headers-error-req.yaml index 160f0129..f1d95d6a 100644 --- a/internal/controller/testdata/common/capapplication-vs-headers-error-req.yaml +++ b/internal/controller/testdata/common/capapplication-vs-headers-error-req.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplication-vs-headers-error-res.yaml b/internal/controller/testdata/common/capapplication-vs-headers-error-res.yaml index 74a3bdd3..116faca8 100644 --- a/internal/controller/testdata/common/capapplication-vs-headers-error-res.yaml +++ b/internal/controller/testdata/common/capapplication-vs-headers-error-res.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplication-vs-headers.yaml b/internal/controller/testdata/common/capapplication-vs-headers.yaml index dfb94392..d7ac1420 100644 --- a/internal/controller/testdata/common/capapplication-vs-headers.yaml +++ b/internal/controller/testdata/common/capapplication-vs-headers.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplication.yaml b/internal/controller/testdata/common/capapplication.yaml index c75b0ae4..5506d06b 100644 --- a/internal/controller/testdata/common/capapplication.yaml +++ b/internal/controller/testdata/common/capapplication.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/common/capapplicationversion-cap-service-workloads.yaml b/internal/controller/testdata/common/capapplicationversion-cap-service-workloads.yaml index 0d50132e..57b64e8b 100644 --- a/internal/controller/testdata/common/capapplicationversion-cap-service-workloads.yaml +++ b/internal/controller/testdata/common/capapplicationversion-cap-service-workloads.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-invalid-env.yaml b/internal/controller/testdata/common/capapplicationversion-invalid-env.yaml index 6bf26712..d2bea03e 100644 --- a/internal/controller/testdata/common/capapplicationversion-invalid-env.yaml +++ b/internal/controller/testdata/common/capapplicationversion-invalid-env.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-custom-logout-endpoint.yaml b/internal/controller/testdata/common/capapplicationversion-v1-custom-logout-endpoint.yaml index 2170b047..4509314a 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-custom-logout-endpoint.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-custom-logout-endpoint.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -14,7 +14,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-init-custom.yaml b/internal/controller/testdata/common/capapplicationversion-v1-init-custom.yaml index 351f849a..85adc5c9 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-init-custom.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-init-custom.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-init.yaml b/internal/controller/testdata/common/capapplicationversion-v1-init.yaml index e8ed03cb..5144d40c 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-init.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-init.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-mtxs-custom-cmd.yaml b/internal/controller/testdata/common/capapplicationversion-v1-mtxs-custom-cmd.yaml index f7f9bffd..92b961e1 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-mtxs-custom-cmd.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-mtxs-custom-cmd.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-mtxs.yaml b/internal/controller/testdata/common/capapplicationversion-v1-mtxs.yaml index 6f822abd..ff3a704b 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-mtxs.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-mtxs.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-resources.yaml b/internal/controller/testdata/common/capapplicationversion-v1-resources.yaml index 769d36b5..60b89d60 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-resources.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-resources.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-scheduling-custom.yaml b/internal/controller/testdata/common/capapplicationversion-v1-scheduling-custom.yaml index cfae5795..4ddb6013 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-scheduling-custom.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-scheduling-custom.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-scheduling.yaml b/internal/controller/testdata/common/capapplicationversion-v1-scheduling.yaml index 9b9a6247..9b7c77e9 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-scheduling.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-scheduling.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-security-context.yaml b/internal/controller/testdata/common/capapplicationversion-v1-security-context.yaml index 68aa88e7..05959006 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-security-context.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-security-context.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-vol-custom.yaml b/internal/controller/testdata/common/capapplicationversion-v1-vol-custom.yaml index e43bd923..3891f51b 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-vol-custom.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-vol-custom.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1-vol.yaml b/internal/controller/testdata/common/capapplicationversion-v1-vol.yaml index 9126fae7..765bfb63 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1-vol.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1-vol.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v1.yaml b/internal/controller/testdata/common/capapplicationversion-v1.yaml index 1968c4ed..ebb87fd7 100644 --- a/internal/controller/testdata/common/capapplicationversion-v1.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v1.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2-annotations.yaml b/internal/controller/testdata/common/capapplicationversion-v2-annotations.yaml index 1de3bbb4..0c647163 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2-annotations.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2-annotations.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2-multi-xsuaa.yaml b/internal/controller/testdata/common/capapplicationversion-v2-multi-xsuaa.yaml index 6bca292b..cd39ca26 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2-multi-xsuaa.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2-multi-xsuaa.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2-multiple-tenant-ops.yaml b/internal/controller/testdata/common/capapplicationversion-v2-multiple-tenant-ops.yaml index 51928d48..5af472e7 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2-multiple-tenant-ops.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2-multiple-tenant-ops.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2-no-mtx-workload.yaml b/internal/controller/testdata/common/capapplicationversion-v2-no-mtx-workload.yaml index bb48c7d9..5778dec9 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2-no-mtx-workload.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2-no-mtx-workload.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2-pod-lifecycle.yaml b/internal/controller/testdata/common/capapplicationversion-v2-pod-lifecycle.yaml index 28352e72..9cbda144 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2-pod-lifecycle.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2-pod-lifecycle.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2-pod-security-context.yaml b/internal/controller/testdata/common/capapplicationversion-v2-pod-security-context.yaml index 28eac614..9344f739 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2-pod-security-context.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2-pod-security-context.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v2.yaml b/internal/controller/testdata/common/capapplicationversion-v2.yaml index 97e95f00..b3a98bf8 100644 --- a/internal/controller/testdata/common/capapplicationversion-v2.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v2.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-v3.yaml b/internal/controller/testdata/common/capapplicationversion-v3.yaml index 64d303ff..73a78ea0 100644 --- a/internal/controller/testdata/common/capapplicationversion-v3.yaml +++ b/internal/controller/testdata/common/capapplicationversion-v3.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v3 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/capapplicationversion-workload-error.yaml b/internal/controller/testdata/common/capapplicationversion-workload-error.yaml index 5cffb663..8ddda3cd 100644 --- a/internal/controller/testdata/common/capapplicationversion-workload-error.yaml +++ b/internal/controller/testdata/common/capapplicationversion-workload-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/captenant-consumer-ready.yaml b/internal/controller/testdata/common/captenant-consumer-ready.yaml index 4619802e..93100581 100644 --- a/internal/controller/testdata/common/captenant-consumer-ready.yaml +++ b/internal/controller/testdata/common/captenant-consumer-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -17,7 +17,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/captenant-provider-ready.yaml b/internal/controller/testdata/common/captenant-provider-ready.yaml index df459d0b..f42c4ba8 100644 --- a/internal/controller/testdata/common/captenant-provider-ready.yaml +++ b/internal/controller/testdata/common/captenant-provider-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/captenant-provider-upgraded-ready.yaml b/internal/controller/testdata/common/captenant-provider-upgraded-ready.yaml index 89c0e9e9..2ae08458 100644 --- a/internal/controller/testdata/common/captenant-provider-upgraded-ready.yaml +++ b/internal/controller/testdata/common/captenant-provider-upgraded-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -15,7 +15,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/cav-pdb.yaml b/internal/controller/testdata/common/cav-pdb.yaml index 5351ea9b..ead27e6b 100644 --- a/internal/controller/testdata/common/cav-pdb.yaml +++ b/internal/controller/testdata/common/cav-pdb.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/cav-services.yaml b/internal/controller/testdata/common/cav-services.yaml index be681620..6fe4d6a0 100644 --- a/internal/controller/testdata/common/cav-services.yaml +++ b/internal/controller/testdata/common/cav-services.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -15,7 +15,7 @@ metadata: name: test-ca-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/common/cluster-domain-not-ready.yaml b/internal/controller/testdata/common/cluster-domain-not-ready.yaml index 01a2b769..abe09b3a 100644 --- a/internal/controller/testdata/common/cluster-domain-not-ready.yaml +++ b/internal/controller/testdata/common/cluster-domain-not-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/common/cluster-domain-ready.yaml b/internal/controller/testdata/common/cluster-domain-ready.yaml index c9feb4bc..906b8588 100644 --- a/internal/controller/testdata/common/cluster-domain-ready.yaml +++ b/internal/controller/testdata/common/cluster-domain-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/common/domain-hostUpdated-ready.yaml b/internal/controller/testdata/common/domain-hostUpdated-ready.yaml index 7982b260..02273ffd 100644 --- a/internal/controller/testdata/common/domain-hostUpdated-ready.yaml +++ b/internal/controller/testdata/common/domain-hostUpdated-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/common/domain-ready.yaml b/internal/controller/testdata/common/domain-ready.yaml index 3288fa00..0cefd54a 100644 --- a/internal/controller/testdata/common/domain-ready.yaml +++ b/internal/controller/testdata/common/domain-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/common/service-virtualservices.yaml b/internal/controller/testdata/common/service-virtualservices.yaml index fec125e7..06670a9e 100644 --- a/internal/controller/testdata/common/service-virtualservices.yaml +++ b/internal/controller/testdata/common/service-virtualservices.yaml @@ -9,7 +9,7 @@ metadata: name: test-ca-01-router namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication @@ -43,7 +43,7 @@ metadata: name: test-ca-01-cap-backend-service namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/domain/ca-services-ready.yaml b/internal/controller/testdata/domain/ca-services-ready.yaml index 4050467f..6e446db3 100644 --- a/internal/controller/testdata/domain/ca-services-ready.yaml +++ b/internal/controller/testdata/domain/ca-services-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/domain/cluster-domain-deleting-no-finalizer.yaml b/internal/controller/testdata/domain/cluster-domain-deleting-no-finalizer.yaml index aaa68c15..a917179d 100644 --- a/internal/controller/testdata/domain/cluster-domain-deleting-no-finalizer.yaml +++ b/internal/controller/testdata/domain/cluster-domain-deleting-no-finalizer.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/domain/cluster-domain-deleting.yaml b/internal/controller/testdata/domain/cluster-domain-deleting.yaml index ce5cf25f..4e89710a 100644 --- a/internal/controller/testdata/domain/cluster-domain-deleting.yaml +++ b/internal/controller/testdata/domain/cluster-domain-deleting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/domain/cluster-domain-initial-state-label-finalizer.yaml b/internal/controller/testdata/domain/cluster-domain-initial-state-label-finalizer.yaml index 17df148f..3adb3296 100644 --- a/internal/controller/testdata/domain/cluster-domain-initial-state-label-finalizer.yaml +++ b/internal/controller/testdata/domain/cluster-domain-initial-state-label-finalizer.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/domain/cluster-domain-initial-state.yaml b/internal/controller/testdata/domain/cluster-domain-initial-state.yaml index af48c7b5..b03b93e7 100644 --- a/internal/controller/testdata/domain/cluster-domain-initial-state.yaml +++ b/internal/controller/testdata/domain/cluster-domain-initial-state.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/domain/cluster-domain-ready-withDeletionTimestamp.yaml b/internal/controller/testdata/domain/cluster-domain-ready-withDeletionTimestamp.yaml index 6f5475cb..55cc231d 100644 --- a/internal/controller/testdata/domain/cluster-domain-ready-withDeletionTimestamp.yaml +++ b/internal/controller/testdata/domain/cluster-domain-ready-withDeletionTimestamp.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: ClusterDomain metadata: name: test-cap-01-secondary diff --git a/internal/controller/testdata/domain/domain-additionalCaCertificate-update.expected.yaml b/internal/controller/testdata/domain/domain-additionalCaCertificate-update.expected.yaml index a42329e9..9b4ea294 100644 --- a/internal/controller/testdata/domain/domain-additionalCaCertificate-update.expected.yaml +++ b/internal/controller/testdata/domain/domain-additionalCaCertificate-update.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-additionalCaCertificate-update.yaml b/internal/controller/testdata/domain/domain-additionalCaCertificate-update.yaml index 32db0251..f4e35f06 100644 --- a/internal/controller/testdata/domain/domain-additionalCaCertificate-update.yaml +++ b/internal/controller/testdata/domain/domain-additionalCaCertificate-update.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-cert-error.yaml b/internal/controller/testdata/domain/domain-cert-error.yaml index 57b10504..4e2975b7 100644 --- a/internal/controller/testdata/domain/domain-cert-error.yaml +++ b/internal/controller/testdata/domain/domain-cert-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-certManager-config-update.expected.yaml b/internal/controller/testdata/domain/domain-certManager-config-update.expected.yaml index a3665e6f..cf2d142b 100644 --- a/internal/controller/testdata/domain/domain-certManager-config-update.expected.yaml +++ b/internal/controller/testdata/domain/domain-certManager-config-update.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -42,7 +42,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-certManager-config-update.yaml b/internal/controller/testdata/domain/domain-certManager-config-update.yaml index 9098df05..8c49ff8d 100644 --- a/internal/controller/testdata/domain/domain-certManager-config-update.yaml +++ b/internal/controller/testdata/domain/domain-certManager-config-update.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-certManager-error.yaml b/internal/controller/testdata/domain/domain-certManager-error.yaml index 7053c89f..e20c853e 100644 --- a/internal/controller/testdata/domain/domain-certManager-error.yaml +++ b/internal/controller/testdata/domain/domain-certManager-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-deleting-no-finalizer.yaml b/internal/controller/testdata/domain/domain-deleting-no-finalizer.yaml index 09ff38bb..5f2fef36 100644 --- a/internal/controller/testdata/domain/domain-deleting-no-finalizer.yaml +++ b/internal/controller/testdata/domain/domain-deleting-no-finalizer.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-deleting.yaml b/internal/controller/testdata/domain/domain-deleting.yaml index dff5496d..90309600 100644 --- a/internal/controller/testdata/domain/domain-deleting.yaml +++ b/internal/controller/testdata/domain/domain-deleting.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-dns-error.yaml b/internal/controller/testdata/domain/domain-dns-error.yaml index 2e34a69e..37adc473 100644 --- a/internal/controller/testdata/domain/domain-dns-error.yaml +++ b/internal/controller/testdata/domain/domain-dns-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-duplicate.expected.yaml b/internal/controller/testdata/domain/domain-duplicate.expected.yaml index 705deea2..642661ea 100644 --- a/internal/controller/testdata/domain/domain-duplicate.expected.yaml +++ b/internal/controller/testdata/domain/domain-duplicate.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary-dup diff --git a/internal/controller/testdata/domain/domain-duplicate.yaml b/internal/controller/testdata/domain/domain-duplicate.yaml index 9ed9842a..8156013e 100644 --- a/internal/controller/testdata/domain/domain-duplicate.yaml +++ b/internal/controller/testdata/domain/domain-duplicate.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary-dup diff --git a/internal/controller/testdata/domain/domain-initial-state-label-finalizer.yaml b/internal/controller/testdata/domain/domain-initial-state-label-finalizer.yaml index d05d19f5..5a3a3aca 100644 --- a/internal/controller/testdata/domain/domain-initial-state-label-finalizer.yaml +++ b/internal/controller/testdata/domain/domain-initial-state-label-finalizer.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-initial-state.yaml b/internal/controller/testdata/domain/domain-initial-state.yaml index 22f81018..72b31a10 100644 --- a/internal/controller/testdata/domain/domain-initial-state.yaml +++ b/internal/controller/testdata/domain/domain-initial-state.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-mutual-ready.yaml b/internal/controller/testdata/domain/domain-mutual-ready.yaml index ad95538d..f43214fa 100644 --- a/internal/controller/testdata/domain/domain-mutual-ready.yaml +++ b/internal/controller/testdata/domain/domain-mutual-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -37,7 +37,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-no-ingress-error.yaml b/internal/controller/testdata/domain/domain-no-ingress-error.yaml index f7c8604d..c2f67d09 100644 --- a/internal/controller/testdata/domain/domain-no-ingress-error.yaml +++ b/internal/controller/testdata/domain/domain-no-ingress-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-optional-mutual-ready.yaml b/internal/controller/testdata/domain/domain-optional-mutual-ready.yaml index 7d62a673..94681bdf 100644 --- a/internal/controller/testdata/domain/domain-optional-mutual-ready.yaml +++ b/internal/controller/testdata/domain/domain-optional-mutual-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -38,7 +38,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-additionalCACertificate.yaml b/internal/controller/testdata/domain/domain-processing-additionalCACertificate.yaml index fa717f56..f048c943 100644 --- a/internal/controller/testdata/domain/domain-processing-additionalCACertificate.yaml +++ b/internal/controller/testdata/domain/domain-processing-additionalCACertificate.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-certManager-commonName.yaml b/internal/controller/testdata/domain/domain-processing-certManager-commonName.yaml index 0193488a..512f933e 100644 --- a/internal/controller/testdata/domain/domain-processing-certManager-commonName.yaml +++ b/internal/controller/testdata/domain/domain-processing-certManager-commonName.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef-commonName.yaml b/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef-commonName.yaml index 780d68aa..c09a7eea 100644 --- a/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef-commonName.yaml +++ b/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef-commonName.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef.yaml b/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef.yaml index f844d859..93ec6f47 100644 --- a/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef.yaml +++ b/internal/controller/testdata/domain/domain-processing-certManager-customIssuerRef.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-dns.yaml b/internal/controller/testdata/domain/domain-processing-dns.yaml index b9f53188..2bae997f 100644 --- a/internal/controller/testdata/domain/domain-processing-dns.yaml +++ b/internal/controller/testdata/domain/domain-processing-dns.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-mutual.yaml b/internal/controller/testdata/domain/domain-processing-mutual.yaml index 95085bdb..f2510a0c 100644 --- a/internal/controller/testdata/domain/domain-processing-mutual.yaml +++ b/internal/controller/testdata/domain/domain-processing-mutual.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-cert-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-cert-gateway.yaml index 15782f1a..07acdd68 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-cert-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-cert-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -38,7 +38,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-cert-secret-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-cert-secret-gateway.yaml index 6bc3216c..55609ae3 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-cert-secret-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-cert-secret-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-commonName-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-commonName-gateway.yaml index b5d5b717..2fb1f80e 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-commonName-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-commonName-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-commonName-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-commonName-gateway.yaml index ee4cb439..080014a4 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-commonName-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-commonName-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -45,7 +45,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-gateway.yaml index 7d711f3d..35862ccc 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-customIssuerRef-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -43,7 +43,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-gateway.yaml index b9c27783..a9d2e926 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -38,7 +38,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-secret-gateway.yaml b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-secret-gateway.yaml index af7c228f..a3d7ee04 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom-certManager-secret-gateway.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom-certManager-secret-gateway.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: generateName: test-cap-01-primary- namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-observedDom.yaml b/internal/controller/testdata/domain/domain-processing-observedDom.yaml index ba4dd16a..2dcc9c97 100644 --- a/internal/controller/testdata/domain/domain-processing-observedDom.yaml +++ b/internal/controller/testdata/domain/domain-processing-observedDom.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-old-dns.yaml b/internal/controller/testdata/domain/domain-processing-old-dns.yaml index c851f84e..3f9fe0a6 100644 --- a/internal/controller/testdata/domain/domain-processing-old-dns.yaml +++ b/internal/controller/testdata/domain/domain-processing-old-dns.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-optional-mutual.yaml b/internal/controller/testdata/domain/domain-processing-optional-mutual.yaml index fd3895c4..f3a7c697 100644 --- a/internal/controller/testdata/domain/domain-processing-optional-mutual.yaml +++ b/internal/controller/testdata/domain/domain-processing-optional-mutual.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing-updated-dns.yaml b/internal/controller/testdata/domain/domain-processing-updated-dns.yaml index 9441a1c2..be7b3611 100644 --- a/internal/controller/testdata/domain/domain-processing-updated-dns.yaml +++ b/internal/controller/testdata/domain/domain-processing-updated-dns.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -41,7 +41,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-processing-without-additionalCaCertificate.yaml b/internal/controller/testdata/domain/domain-processing-without-additionalCaCertificate.yaml index f9c6c69a..a430943f 100644 --- a/internal/controller/testdata/domain/domain-processing-without-additionalCaCertificate.yaml +++ b/internal/controller/testdata/domain/domain-processing-without-additionalCaCertificate.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-processing.yaml b/internal/controller/testdata/domain/domain-processing.yaml index a95009be..2c8b64d6 100644 --- a/internal/controller/testdata/domain/domain-processing.yaml +++ b/internal/controller/testdata/domain/domain-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-ready-additionCACertificate.yaml b/internal/controller/testdata/domain/domain-ready-additionCACertificate.yaml index 2f61df47..025a2408 100644 --- a/internal/controller/testdata/domain/domain-ready-additionCACertificate.yaml +++ b/internal/controller/testdata/domain/domain-ready-additionCACertificate.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-ready-withDeletionTimestamp.yaml b/internal/controller/testdata/domain/domain-ready-withDeletionTimestamp.yaml index daa21b8d..4291ea4c 100644 --- a/internal/controller/testdata/domain/domain-ready-withDeletionTimestamp.yaml +++ b/internal/controller/testdata/domain/domain-ready-withDeletionTimestamp.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-ready.yaml b/internal/controller/testdata/domain/domain-ready.yaml index 7d0c190b..2ff3e048 100644 --- a/internal/controller/testdata/domain/domain-ready.yaml +++ b/internal/controller/testdata/domain/domain-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-update.expected-certManager.yaml b/internal/controller/testdata/domain/domain-update.expected-certManager.yaml index 6cad4fb4..65e5a84a 100644 --- a/internal/controller/testdata/domain/domain-update.expected-certManager.yaml +++ b/internal/controller/testdata/domain/domain-update.expected-certManager.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -37,7 +37,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -72,7 +72,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-update.expected.yaml b/internal/controller/testdata/domain/domain-update.expected.yaml index 6ef1bbec..42077f38 100644 --- a/internal/controller/testdata/domain/domain-update.expected.yaml +++ b/internal/controller/testdata/domain/domain-update.expected.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -37,7 +37,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -72,7 +72,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-update.yaml b/internal/controller/testdata/domain/domain-update.yaml index 3c93131b..c4361439 100644 --- a/internal/controller/testdata/domain/domain-update.yaml +++ b/internal/controller/testdata/domain/domain-update.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-with-customDNS-processing.yaml b/internal/controller/testdata/domain/domain-with-customDNS-processing.yaml index 409ff259..acad5d25 100644 --- a/internal/controller/testdata/domain/domain-with-customDNS-processing.yaml +++ b/internal/controller/testdata/domain/domain-with-customDNS-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-with-customDNS-services.yaml b/internal/controller/testdata/domain/domain-with-customDNS-services.yaml index 06b71b84..d48ab6c7 100644 --- a/internal/controller/testdata/domain/domain-with-customDNS-services.yaml +++ b/internal/controller/testdata/domain/domain-with-customDNS-services.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -45,7 +45,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -74,7 +74,7 @@ metadata: name: test-cap-01-primary-gen1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -101,7 +101,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-with-customDNS-tenant.yaml b/internal/controller/testdata/domain/domain-with-customDNS-tenant.yaml index acf3113e..19944019 100644 --- a/internal/controller/testdata/domain/domain-with-customDNS-tenant.yaml +++ b/internal/controller/testdata/domain/domain-with-customDNS-tenant.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -45,7 +45,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -74,7 +74,7 @@ metadata: name: test-cap-01-primary-gen1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -101,7 +101,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol-cat.yaml b/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol-cat.yaml index e7c9306b..9f4c521f 100644 --- a/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol-cat.yaml +++ b/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol-cat.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -67,7 +67,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol.yaml b/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol.yaml index 56d7717c..aa1c1759 100644 --- a/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol.yaml +++ b/internal/controller/testdata/domain/domain-with-subdomain-processing-with-dns-netpol.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary @@ -40,7 +40,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain @@ -67,7 +67,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/domain-with-subdomain-processing.yaml b/internal/controller/testdata/domain/domain-with-subdomain-processing.yaml index eefca474..572a6f1b 100644 --- a/internal/controller/testdata/domain/domain-with-subdomain-processing.yaml +++ b/internal/controller/testdata/domain/domain-with-subdomain-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/domain-with-subdomain-ready.yaml b/internal/controller/testdata/domain/domain-with-subdomain-ready.yaml index 8942e9d6..fa3ad638 100644 --- a/internal/controller/testdata/domain/domain-with-subdomain-ready.yaml +++ b/internal/controller/testdata/domain/domain-with-subdomain-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: Domain metadata: name: test-cap-01-primary diff --git a/internal/controller/testdata/domain/primary-dns-error.yaml b/internal/controller/testdata/domain/primary-dns-error.yaml index c201ee59..c08fd28d 100644 --- a/internal/controller/testdata/domain/primary-dns-error.yaml +++ b/internal/controller/testdata/domain/primary-dns-error.yaml @@ -13,7 +13,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/primary-dns-ready.yaml b/internal/controller/testdata/domain/primary-dns-ready.yaml index 41d3836c..a44b8913 100644 --- a/internal/controller/testdata/domain/primary-dns-ready.yaml +++ b/internal/controller/testdata/domain/primary-dns-ready.yaml @@ -13,7 +13,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/primary-gateway-cert-manager.yaml b/internal/controller/testdata/domain/primary-gateway-cert-manager.yaml index f3eef235..d5885b58 100644 --- a/internal/controller/testdata/domain/primary-gateway-cert-manager.yaml +++ b/internal/controller/testdata/domain/primary-gateway-cert-manager.yaml @@ -10,7 +10,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/domain/primary-gateway.yaml b/internal/controller/testdata/domain/primary-gateway.yaml index 5f9906a1..6bca298d 100644 --- a/internal/controller/testdata/domain/primary-gateway.yaml +++ b/internal/controller/testdata/domain/primary-gateway.yaml @@ -10,7 +10,7 @@ metadata: name: test-cap-01-primary-gen namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: Domain diff --git a/internal/controller/testdata/version-monitoring/ca-cleanup-dry-run-enabled.yaml b/internal/controller/testdata/version-monitoring/ca-cleanup-dry-run-enabled.yaml index 3be29309..5fdecd4a 100644 --- a/internal/controller/testdata/version-monitoring/ca-cleanup-dry-run-enabled.yaml +++ b/internal/controller/testdata/version-monitoring/ca-cleanup-dry-run-enabled.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/version-monitoring/ca-cleanup-enabled.yaml b/internal/controller/testdata/version-monitoring/ca-cleanup-enabled.yaml index 32c9439c..b6c27884 100644 --- a/internal/controller/testdata/version-monitoring/ca-cleanup-enabled.yaml +++ b/internal/controller/testdata/version-monitoring/ca-cleanup-enabled.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplication metadata: finalizers: diff --git a/internal/controller/testdata/version-monitoring/cat-consumer-v2-upgrading.yaml b/internal/controller/testdata/version-monitoring/cat-consumer-v2-upgrading.yaml index 5702fce8..7b906034 100644 --- a/internal/controller/testdata/version-monitoring/cat-consumer-v2-upgrading.yaml +++ b/internal/controller/testdata/version-monitoring/cat-consumer-v2-upgrading.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-consumer namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cat-provider-v2-ready.yaml b/internal/controller/testdata/version-monitoring/cat-provider-v2-ready.yaml index 8e2e9f86..cb949577 100644 --- a/internal/controller/testdata/version-monitoring/cat-provider-v2-ready.yaml +++ b/internal/controller/testdata/version-monitoring/cat-provider-v2-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cat-provider-v3-ready.yaml b/internal/controller/testdata/version-monitoring/cat-provider-v3-ready.yaml index 875cb6f1..b03511a0 100644 --- a/internal/controller/testdata/version-monitoring/cat-provider-v3-ready.yaml +++ b/internal/controller/testdata/version-monitoring/cat-provider-v3-ready.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPTenant metadata: finalizers: @@ -16,7 +16,7 @@ metadata: name: test-cap-01-provider namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-error.yaml b/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-error.yaml index be642cf4..c2cc144a 100644 --- a/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-error.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-error.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-processing.yaml b/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-processing.yaml index 15651d85..b10d8ed7 100644 --- a/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-processing.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules.yaml b/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules.yaml index 153cec90..8dfa34ee 100644 --- a/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v1-deletion-rules.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v1-monitoring-port-missing.yaml b/internal/controller/testdata/version-monitoring/cav-v1-monitoring-port-missing.yaml index 146c832e..8f849486 100644 --- a/internal/controller/testdata/version-monitoring/cav-v1-monitoring-port-missing.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v1-monitoring-port-missing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v1-no-deletion-rules.yaml b/internal/controller/testdata/version-monitoring/cav-v1-no-deletion-rules.yaml index fe071e48..24c54046 100644 --- a/internal/controller/testdata/version-monitoring/cav-v1-no-deletion-rules.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v1-no-deletion-rules.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: creationTimestamp: "2022-03-18T22:14:33Z" @@ -13,7 +13,7 @@ metadata: name: test-cap-01-cav-v1 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v2-deletion-rules.yaml b/internal/controller/testdata/version-monitoring/cav-v2-deletion-rules.yaml index 499b66da..b087e5b5 100644 --- a/internal/controller/testdata/version-monitoring/cav-v2-deletion-rules.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v2-deletion-rules.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v2 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules-processing.yaml b/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules-processing.yaml index 65086193..efc97625 100644 --- a/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules-processing.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules-processing.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v3 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules.yaml b/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules.yaml index aba39ad7..17b2a03c 100644 --- a/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules.yaml +++ b/internal/controller/testdata/version-monitoring/cav-v3-deletion-rules.yaml @@ -1,4 +1,4 @@ -apiVersion: sme.sap.com/v1alpha1 +apiVersion: sme.sap.com/v1alpha2 kind: CAPApplicationVersion metadata: generation: 1 @@ -12,7 +12,7 @@ metadata: name: test-cap-01-cav-v3 namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplication diff --git a/internal/controller/testdata/version-monitoring/servicemonitors-cav-v1.yaml b/internal/controller/testdata/version-monitoring/servicemonitors-cav-v1.yaml index f36dda16..add24e92 100644 --- a/internal/controller/testdata/version-monitoring/servicemonitors-cav-v1.yaml +++ b/internal/controller/testdata/version-monitoring/servicemonitors-cav-v1.yaml @@ -14,7 +14,7 @@ metadata: name: test-cap-01-cav-v1-app-router-svc namespace: default ownerReferences: - - apiVersion: sme.sap.com/v1alpha1 + - apiVersion: sme.sap.com/v1alpha2 blockOwnerDeletion: true controller: true kind: CAPApplicationVersion diff --git a/internal/controller/utils.go b/internal/controller/utils.go index 63ea6a10..b9184b1e 100644 --- a/internal/controller/utils.go +++ b/internal/controller/utils.go @@ -16,10 +16,11 @@ import ( "strconv" "strings" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" networkingv1 "istio.io/api/networking/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/klog/v2" ) @@ -49,15 +50,24 @@ type appMetadataIdentifiers struct { ownerInfo *ownerInfo } -func getOwnerByKind(owners []metav1.OwnerReference, kind string) (*metav1.OwnerReference, bool) { +func getOwnerByKind(owners []metav1.OwnerReference, kind, group string) (*metav1.OwnerReference, bool) { for _, o := range owners { - if o.APIVersion == v1alpha1.SchemeGroupVersion.String() && o.Kind == kind && *o.Controller { + gvk := schema.FromAPIVersionAndKind(o.APIVersion, o.Kind) + if gvk.Group == group && gvk.Kind == kind { return &o, true } } return nil, false } +func getOwnerByObject(owners []metav1.OwnerReference, kind string, owningObj metav1.Object) (*metav1.OwnerReference, bool) { + o, ok := getOwnerByKind(owners, kind, v1alpha2.Group) + if ok && o.Name == owningObj.GetName() && o.UID == owningObj.GetUID() { + return o, ok + } + return o, false +} + func getOwnerFromObjectMetadata(objectMeta metav1.Object, dependentKind string) (NamespacedResourceKey, bool) { var ownerKey NamespacedResourceKey @@ -94,13 +104,13 @@ func getResourceKindFromKey(key int) string { /* check whether the status of a custom resource (sme.sap.com) is Ready (based on metav1.Condition) */ -func isCROConditionReady(status v1alpha1.GenericStatus) bool { +func isCROConditionReady(status v1alpha2.GenericStatus) bool { if status.Conditions == nil { return false } return slices.ContainsFunc(status.Conditions, func(condition metav1.Condition) bool { - return condition.Type == string(v1alpha1.ConditionTypeReady) && condition.Status == metav1.ConditionTrue + return condition.Type == string(v1alpha2.ConditionTypeReady) && condition.Status == metav1.ConditionTrue }) } @@ -240,11 +250,11 @@ func updateLabelAnnotationMetadata(object *metav1.ObjectMeta, appMetadata *appMe return updated } -func convertTlsMode(m v1alpha1.TLSMode) networkingv1.ServerTLSSettings_TLSmode { +func convertTlsMode(m v1alpha2.TLSMode) networkingv1.ServerTLSSettings_TLSmode { switch m { - case v1alpha1.TlsModeOptionalMutual: + case v1alpha2.TlsModeOptionalMutual: return networkingv1.ServerTLSSettings_OPTIONAL_MUTUAL - case v1alpha1.TlsModeMutual: + case v1alpha2.TlsModeMutual: return networkingv1.ServerTLSSettings_MUTUAL default: return networkingv1.ServerTLSSettings_SIMPLE @@ -252,36 +262,36 @@ func convertTlsMode(m v1alpha1.TLSMode) networkingv1.ServerTLSSettings_TLSmode { } func (c *Controller) setCAStatusError(ctx context.Context, itemKey NamespacedResourceKey, err error) { - cached, _ := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().CAPApplications(itemKey.Namespace).Get(itemKey.Name) + cached, _ := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().CAPApplications(itemKey.Namespace).Get(itemKey.Name) ca := cached.DeepCopy() - ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateError, metav1.ConditionFalse, recoveredPanic, err.Error()) - c.crdClient.SmeV1alpha1().CAPApplications(itemKey.Namespace).UpdateStatus(ctx, ca, metav1.UpdateOptions{}) + ca.SetStatusWithReadyCondition(v1alpha2.CAPApplicationStateError, metav1.ConditionFalse, recoveredPanic, err.Error()) + c.crdClient.SmeV1alpha2().CAPApplications(itemKey.Namespace).UpdateStatus(ctx, ca, metav1.UpdateOptions{}) } func (c *Controller) setCAVStatusError(ctx context.Context, itemKey NamespacedResourceKey, err error) { - cached, _ := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister().CAPApplicationVersions(itemKey.Namespace).Get(itemKey.Name) + cached, _ := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister().CAPApplicationVersions(itemKey.Namespace).Get(itemKey.Name) cav := cached.DeepCopy() - cav.SetStatusWithReadyCondition(v1alpha1.CAPApplicationVersionStateError, metav1.ConditionFalse, recoveredPanic, err.Error()) - c.crdClient.SmeV1alpha1().CAPApplicationVersions(itemKey.Namespace).UpdateStatus(ctx, cav, metav1.UpdateOptions{}) + cav.SetStatusWithReadyCondition(v1alpha2.CAPApplicationVersionStateError, metav1.ConditionFalse, recoveredPanic, err.Error()) + c.crdClient.SmeV1alpha2().CAPApplicationVersions(itemKey.Namespace).UpdateStatus(ctx, cav, metav1.UpdateOptions{}) } func (c *Controller) setCATStatusError(ctx context.Context, itemKey NamespacedResourceKey, err error) { - cached, _ := c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister().CAPTenants(itemKey.Namespace).Get(itemKey.Name) + cached, _ := c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister().CAPTenants(itemKey.Namespace).Get(itemKey.Name) cat := cached.DeepCopy() - var state v1alpha1.CAPTenantState + var state v1alpha2.CAPTenantState // Determine error state based on current tenant state - if cat.Status.State == v1alpha1.CAPTenantStateUpgrading { - state = v1alpha1.CAPTenantStateUpgradeError + if cat.Status.State == v1alpha2.CAPTenantStateUpgrading { + state = v1alpha2.CAPTenantStateUpgradeError } else { - state = v1alpha1.CAPTenantStateProvisioningError + state = v1alpha2.CAPTenantStateProvisioningError } cat.SetStatusWithReadyCondition(state, metav1.ConditionFalse, recoveredPanic, err.Error()) - c.crdClient.SmeV1alpha1().CAPTenants(itemKey.Namespace).UpdateStatus(ctx, cat, metav1.UpdateOptions{}) + c.crdClient.SmeV1alpha2().CAPTenants(itemKey.Namespace).UpdateStatus(ctx, cat, metav1.UpdateOptions{}) } func (c *Controller) setCTOPStatusError(ctx context.Context, itemKey NamespacedResourceKey, err error) { - cached, _ := c.crdInformerFactory.Sme().V1alpha1().CAPTenantOperations().Lister().CAPTenantOperations(itemKey.Namespace).Get(itemKey.Name) + cached, _ := c.crdInformerFactory.Sme().V1alpha2().CAPTenantOperations().Lister().CAPTenantOperations(itemKey.Namespace).Get(itemKey.Name) ctop := cached.DeepCopy() - ctop.SetStatusWithReadyCondition(v1alpha1.CAPTenantOperationStateFailed, metav1.ConditionFalse, recoveredPanic, err.Error()) - c.crdClient.SmeV1alpha1().CAPTenantOperations(itemKey.Namespace).UpdateStatus(ctx, ctop, metav1.UpdateOptions{}) + ctop.SetStatusWithReadyCondition(v1alpha2.CAPTenantOperationStateFailed, metav1.ConditionFalse, recoveredPanic, err.Error()) + c.crdClient.SmeV1alpha2().CAPTenantOperations(itemKey.Namespace).UpdateStatus(ctx, ctop, metav1.UpdateOptions{}) } diff --git a/internal/controller/version-monitoring.go b/internal/controller/version-monitoring.go index 88a2fa19..db41a818 100644 --- a/internal/controller/version-monitoring.go +++ b/internal/controller/version-monitoring.go @@ -16,7 +16,7 @@ import ( promapi "github.com/prometheus/client_golang/api" promv1 "github.com/prometheus/client_golang/api/prometheus/v1" prommodel "github.com/prometheus/common/model" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" "golang.org/x/mod/semver" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -232,7 +232,7 @@ func (c *Controller) scheduleVersionCollectionForCleanup(ctx context.Context, or } func (c *Controller) queueVersionsForCleanupEvaluation(orc *cleanupOrchestrator) error { - lister := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister() + lister := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister() cas, err := lister.List(labels.Everything()) if err != nil { return err @@ -255,14 +255,14 @@ func (c *Controller) queueVersionsForCleanupEvaluation(orc *cleanupOrchestrator) return nil } -func (c *Controller) getCleanupRelevantVersions(ca *v1alpha1.CAPApplication) ([]*v1alpha1.CAPApplicationVersion, error) { +func (c *Controller) getCleanupRelevantVersions(ca *v1alpha2.CAPApplication) ([]*v1alpha2.CAPApplicationVersion, error) { excludedVersions := map[string]bool{} excludedVersionNames := map[string]bool{} selector, _ := labels.ValidatedSelectorFromSet(map[string]string{ LabelOwnerIdentifierHash: sha1Sum(ca.Namespace, ca.Name), }) - tenantLister := c.crdInformerFactory.Sme().V1alpha1().CAPTenants().Lister() + tenantLister := c.crdInformerFactory.Sme().V1alpha2().CAPTenants().Lister() cats, err := tenantLister.CAPTenants(ca.Namespace).List(selector) if err != nil { return nil, err @@ -286,7 +286,7 @@ func (c *Controller) getCleanupRelevantVersions(ca *v1alpha1.CAPApplication) ([] // Explicitly exclude the latest Ready version from cleanup excludedVersions[latestReadyVersion.Spec.Version] = true - outdatedVersions := []*v1alpha1.CAPApplicationVersion{} + outdatedVersions := []*v1alpha2.CAPApplicationVersion{} cavs, _ := c.getCachedCAPApplicationVersions(ca) // ignoring error as this is not critical for i := range cavs { cav := cavs[i] @@ -348,14 +348,14 @@ func (c *Controller) processVersionCleanupQueueItem(ctx context.Context, orc *cl // for re-evaluation next cycle) while workloads without deletionRules remain // automatically eligible. func (c *Controller) evaluateVersionForCleanup(ctx context.Context, item NamespacedResourceKey, promapi promv1.API) error { - lister := c.crdInformerFactory.Sme().V1alpha1().CAPApplicationVersions().Lister() + lister := c.crdInformerFactory.Sme().V1alpha2().CAPApplicationVersions().Lister() cav, err := lister.CAPApplicationVersions(item.Namespace).Get(item.Name) if err != nil { return handleOperatorResourceErrors(err) } // read CAPApplication to determine dry-run mode - ca, err := c.crdInformerFactory.Sme().V1alpha1().CAPApplications().Lister().CAPApplications(cav.Namespace).Get(cav.Spec.CAPApplicationInstance) + ca, err := c.crdInformerFactory.Sme().V1alpha2().CAPApplications().Lister().CAPApplications(cav.Namespace).Get(cav.Spec.CAPApplicationInstance) if err != nil { return err } @@ -374,7 +374,7 @@ func (c *Controller) evaluateVersionForCleanup(ctx context.Context, item Namespa c.Event(cav, nil, corev1.EventTypeNormal, CAPApplicationVersionEventReadForDeletion, EventActionEvaluateMetrics, fmt.Sprintf("version %s is now ready for deletion", cav.Name)) if v, ok := ca.Annotations[AnnotationEnableCleanupMonitoring]; ok && strings.ToLower(v) == "true" { - return c.crdClient.SmeV1alpha1().CAPApplicationVersions(cav.Namespace).Delete(ctx, cav.Name, v1.DeleteOptions{}) + return c.crdClient.SmeV1alpha2().CAPApplicationVersions(cav.Namespace).Delete(ctx, cav.Name, v1.DeleteOptions{}) } } @@ -391,7 +391,7 @@ func (c *Controller) evaluateVersionForCleanup(ctx context.Context, item Namespa // single informational log entry is emitted. // - When deletionRules are present and promapi is available, the rules are // evaluated via the existing helpers. -func evaluateWorkloadForCleanup(ctx context.Context, cav NamespacedResourceKey, wl *v1alpha1.WorkloadDetails, promapi promv1.API) bool { +func evaluateWorkloadForCleanup(ctx context.Context, cav NamespacedResourceKey, wl *v1alpha2.WorkloadDetails, promapi promv1.API) bool { if wl.DeploymentDefinition == nil || wl.DeploymentDefinition.Monitoring == nil || wl.DeploymentDefinition.Monitoring.DeletionRules == nil { return true // if there are no rules - the workload is automatically eligible for cleanup } @@ -462,12 +462,12 @@ func evaluateExpression(ctx context.Context, rawExpr string, promapi promv1.API) return s.Value == 1, nil // expecting a boolean result } -func evaluateMetric(ctx context.Context, rule *v1alpha1.MetricRule, job, ns string, promapi promv1.API) (bool, error) { +func evaluateMetric(ctx context.Context, rule *v1alpha2.MetricRule, job, ns string, promapi promv1.API) (bool, error) { query := "" switch rule.Type { - case v1alpha1.MetricTypeGauge: + case v1alpha2.MetricTypeGauge: query = fmt.Sprintf(GaugeEvaluationExpression, rule.Name, job, ns, rule.CalculationPeriod) - case v1alpha1.MetricTypeCounter: + case v1alpha2.MetricTypeCounter: query = fmt.Sprintf(CounterEvaluationExpression, rule.Name, job, ns, rule.CalculationPeriod) default: return false, fmt.Errorf("metric %s has unsupported type %s", rule.Name, rule.Type) diff --git a/internal/controller/version-monitoring_test.go b/internal/controller/version-monitoring_test.go index 0d61bf8a..52e82c04 100644 --- a/internal/controller/version-monitoring_test.go +++ b/internal/controller/version-monitoring_test.go @@ -687,7 +687,7 @@ func TestVersionCleanupEvaluation(t *testing.T) { } // verify version deletion - _, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions("default").Get(context.TODO(), tt.evaluatedVersion, v1.GetOptions{}) + _, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions("default").Get(context.TODO(), tt.evaluatedVersion, v1.GetOptions{}) if tt.expectCleanup { if err == nil || !errors.IsNotFound(err) { t.Errorf("expected version %s to be deleted", tt.evaluatedVersion) @@ -733,7 +733,7 @@ func TestVersionCleanupEvaluation_NoPrometheus_NoDeletionRules(t *testing.T) { } // v1 must have been deleted. - _, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) + _, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) if err == nil || !errors.IsNotFound(err) { t.Errorf("expected version test-cap-01-cav-v1 to be deleted when it has no deletion rules and Prometheus is unavailable") } @@ -769,7 +769,7 @@ func TestVersionCleanupEvaluation_NoPrometheus_WithDeletionRules(t *testing.T) { } // v1 must NOT have been deleted. - _, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) + _, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) if err != nil { t.Errorf("expected version test-cap-01-cav-v1 to still exist when deletion rules cannot be evaluated: %v", err) } @@ -808,7 +808,7 @@ func TestVersionCleanupEvaluation_PromUnreachable(t *testing.T) { t.Errorf("expected zero requeues for CAV with deletion rules when Prometheus is unreachable, got %d", o.queue.NumRequeues(item)) } - _, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) + _, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) if err != nil { t.Errorf("expected version test-cap-01-cav-v1 to still exist: %v", err) } @@ -839,7 +839,7 @@ func TestVersionCleanupEvaluation_PromUnreachable(t *testing.T) { t.Errorf("expected zero requeues for CAV without deletion rules, got %d", o.queue.NumRequeues(item)) } - _, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) + _, err := c.crdClient.SmeV1alpha2().CAPApplicationVersions("default").Get(context.TODO(), "test-cap-01-cav-v1", v1.GetOptions{}) if err == nil || !errors.IsNotFound(err) { t.Errorf("expected version test-cap-01-cav-v1 to be deleted when it has no deletion rules") } diff --git a/internal/util/uaa.go b/internal/util/uaa.go index dd7a2a8a..2c11f4b7 100644 --- a/internal/util/uaa.go +++ b/internal/util/uaa.go @@ -8,14 +8,14 @@ package util import ( "slices" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) const ( AnnotationPrimaryXSUAA = "sme.sap.com/primary-xsuaa" ) -func GetXSUAAInfo(consumedServiceInfos []v1alpha1.ServiceInfo, ca *v1alpha1.CAPApplication) *v1alpha1.ServiceInfo { +func GetXSUAAInfo(consumedServiceInfos []v1alpha2.ServiceInfo, ca *v1alpha2.CAPApplication) *v1alpha2.ServiceInfo { // Get primary xsuaa service instance name primaryXSUAA := ca.Annotations[AnnotationPrimaryXSUAA] @@ -23,14 +23,14 @@ func GetXSUAAInfo(consumedServiceInfos []v1alpha1.ServiceInfo, ca *v1alpha1.CAPA // Check if matching service with annotated xsuaa name exists if primaryXSUAA != "" { - serviceIndex = slices.IndexFunc(consumedServiceInfos, func(consumedServiceInfo v1alpha1.ServiceInfo) bool { + serviceIndex = slices.IndexFunc(consumedServiceInfos, func(consumedServiceInfo v1alpha2.ServiceInfo) bool { return consumedServiceInfo.Name == primaryXSUAA }) } // Fallback to using 1st matching "xsuaa" class in the list of consumed services if serviceIndex == -1 { - serviceIndex = slices.IndexFunc(consumedServiceInfos, func(consumedServiceInfo v1alpha1.ServiceInfo) bool { return consumedServiceInfo.Class == "xsuaa" }) + serviceIndex = slices.IndexFunc(consumedServiceInfos, func(consumedServiceInfo v1alpha2.ServiceInfo) bool { return consumedServiceInfo.Class == "xsuaa" }) } // Return matching service info if any diff --git a/internal/util/uaa_test.go b/internal/util/uaa_test.go index b9f646f2..745127c1 100644 --- a/internal/util/uaa_test.go +++ b/internal/util/uaa_test.go @@ -9,11 +9,11 @@ import ( "strings" "testing" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -var serviceInfos = []v1alpha1.ServiceInfo{ +var serviceInfos = []v1alpha2.ServiceInfo{ { Class: "xsuaa", Name: "test-xsuaa", @@ -57,7 +57,7 @@ func execTestsWithBLI(t *testing.T, name string, backlogItems []string, test fun func TestGetXSUAAInfoMissingService(t *testing.T) { execTestsWithBLI(t, "Check that no uaa info is returned when no uaa service is present", []string{"ERP4SMEPREPWORKAPPPLAT-3773"}, func(t *testing.T) { - res := GetXSUAAInfo([]v1alpha1.ServiceInfo{}, &v1alpha1.CAPApplication{}) + res := GetXSUAAInfo([]v1alpha2.ServiceInfo{}, &v1alpha2.CAPApplication{}) if res != nil { t.Error("unexpected uaa info") @@ -67,7 +67,7 @@ func TestGetXSUAAInfoMissingService(t *testing.T) { func TestGetXSUAAInfoWithoutAnnotation(t *testing.T) { execTestsWithBLI(t, "Check that the 1st uaa info is returned with CA with no annotation is present", []string{"ERP4SMEPREPWORKAPPPLAT-3773"}, func(t *testing.T) { // CA without "sme.sap.com/primary-xsuaa" annotation - ca := v1alpha1.CAPApplication{} + ca := v1alpha2.CAPApplication{} res := GetXSUAAInfo(serviceInfos, &ca) @@ -80,7 +80,7 @@ func TestGetXSUAAInfoWithoutAnnotation(t *testing.T) { func TestGetXSUAAInfoWithAnnotation(t *testing.T) { execTestsWithBLI(t, "Check that the right uaa info is returned for CA with annotation present", []string{"ERP4SMEPREPWORKAPPPLAT-3773"}, func(t *testing.T) { // CA without "sme.sap.com/primary-xsuaa" annotation - ca := v1alpha1.CAPApplication{ + ca := v1alpha2.CAPApplication{ ObjectMeta: v1.ObjectMeta{ Annotations: map[string]string{ AnnotationPrimaryXSUAA: "test-xsuaa2", diff --git a/internal/util/vcap-credentials.go b/internal/util/vcap-credentials.go index 4e7b080f..856aa9fe 100644 --- a/internal/util/vcap-credentials.go +++ b/internal/util/vcap-credentials.go @@ -10,7 +10,7 @@ import ( "encoding/json" "fmt" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" @@ -66,7 +66,7 @@ const ( PropertyFormatJSON PropertyFormat = "json" ) -func ReadServiceCredentialsFromSecret[T any](serviceInfo *v1alpha1.ServiceInfo, ns string, kubeClient kubernetes.Interface, withMeta bool) (*T, error) { +func ReadServiceCredentialsFromSecret[T any](serviceInfo *v1alpha2.ServiceInfo, ns string, kubeClient kubernetes.Interface, withMeta bool) (*T, error) { entry, err := CreateVCAPEntryFromSecret(serviceInfo, ns, kubeClient, nil) if err != nil { return nil, err @@ -83,7 +83,7 @@ func ReadServiceCredentialsFromSecret[T any](serviceInfo *v1alpha1.ServiceInfo, return ParseJSON[T](serviceCredInfo) } -func CreateVCAPEntryFromSecret(serviceInfo *v1alpha1.ServiceInfo, ns string, kubeClient kubernetes.Interface, kubeInformerFactory informers.SharedInformerFactory) (entry map[string]any, err error) { +func CreateVCAPEntryFromSecret(serviceInfo *v1alpha2.ServiceInfo, ns string, kubeClient kubernetes.Interface, kubeInformerFactory informers.SharedInformerFactory) (entry map[string]any, err error) { var secret *corev1.Secret // Get secret if kubeInformerFactory != nil { @@ -99,7 +99,7 @@ func CreateVCAPEntryFromSecret(serviceInfo *v1alpha1.ServiceInfo, ns string, kub return createVCAPEntry(secret.Data, serviceInfo) } -func createVCAPEntry(data map[string][]byte, si *v1alpha1.ServiceInfo) (entry map[string]any, err error) { +func createVCAPEntry(data map[string][]byte, si *v1alpha2.ServiceInfo) (entry map[string]any, err error) { if metaBytes, ok := data[".metadata"]; ok { // metadata available from new service binding specification var meta SecretMetadata if err = json.Unmarshal(metaBytes, &meta); err != nil { @@ -127,7 +127,7 @@ func createVCAPEntry(data map[string][]byte, si *v1alpha1.ServiceInfo) (entry ma return } -func createVCAPEntryWithMetadata(data map[string][]byte, meta *SecretMetadata, si *v1alpha1.ServiceInfo) (entry map[string]any, err error) { +func createVCAPEntryWithMetadata(data map[string][]byte, meta *SecretMetadata, si *v1alpha2.ServiceInfo) (entry map[string]any, err error) { entry = map[string]any{"credentials": map[string]any{}} for i := range meta.MetadataProperties { if entry, err = meta.MetadataProperties[i].move(data, entry); err != nil { diff --git a/internal/util/vcap-credentials_test.go b/internal/util/vcap-credentials_test.go index 6a359c44..a488e59e 100644 --- a/internal/util/vcap-credentials_test.go +++ b/internal/util/vcap-credentials_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sruntime "k8s.io/apimachinery/pkg/runtime" @@ -114,7 +114,7 @@ func createTestClient(kubeInformerFactory informers.SharedInformerFactory) (*fak func testCreateVCAPEntryFromSecret(t *testing.T) { type testCase struct { name string - serviceInfo *v1alpha1.ServiceInfo + serviceInfo *v1alpha2.ServiceInfo namespace string expectError bool errorMsg string @@ -126,35 +126,35 @@ func testCreateVCAPEntryFromSecret(t *testing.T) { { name: "valid credential secret without metadata", namespace: "default", - serviceInfo: &v1alpha1.ServiceInfo{Name: "service-a", Secret: "no-meta-credential-key", Class: "xzy"}, + serviceInfo: &v1alpha2.ServiceInfo{Name: "service-a", Secret: "no-meta-credential-key", Class: "xzy"}, expectedInstanceName: "service-a", expectedLabel: "xyz", }, { name: "secret not found", namespace: "another", - serviceInfo: &v1alpha1.ServiceInfo{Name: "service-a", Secret: "no-meta-credential-key", Class: "xzy"}, + serviceInfo: &v1alpha2.ServiceInfo{Name: "service-a", Secret: "no-meta-credential-key", Class: "xzy"}, expectError: true, errorMsg: "secret \"no-meta-credential-key\" not found", }, { name: "valid credentials (container) with metadata", namespace: "default", - serviceInfo: &v1alpha1.ServiceInfo{Name: "service-a", Secret: "metadata-with-credential-key", Class: "xzy"}, + serviceInfo: &v1alpha2.ServiceInfo{Name: "service-a", Secret: "metadata-with-credential-key", Class: "xzy"}, expectedInstanceName: "service-a", expectedLabel: "xyz", }, { name: "malformed metadata", namespace: "default", - serviceInfo: &v1alpha1.ServiceInfo{Name: "service-a", Secret: "malformed-metadata", Class: "xzy"}, + serviceInfo: &v1alpha2.ServiceInfo{Name: "service-a", Secret: "malformed-metadata", Class: "xzy"}, expectError: true, errorMsg: "could not parse metadata from secret malformed-metadata: invalid character '/' looking for beginning of value", }, { name: "valid credentials (multiple properties) with metadata", namespace: "default", - serviceInfo: &v1alpha1.ServiceInfo{Name: "service-a", Secret: "metadata-with-credential-properties", Class: "xzy"}, + serviceInfo: &v1alpha2.ServiceInfo{Name: "service-a", Secret: "metadata-with-credential-properties", Class: "xzy"}, expectedInstanceName: "service-a", expectedLabel: "xyz", expectTags: true, @@ -194,7 +194,7 @@ func testReadServiceCredentialsFromSecret(t *testing.T) { // test successful read secretName := "metadata-with-credential-key" - credentials, err := ReadServiceCredentialsFromSecret[map[string]string](&v1alpha1.ServiceInfo{Name: "service-a", Class: "xyz", Secret: secretName}, "default", c, false) + credentials, err := ReadServiceCredentialsFromSecret[map[string]string](&v1alpha2.ServiceInfo{Name: "service-a", Class: "xyz", Secret: secretName}, "default", c, false) if err != nil { t.Errorf("could not read credentials from secret %s", secretName) } @@ -203,7 +203,7 @@ func testReadServiceCredentialsFromSecret(t *testing.T) { } // test with type mismatch - _, err = ReadServiceCredentialsFromSecret[[]string](&v1alpha1.ServiceInfo{Name: "service-a", Class: "xyz", Secret: secretName}, "default", c, false) + _, err = ReadServiceCredentialsFromSecret[[]string](&v1alpha2.ServiceInfo{Name: "service-a", Class: "xyz", Secret: secretName}, "default", c, false) if err == nil { t.Errorf("expected error when reading credentials as array from secret %s", secretName) } diff --git a/pkg/apis/sme.sap.com/v1alpha1/types.go b/pkg/apis/sme.sap.com/v1alpha1/types.go index fd737af0..53ba2b32 100644 --- a/pkg/apis/sme.sap.com/v1alpha1/types.go +++ b/pkg/apis/sme.sap.com/v1alpha1/types.go @@ -3,16 +3,15 @@ SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator SPDX-License-Identifier: Apache-2.0 */ +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. package v1alpha1 import ( - certManagermetav1 "github.com/cert-manager/cert-manager/pkg/apis/meta/v1" - autoscalingv2 "k8s.io/api/autoscaling/v2" - corev1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. const ( Group = "sme.sap.com" Version = "v1alpha1" @@ -34,11 +33,13 @@ const ( // +kubebuilder:resource:shortName=ca // +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion // +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 +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplication is the schema for capapplications API type CAPApplication struct { metav1.TypeMeta `json:",inline"` @@ -47,39 +48,12 @@ type CAPApplication struct { Spec CAPApplicationSpec `json:"spec"` // +kubebuilder:validation:Optional // CAPApplication status - Status CAPApplicationStatus `json:"status"` + Status v1alpha2.CAPApplicationStatus `json:"status"` } -type CAPApplicationStatus struct { - GenericStatus `json:",inline"` - // +kubebuilder:validation:Enum="";Consistent;Processing;Error;Deleting - // State of CAPApplication - State CAPApplicationState `json:"state"` - // Represents whether this is a services only scenario - ServicesOnly *bool `json:"servicesOnly,omitempty"` - // Hash representing last known application domains - DomainSpecHash string `json:"domainSpecHash,omitempty"` - // The last time a full reconciliation was completed - LastFullReconciliationTime metav1.Time `json:"lastFullReconciliationTime,omitempty"` - // Last known application subdomains - ObservedSubdomains []string `json:"observedSubdomains,omitempty"` -} - -type CAPApplicationState string - -const ( - // CAPApplication is being reconciled - CAPApplicationStateProcessing CAPApplicationState = "Processing" - // An error occurred during reconciliation - CAPApplicationStateError CAPApplicationState = "Error" - // Deletion has been triggered - CAPApplicationStateDeleting CAPApplicationState = "Deleting" - // CAPApplication has been reconciled and is now consistent - CAPApplicationStateConsistent CAPApplicationState = "Consistent" -) - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplicationList contains a list of CAPApplication type CAPApplicationList struct { metav1.TypeMeta `json:",inline"` @@ -87,33 +61,16 @@ type CAPApplicationList struct { Items []CAPApplication `json:"items"` } +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplicationSpec defines the desired state of CAPApplication type CAPApplicationSpec struct { - // Reference to `Domain` resources used by the application - DomainRefs []DomainRef `json:"domainRefs,omitempty"` + // Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. + v1alpha2.CAPApplicationSpec `json:",inline"` // Deprecated: Domains used by the application. Will be removed in future versions, use `DomainRefs` instead Domains ApplicationDomains `json:"domains,omitempty"` // Deprecated: SAP BTP Global Account Identifier where services are entitled for the current application // Will be removed soon, use ProviderSubaccountId instead GlobalAccountId string `json:"globalAccountId,omitempty"` - // The subaccount ID in which the application is provided - ProviderSubaccountId string `json:"providerSubaccountId"` - // Short name for the application (BTP XSAPPNAME) - BTPAppName string `json:"btpAppName"` - // Deprecated: Provider subaccount where application services are created - // Will be removed, consider automating this via BTP / subscription instead! - Provider *BTPTenantIdentification `json:"provider,omitempty"` - // SAP BTP Services consumed by the application - BTP BTP `json:"btp"` - // Rollout on Credentials Update may be used to rollout deployments when dependent service credentials are updated - RolloutOnCredentialUpdate bool `json:"rolloutOnCredentialUpdate,omitempty"` -} - -// Domain references -type DomainRef struct { - // +kubebuilder:validation:Enum=Domain;ClusterDomain - Kind string `json:"kind"` - Name string `json:"name"` } // Application domains @@ -145,107 +102,30 @@ type NameValue struct { Value string `json:"value"` } -// Identifies an SAP BTP subaccount (tenant) -type BTPTenantIdentification struct { - // BTP subaccount subdomain - SubDomain string `json:"subDomain"` - // BTP subaccount Tenant ID - TenantId string `json:"tenantId"` -} - -type BTP struct { - // Details of BTP Services - Services []ServiceInfo `json:"services"` -} - -// Service information -type ServiceInfo struct { - // A unique name of service based on usage in the app (this may be the name of the instance or binding) - Name string `json:"name"` - // Secret containing service access credentials - Secret string `json:"secret"` - // Type of service - Class string `json:"class"` - // SubscriptionDependency may be used to specify whether this service should be part of getDependencies call from subscription service (e.g. saas-registry) - SubscriptionDependency *SubscriptionDependency `json:"subscriptionDependency,omitempty"` -} - -// +kubebuilder:validation:Enum=Auto;Always;Never -type SubscriptionDependency string - -const ( - // Automatically determine if the service needs to be returned in getDependencies call - SubscriptionDependencyAuto SubscriptionDependency = "Auto" - // Always return the service in getDependencies call - SubscriptionDependencyAlways SubscriptionDependency = "Always" - // Never return the service in getDependencies call - SubscriptionDependencyNever SubscriptionDependency = "Never" -) - -// Custom resource status -type GenericStatus struct { - // Observed generation of the resource where this status was identified - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - // State expressed as conditions - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -type CAPApplicationStatusConditionType string - -const ( - ConditionTypeAllTenantsReady CAPApplicationStatusConditionType = "AllTenantsReady" - ConditionTypeLatestVersionReady CAPApplicationStatusConditionType = "LatestVersionReady" -) - -type StatusConditionType string - -const ( - ConditionTypeReady StatusConditionType = "Ready" -) - // +kubebuilder:resource:shortName=cav // +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" // +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplicationVersion defines the schema for capapplicationversions API type CAPApplicationVersion struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // CAPApplicationVersion spec - Spec CAPApplicationVersionSpec `json:"spec"` + Spec v1alpha2.CAPApplicationVersionSpec `json:"spec"` // +kubebuilder:validation:Optional // CAPApplicationVersion status - Status CAPApplicationVersionStatus `json:"status"` -} - -type CAPApplicationVersionStatus struct { - GenericStatus `json:",inline"` - // +kubebuilder:validation:Enum="";Ready;Error;Processing;Deleting - // State of CAPApplicationVersion - State CAPApplicationVersionState `json:"state"` - // List of finished Content Jobs - FinishedJobs []string `json:"finishedJobs,omitempty"` + Status v1alpha2.CAPApplicationVersionStatus `json:"status"` } -type CAPApplicationVersionState string - -const ( - // CAPApplicationVersion is being processed - CAPApplicationVersionStateProcessing CAPApplicationVersionState = "Processing" - // An error occurred during reconciliation - CAPApplicationVersionStateError CAPApplicationVersionState = "Error" - // Deletion has been triggered - CAPApplicationVersionStateDeleting CAPApplicationVersionState = "Deleting" - // CAPApplicationVersion is now ready for use (dependent resources have been created) - CAPApplicationVersionStateReady CAPApplicationVersionState = "Ready" -) - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplicationVersionList contains a list of CAPApplicationVersion type CAPApplicationVersionList struct { metav1.TypeMeta `json:",inline"` @@ -253,331 +133,9 @@ type CAPApplicationVersionList struct { Items []CAPApplicationVersion `json:"items"` } -// CAPApplicationVersionSpec specifies the desired state of CAPApplicationVersion -type CAPApplicationVersionSpec struct { - // Denotes to which CAPApplication the current version belongs - CAPApplicationInstance string `json:"capApplicationInstance"` - // Semantic version - // +kubebuilder:validation:Pattern=^(0|[1-9]\d*)(\.(0|[1-9]\d*)(\.(0|[1-9]\d*)(-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?)?)?$ - Version string `json:"version"` - // Registry secrets used to pull images of the application components - RegistrySecrets []string `json:"registrySecrets,omitempty"` - // Information about the Workloads - // +kubebuilder:validation:MaxItems=100 - Workloads []WorkloadDetails `json:"workloads"` - // Tenant Operations may be used to specify how jobs are sequenced for the different tenant operations - TenantOperations *TenantOperations `json:"tenantOperations,omitempty"` - // Content Jobs may be used to specify the sequence of content jobs when several jobs exist - ContentJobs []string `json:"contentJobs,omitempty"` - // Configuration for the service(s) to be exposed (relevant only for 'Service' type deployment workloads) - ServiceExposures []ServiceExposure `json:"serviceExposures,omitempty"` -} - -// WorkloadDetails specifies the details of the Workload -// +kubebuilder:validation:ExactlyOneOf=deploymentDefinition;jobDefinition -type WorkloadDetails struct { - // Name of the workload - Name string `json:"name"` - // List of BTP services consumed by the current application component workload. These services must be defined in the corresponding CAPApplication. - ConsumedBTPServices []string `json:"consumedBTPServices"` - // Custom labels for the current workload - Labels map[string]string `json:"labels,omitempty"` - // Annotations for the current workload, in case of `Deployments` this also get copied over to any `Service` that may be created - Annotations map[string]string `json:"annotations,omitempty"` - // Definition of a deployment - DeploymentDefinition *DeploymentDetails `json:"deploymentDefinition,omitempty"` - // Definition of a job - JobDefinition *JobDetails `json:"jobDefinition,omitempty"` -} - -// DeploymentDetails specifies the details of the Deployment -type DeploymentDetails struct { - CommonDetails `json:",inline"` - // Type of the Deployment - Type DeploymentType `json:"type"` - // Number of replicas - Replicas *int32 `json:"replicas,omitempty"` - // Port configuration - Ports []Ports `json:"ports,omitempty"` - // Liveness probe - LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"` - // Readiness probe - ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"` - // Startup Probe - StartupProbe *corev1.Probe `json:"startupProbe,omitempty"` - // Workload monitoring specification - Monitoring *WorkloadMonitoring `json:"monitoring,omitempty"` - // Pod Disruption Budget may be used to specify the minimum number of available pods for this workload - PodDisruptionBudget *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"` - // Horizontal Pod Autoscaler may be used to specify the scaling behavior for this workload - HorizontalPodAutoscaler *HorizontalPodAutoscalerSpec `json:"horizontalPodAutoscaler,omitempty"` - // Stickiness configuration based on istio consistent hashing for the workload. When present, this is used to create a DestinationRule for the workload. - Stickiness *Stickiness `json:"stickiness,omitempty"` -} - -type Stickiness struct { - // Hash based stickiness configuration. - Hash *StickinessHash `json:"hash,omitempty"` -} - -// Loosely based on the options available for consistent hash load balancer in istio (https://istio.io/latest/docs/reference/config/networking/destination-rule/#ConsistentHashLB), but only include the options that make sense for our use case. -// +kubebuilder:validation:AtMostOneOf=httpHeaderName;httpCookie;useSourceIp;httpQueryParameterName -type StickinessHash struct { - // Hash based on a specific HTTP header. - HttpHeaderName string `json:"httpHeaderName,omitempty"` - // Hash based on HTTP cookie. - HttpCookie *HTTPCookie `json:"httpCookie,omitempty"` - // Hash based on the source IP address. - // This is applicable for both TCP and HTTP connections. - UseSourceIp bool `json:"useSourceIp,omitempty"` - // Hash based on a specific HTTP query parameter. - HttpQueryParameterName string `json:"httpQueryParameterName,omitempty"` -} - -type HTTPCookie struct { - // Name of the cookie. - Name string `json:"name,omitempty"` - // Path to set for the cookie. - Path string `json:"path,omitempty"` - // Lifetime of the cookie. If specified, a cookie with the TTL will be - // generated if the cookie is not present. If the TTL is present and zero, - // the generated cookie will be a session cookie. - Ttl *metav1.Duration `json:"ttl,omitempty"` - // Additional attributes for the cookie. They will be used when generating a new cookie. - Attributes []NameValue `json:"attributes,omitempty"` -} - -// HorizontalPodAutoscalerSpec wraps autoscalingv2.HorizontalPodAutoscalerSpec but gets rid of scaleTargetRef, -// as the operator always sets it to the deployment created for the workload. -type HorizontalPodAutoscalerSpec struct { - // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. - // +optional - MinReplicas *int32 `json:"minReplicas,omitempty"` - // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. - MaxReplicas int32 `json:"maxReplicas"` - // metrics contains the specifications for which to use to calculate the desired replica count. - // +optional - Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"` - // behavior configures the scaling behavior of the target in both Up and Down directions. - // +optional - Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"` -} - -// ServiceExposure specifies the details of the VirtualService to be exposed for `Service` type workload(s) -type ServiceExposure struct { - // Subdomain under which the service is exposed (used as the Key for identifying the VirtualService) - SubDomain string `json:"subDomain"` - // Routes specifies the routing configuration (http match) for the exposed service - Routes []Route `json:"routes"` -} - -// Routing configuration (http match) for the exposed service -type Route struct { - // Name of the workload (eventually a service to route requests to); must be a valid workload name (Deployment) - WorkloadName string `json:"workloadName"` - // Port number used for the service (must be present in the workload/service) - Port int32 `json:"port"` - // A unique routing path used (as a match/prefix) to route requests to the workload (when omitted, "/" would be used) - Path string `json:"path,omitempty"` -} - -// WorkloadMonitoring specifies the metrics related to the workload -type WorkloadMonitoring struct { - // DeletionRules specify the metrics conditions that need to be satisfied for the version to be deleted automatically. - // Either a set of metrics based rules can be specified, or a PromQL expression which evaluates to a boolean scalar. - DeletionRules *DeletionRules `json:"deletionRules,omitempty"` - // Configuration to be used to create ServiceMonitor for the workload service. - // If not specified, CAP Operator will not attempt to create a ServiceMonitor for the workload - ScrapeConfig *MonitoringConfig `json:"scrapeConfig,omitempty"` -} - -type MonitoringConfig struct { - // Interval at which Prometheus scrapes the metrics from the target. - ScrapeInterval Duration `json:"interval,omitempty"` - // Name of the port (specified on the workload) which will be used by Prometheus server to scrape metrics - WorkloadPort string `json:"port"` - // HTTP path from which to scrape for metrics. - Path string `json:"path,omitempty"` - // Timeout after which Prometheus considers the scrape to be failed. - Timeout Duration `json:"scrapeTimeout,omitempty"` -} - -// +kubebuilder:validation:ExactlyOneOf=metrics;expression -type DeletionRules struct { - Metrics []MetricRule `json:"metrics,omitempty"` - // A promQL expression that evaluates to a scalar boolean (1 or 0). - // Example: scalar(sum(avg_over_time(demo_metric{job="cav-demo-app-4-srv-svc",namespace="demo"}[2m]))) <= bool 0.1 - ScalarExpression *string `json:"expression,omitempty"` -} - -// MetricRule specifies a Prometheus metric and rule which represents a cleanup condition. Metrics of type Gauge and Counter are supported. -// -// Rule evaluation for Gauge type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as an average over the specified period. -// A sum of the calculated average from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -// Evaluation: `sum(avg_over_time({job=}[])) <= ` -// -// Rule evaluation for Counter type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as rate of increase over the specified period. -// The sum of the calculated rates from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -// Evaluation: `sum(rate({job=}[])) <= ` -type MetricRule struct { - // Prometheus metric. For example `http_request_count` - Name string `json:"name"` - // Type of Prometheus metric which can be either `Gauge` or `Counter` - // +kubebuilder:validation:Enum=Gauge;Counter - Type MetricType `json:"type"` - // Duration of time series data used for the rule evaluation - CalculationPeriod Duration `json:"calculationPeriod"` - // The threshold value which is compared against the calculated value. If calculated value is less than or equal to the threshold the rule condition is fulfilled. - // +kubebuilder:validation:Format=double - ThresholdValue string `json:"thresholdValue"` -} - -// Duration is a valid time duration that can be parsed by Prometheus -// Supported units: y, w, d, h, m, s, ms -// Examples: `30s`, `1m`, `1h20m15s`, `15d` -// +kubebuilder:validation:Pattern="^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$" -type Duration string - -// Type of Prometheus metric -type MetricType string - -const ( - // Prometheus Metric type Gauge - MetricTypeGauge MetricType = "Gauge" - // Prometheus Metric type Counter - MetricTypeCounter MetricType = "Counter" -) - -// Type of deployment -type DeploymentType string - -const ( - // CAP backend server deployment type - DeploymentCAP DeploymentType = "CAP" - // Application router deployment type - DeploymentRouter DeploymentType = "Router" - // Additional deployment type - DeploymentAdditional DeploymentType = "Additional" - // Service deployment type - DeploymentService DeploymentType = "Service" -) - -// JobDetails specifies the details of the Job -type JobDetails struct { - CommonDetails `json:",inline"` - // Type of Job - Type JobType `json:"type"` - // Specifies the number of retries before marking this job failed. - BackoffLimit *int32 `json:"backoffLimit,omitempty"` - // Specifies the time after which the job may be cleaned up. - TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` - // Specifies the duration in seconds for which the job may be continuously active. - ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` -} - -// Type of Job -type JobType string - -const ( - // job for deploying content or configuration to (BTP) services - JobContent JobType = "Content" - // job for tenant operation e.g. deploying relevant data to a tenant - JobTenantOperation JobType = "TenantOperation" - // job for custom tenant operation e.g. pre/post hooks for a tenant operation - JobCustomTenantOperation JobType = "CustomTenantOperation" -) - -// CommonDetails specifies the common details of the Container/Pod that may be relevant for both Deployments and Jobs -type CommonDetails struct { - // Image info for the container - Image string `json:"image"` - // Pull policy for the container image - ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` - // Entrypoint array for the container - Command []string `json:"command,omitempty"` - // Arguments to the entrypoint - Args []string `json:"args,omitempty"` - // Environment Config for the Container - Env []corev1.EnvVar `json:"env,omitempty"` - // Volume Configuration for the Pod - Volumes []corev1.Volume `json:"volumes,omitempty"` - // Volume Mount Configuration for the Container - VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` - // Name of the ServiceAccount to use to run the Pod - ServiceAccountName string `json:"serviceAccountName,omitempty"` - // Resources - Resources corev1.ResourceRequirements `json:"resources,omitempty"` - // SecurityContext for the Container - SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` - // SecurityContext for the Pod - PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"` - // The name of the node to which the Pod should be assigned to. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename - NodeName string `json:"nodeName,omitempty"` - // The label selectors using which node for the Pod would be determined. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector - NodeSelector map[string]string `json:"nodeSelector,omitempty"` - // Priority class name mapping used to prioritize and schedule the Pod. See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass - PriorityClassName string `json:"priorityClassName,omitempty"` - // Affinity/anti-affinity used to provide more constraints for node selection. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity - Affinity *corev1.Affinity `json:"affinity,omitempty"` - // Tolerations used to schedule the Pod. See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ - Tolerations []corev1.Toleration `json:"tolerations,omitempty"` - // The Topology spread constraints used to control how Pods are spread across regions, zones, nodes etc. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#pod-topology-spread-constraints - // Note: As of now, this field only makes sense for Deployment workloads. If/once we support parallel Job workloads, this field may be relevant for Jobs as well. - TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` - // List of containers executed before the main container is started - InitContainers []corev1.Container `json:"initContainers,omitempty"` - // Restart policy for the Pod. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy - RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty"` - // Optional duration in seconds the pod needs to terminate gracefully. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination-flow - TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` - // Optional actions that the management system should take in response to container lifecycle events. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination - Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"` -} - -// Configuration of Service Ports for the deployment -type Ports struct { - // App protocol used by the service port - AppProtocol *string `json:"appProtocol,omitempty"` - // Name of the service port - Name string `json:"name"` - // +kubebuilder:validation:Enum=Application;Cluster - // Network Policy of the service port - NetworkPolicy PortNetworkPolicyType `json:"networkPolicy,omitempty"` - // The port number used for container and the corresponding service (if any) - Port int32 `json:"port"` - // Destination name which may be used by the Router deployment to reach this backend service - RouterDestinationName string `json:"routerDestinationName,omitempty"` -} - -// Type of NetworkPolicy for the port -type PortNetworkPolicyType string - -const ( - // Expose the port for the current application versions pod(s) scope - PortNetworkPolicyTypeApplication PortNetworkPolicyType = "Application" - // Expose the port for any pod(s) in the overall cluster scope - PortNetworkPolicyTypeCluster PortNetworkPolicyType = "Cluster" -) - -// Configuration used to sequence tenant related jobs for a given tenant operation -type TenantOperations struct { - // Tenant provisioning steps - Provisioning []TenantOperationWorkloadReference `json:"provisioning,omitempty"` - // Tenant upgrade steps - Upgrade []TenantOperationWorkloadReference `json:"upgrade,omitempty"` - // Tenant deprovisioning steps - Deprovisioning []TenantOperationWorkloadReference `json:"deprovisioning,omitempty"` -} - -type TenantOperationWorkloadReference struct { - // Reference to a specified workload of type 'TenantOperation' or 'CustomTenantOperation' - WorkloadName string `json:"workloadName"` - // Indicates whether to proceed with remaining operation steps in case of failure. Relevant only for 'CustomTenantOperation' - ContinueOnFailure bool `json:"continueOnFailure,omitempty"` -} - // +kubebuilder:resource:shortName=cat // +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" // +kubebuilder:printcolumn:name="Subdomain",type="string",JSONPath=".spec.subDomain" @@ -585,19 +143,21 @@ type TenantOperationWorkloadReference struct { // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenant defines the schema for captenants API type CAPTenant struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // CAPTenant spec - Spec CAPTenantSpec `json:"spec"` + Spec v1alpha2.CAPTenantSpec `json:"spec"` // +kubebuilder:validation:Optional // CAPTenant status - Status CAPTenantStatus `json:"status"` + Status v1alpha2.CAPTenantStatus `json:"status"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantList contains a list of CAPTenant type CAPTenantList struct { metav1.TypeMeta `json:",inline"` @@ -605,79 +165,30 @@ type CAPTenantList struct { Items []CAPTenant `json:"items"` } -type CAPTenantStatus struct { - GenericStatus `json:",inline"` - // +kubebuilder:validation:Enum="";Ready;Provisioning;Upgrading;Deleting;ProvisioningError;UpgradeError - // State of CAPTenant - State CAPTenantState `json:"state"` - // Specifies the current version of the tenant after provisioning or upgrade - CurrentCAPApplicationVersionInstance string `json:"currentCAPApplicationVersionInstance,omitempty"` - // Previous versions of the tenant (first to last) - PreviousCAPApplicationVersions []string `json:"previousCAPApplicationVersions,omitempty"` - // The last time a full reconciliation was completed - LastFullReconciliationTime metav1.Time `json:"lastFullReconciliationTime,omitempty"` -} - -type CAPTenantState string - -const ( - // Tenant is being provisioned - CAPTenantStateProvisioning CAPTenantState = "Provisioning" - // Tenant provisioning ended in error - CAPTenantStateProvisioningError CAPTenantState = "ProvisioningError" - // Tenant is being upgraded - CAPTenantStateUpgrading CAPTenantState = "Upgrading" - // Tenant upgrade failed - CAPTenantStateUpgradeError CAPTenantState = "UpgradeError" - // Deletion has been triggered - CAPTenantStateDeleting CAPTenantState = "Deleting" - // Tenant has been provisioned/upgraded and is now ready for use - CAPTenantStateReady CAPTenantState = "Ready" -) - -// CAPTenantSpec defines the desired state of the CAPTenant -type CAPTenantSpec struct { - // Denotes to which CAPApplication the current tenant belongs - CAPApplicationInstance string `json:"capApplicationInstance"` - // Details of consumer sub-account subscribing to the application - BTPTenantIdentification `json:",inline"` - // Semver that is used to determine the relevant CAPApplicationVersion that a CAPTenant can be upgraded to (i.e. if it is not already on that version) - Version string `json:"version,omitempty"` - // +kubebuilder:validation:Enum=always;never - // Denotes whether a CAPTenant can be upgraded. One of ('always', 'never') - VersionUpgradeStrategy VersionUpgradeStrategyType `json:"versionUpgradeStrategy,omitempty"` -} - -type VersionUpgradeStrategyType string - -const ( - // Always (default) - VersionUpgradeStrategyTypeAlways VersionUpgradeStrategyType = "always" - // Never - VersionUpgradeStrategyTypeNever VersionUpgradeStrategyType = "never" -) - // +kubebuilder:resource:shortName=ctop // +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Operation",type="string",JSONPath=".spec.operation" // +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 +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantOperation defines the schema for captenantoperations API type CAPTenantOperation struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // CAPTenantOperation spec - Spec CAPTenantOperationSpec `json:"spec"` + Spec v1alpha2.CAPTenantOperationSpec `json:"spec"` // +kubebuilder:validation:Optional // CAPTenantOperation status - Status CAPTenantOperationStatus `json:"status"` + Status v1alpha2.CAPTenantOperationStatus `json:"status"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantOperationList contains a list of CAPTenantOperation type CAPTenantOperationList struct { metav1.TypeMeta `json:",inline"` @@ -685,78 +196,24 @@ type CAPTenantOperationList struct { Items []CAPTenantOperation `json:"items"` } -type CAPTenantOperationSpec struct { - // +kubebuilder:validation:Enum=provisioning;deprovisioning;upgrade - // Scope of the tenant lifecycle operation. One of 'provisioning', 'deprovisioning' or 'upgrade' - Operation CAPTenantOperationType `json:"operation"` - // BTP sub-account (tenant) for which request is created - BTPTenantIdentification `json:",inline"` - // Reference to CAPApplicationVersion for executing the operation - CAPApplicationVersionInstance string `json:"capApplicationVersionInstance"` - // Steps (jobs) to be executed for the operation to complete - Steps []CAPTenantOperationStep `json:"steps"` -} - -type CAPTenantOperationStep struct { - // Name of the workload from the referenced CAPApplicationVersion - Name string `json:"name"` - // +kubebuilder:validation:Enum=CustomTenantOperation;TenantOperation - // Type of job. One of 'TenantOperation' or 'CustomTenantOperation' - Type JobType `json:"type"` - // Indicates whether the operation can continue in case of step failure. Relevant only for type 'CustomTenantOperation' - ContinueOnFailure bool `json:"continueOnFailure,omitempty"` -} - -type CAPTenantOperationStatus struct { - GenericStatus `json:",inline"` - // +kubebuilder:validation:Enum="";Processing;Completed;Failed;Deleting - // State of CAPTenantOperation - State CAPTenantOperationState `json:"state"` - // Current step being processed from the sequence of specified steps - CurrentStep *uint32 `json:"currentStep,omitempty"` - // Name of the job being executed for the current step - ActiveJob *string `json:"activeJob,omitempty"` -} - -type CAPTenantOperationState string - -const ( - // CAPTenantOperation is being processed - CAPTenantOperationStateProcessing CAPTenantOperationState = "Processing" - // CAPTenantOperation steps have failed - CAPTenantOperationStateFailed CAPTenantOperationState = "Failed" - // CAPTenantOperation steps completed - CAPTenantOperationStateCompleted CAPTenantOperationState = "Completed" - // CAPTenantOperation deletion has been triggered - CAPTenantOperationStateDeleting CAPTenantOperationState = "Deleting" -) - -type CAPTenantOperationType string - -const ( - // Provision tenant - CAPTenantOperationTypeProvisioning CAPTenantOperationType = "provisioning" - // Deprovision tenant - CAPTenantOperationTypeDeprovisioning CAPTenantOperationType = "deprovisioning" - // Upgrade tenant - CAPTenantOperationTypeUpgrade CAPTenantOperationType = "upgrade" -) - // +kubebuilder:resource:shortName=ctout +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantOutput is the schema for captenantoutputs API type CAPTenantOutput struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // CAPTenantOutput spec - Spec CAPTenantOutputSpec `json:"spec"` + Spec v1alpha2.CAPTenantOutputSpec `json:"spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantOutputList contains a list of CAPTenantOutput type CAPTenantOutputList struct { metav1.TypeMeta `json:",inline"` @@ -764,32 +221,30 @@ type CAPTenantOutputList struct { Items []CAPTenantOutput `json:"items"` } -type CAPTenantOutputSpec struct { - // +kubebuilder:validation:nullable - SubscriptionCallbackData string `json:"subscriptionCallbackData,omitempty"` -} - // +kubebuilder:resource:shortName=dom // +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Domain",type="string",JSONPath=".spec.domain" // +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 +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // Domain is the schema for domains API type Domain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // Domains spec - Spec DomainSpec `json:"spec"` + Spec v1alpha2.DomainSpec `json:"spec"` // +kubebuilder:validation:Optional // Domain status - Status DomainStatus `json:"status"` + Status v1alpha2.DomainStatus `json:"status"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // DomainList contains a list of Domain type DomainList struct { metav1.TypeMeta `json:",inline"` @@ -797,117 +252,30 @@ type DomainList struct { Items []Domain `json:"items"` } -type DomainSpec struct { - // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ - // Domain used by an application - Domain string `json:"domain"` - // Selector is the set of labels used to select the ingress pods handling the domain - IngressSelector map[string]string `json:"ingressSelector"` - // +kubebuilder:default:=Simple - // TLS mode for the generated (Istio) Gateway resource. Set this to Mutual when using mTLS with an external gateway. - TLSMode TLSMode `json:"tlsMode"` - // +kubebuilder:default:=None - // DNS mode controls the creation of DNS entries related to the domain - DNSMode DNSMode `json:"dnsMode"` - // DNS templates allows usage of go templates for generating DNS entries when [DNSMode] is set to `Custom` - // +kubebuilder:validation:MaxItems=10 - DNSTemplates []DNSTemplate `json:"dnsTemplates,omitempty"` - // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ - // DNS Target for traffic to this domain - DNSTarget string `json:"dnsTarget,omitempty"` - // Certificate configuration - CertConfig *CertConfig `json:"certConfig,omitempty"` -} - -// DNSTemplate supports the creation of DNS entries using go templates See: https://pkg.go.dev/text/template -type DNSTemplate struct { - // Domain name for which a DNS record will be created - Name string `json:"name"` - // Target of the DNS record - Target string `json:"target"` -} - -type CertConfig struct { - // Used to specify additional CA certificate that may be used for verifying client certificates in Mutual TLS mode - AdditionalCACertificate string `json:"additionalCACertificate,omitempty"` - // CertManager specific configuration for the certificate to be created for the domain - CertManager *CertManager `json:"certManager,omitempty"` -} - -type CertManager struct { - // Issuer configuration for the certificate - IssuerRef certManagermetav1.IssuerReference `json:"issuerRef"` -} - -// +kubebuilder:validation:Enum=Simple;Mutual;OptionalMutual -type TLSMode string - -const ( - // Simple TLS Mode (Default) - TlsModeSimple TLSMode = "Simple" - // Mutual TLS Mode - TlsModeMutual TLSMode = "Mutual" - // Optional Mutual TLS Mode - TlsModeOptionalMutual TLSMode = "OptionalMutual" -) - -// +kubebuilder:validation:Enum=None;Wildcard;Subdomain;Custom -type DNSMode string - -const ( - // No DNS entries will be created (Default) - DnsModeNone DNSMode = "None" - // Wildcard DNS entry will be created - DnsModeWildcard DNSMode = "Wildcard" - // A DNS entry will be created for each subdomain specified by the applications using this domain - DnsModeSubdomain DNSMode = "Subdomain" - // A DNS entry will be created according to configuration in `[DNSTemplate]` - DnsModeCustom DNSMode = "Custom" -) - -type DomainStatus struct { - GenericStatus `json:",inline"` - // State of the Domain - State DomainState `json:"state"` - // Effective DNS Target identified for this domain - DnsTarget string `json:"dnsTarget,omitempty"` - // Gateway name used for the domain - GatewayName string `json:"gatewayName,omitempty"` - // domain observed during last reconciliation - ObservedDomain string `json:"observedDomain,omitempty"` -} - -// +kubebuilder:validation:Enum="";Ready;Error;Processing;Deleting -type DomainState string - -const ( - DomainStateProcessing DomainState = "Processing" - DomainStateError DomainState = "Error" - DomainStateDeleting DomainState = "Deleting" - DomainStateReady DomainState = "Ready" -) - // +kubebuilder:resource:scope=Cluster,shortName=cdom // +kubebuilder:subresource:status +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Domain",type="string",JSONPath=".spec.domain" // +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 +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // ClusterDomain is the schema for clusterdomains API type ClusterDomain struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` // ClusterDomains spec - Spec DomainSpec `json:"spec"` + Spec v1alpha2.DomainSpec `json:"spec"` // +kubebuilder:validation:Optional // ClusterDomain status - Status DomainStatus `json:"status"` + Status v1alpha2.DomainStatus `json:"status"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // ClusterDomainList contains a list of ClusterDomain type ClusterDomainList struct { metav1.TypeMeta `json:",inline"` 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 877b1244..24ff735c 100644 --- a/pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/sme.sap.com/v1alpha1/zz_generated.deepcopy.go @@ -11,10 +11,6 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( - v2 "k8s.io/api/autoscaling/v2" - v1 "k8s.io/api/core/v1" - policyv1 "k8s.io/api/policy/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -44,45 +40,6 @@ func (in *ApplicationDomains) DeepCopy() *ApplicationDomains { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BTP) DeepCopyInto(out *BTP) { - *out = *in - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = make([]ServiceInfo, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BTP. -func (in *BTP) DeepCopy() *BTP { - if in == nil { - return nil - } - out := new(BTP) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BTPTenantIdentification) DeepCopyInto(out *BTPTenantIdentification) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BTPTenantIdentification. -func (in *BTPTenantIdentification) DeepCopy() *BTPTenantIdentification { - if in == nil { - return nil - } - out := new(BTPTenantIdentification) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAPApplication) DeepCopyInto(out *CAPApplication) { *out = *in @@ -147,18 +104,8 @@ 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([]DomainRef, len(*in)) - copy(*out, *in) - } + in.CAPApplicationSpec.DeepCopyInto(&out.CAPApplicationSpec) in.Domains.DeepCopyInto(&out.Domains) - if in.Provider != nil { - in, out := &in.Provider, &out.Provider - *out = new(BTPTenantIdentification) - **out = **in - } - in.BTP.DeepCopyInto(&out.BTP) return } @@ -172,34 +119,6 @@ func (in *CAPApplicationSpec) DeepCopy() *CAPApplicationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPApplicationStatus) DeepCopyInto(out *CAPApplicationStatus) { - *out = *in - in.GenericStatus.DeepCopyInto(&out.GenericStatus) - if in.ServicesOnly != nil { - in, out := &in.ServicesOnly, &out.ServicesOnly - *out = new(bool) - **out = **in - } - in.LastFullReconciliationTime.DeepCopyInto(&out.LastFullReconciliationTime) - if in.ObservedSubdomains != nil { - in, out := &in.ObservedSubdomains, &out.ObservedSubdomains - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationStatus. -func (in *CAPApplicationStatus) DeepCopy() *CAPApplicationStatus { - if in == nil { - return nil - } - out := new(CAPApplicationStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAPApplicationVersion) DeepCopyInto(out *CAPApplicationVersion) { *out = *in @@ -261,73 +180,6 @@ func (in *CAPApplicationVersionList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPApplicationVersionSpec) DeepCopyInto(out *CAPApplicationVersionSpec) { - *out = *in - if in.RegistrySecrets != nil { - in, out := &in.RegistrySecrets, &out.RegistrySecrets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Workloads != nil { - in, out := &in.Workloads, &out.Workloads - *out = make([]WorkloadDetails, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.TenantOperations != nil { - in, out := &in.TenantOperations, &out.TenantOperations - *out = new(TenantOperations) - (*in).DeepCopyInto(*out) - } - if in.ContentJobs != nil { - in, out := &in.ContentJobs, &out.ContentJobs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ServiceExposures != nil { - in, out := &in.ServiceExposures, &out.ServiceExposures - *out = make([]ServiceExposure, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationVersionSpec. -func (in *CAPApplicationVersionSpec) DeepCopy() *CAPApplicationVersionSpec { - if in == nil { - return nil - } - out := new(CAPApplicationVersionSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPApplicationVersionStatus) DeepCopyInto(out *CAPApplicationVersionStatus) { - *out = *in - in.GenericStatus.DeepCopyInto(&out.GenericStatus) - if in.FinishedJobs != nil { - in, out := &in.FinishedJobs, &out.FinishedJobs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationVersionStatus. -func (in *CAPApplicationVersionStatus) DeepCopy() *CAPApplicationVersionStatus { - if in == nil { - return nil - } - out := new(CAPApplicationVersionStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAPTenant) DeepCopyInto(out *CAPTenant) { *out = *in @@ -450,71 +302,6 @@ func (in *CAPTenantOperationList) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPTenantOperationSpec) DeepCopyInto(out *CAPTenantOperationSpec) { - *out = *in - out.BTPTenantIdentification = in.BTPTenantIdentification - if in.Steps != nil { - in, out := &in.Steps, &out.Steps - *out = make([]CAPTenantOperationStep, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationSpec. -func (in *CAPTenantOperationSpec) DeepCopy() *CAPTenantOperationSpec { - if in == nil { - return nil - } - out := new(CAPTenantOperationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPTenantOperationStatus) DeepCopyInto(out *CAPTenantOperationStatus) { - *out = *in - in.GenericStatus.DeepCopyInto(&out.GenericStatus) - if in.CurrentStep != nil { - in, out := &in.CurrentStep, &out.CurrentStep - *out = new(uint32) - **out = **in - } - if in.ActiveJob != nil { - in, out := &in.ActiveJob, &out.ActiveJob - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationStatus. -func (in *CAPTenantOperationStatus) DeepCopy() *CAPTenantOperationStatus { - if in == nil { - return nil - } - out := new(CAPTenantOperationStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPTenantOperationStep) DeepCopyInto(out *CAPTenantOperationStep) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationStep. -func (in *CAPTenantOperationStep) DeepCopy() *CAPTenantOperationStep { - if in == nil { - return nil - } - out := new(CAPTenantOperationStep) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CAPTenantOutput) DeepCopyInto(out *CAPTenantOutput) { *out = *in @@ -576,101 +363,68 @@ func (in *CAPTenantOutputList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPTenantOutputSpec) DeepCopyInto(out *CAPTenantOutputSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOutputSpec. -func (in *CAPTenantOutputSpec) DeepCopy() *CAPTenantOutputSpec { - if in == nil { - return nil - } - out := new(CAPTenantOutputSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPTenantSpec) DeepCopyInto(out *CAPTenantSpec) { +func (in *ClusterDomain) DeepCopyInto(out *ClusterDomain) { *out = *in - out.BTPTenantIdentification = in.BTPTenantIdentification + 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 CAPTenantSpec. -func (in *CAPTenantSpec) DeepCopy() *CAPTenantSpec { +// 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(CAPTenantSpec) + out := new(ClusterDomain) in.DeepCopyInto(out) return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CAPTenantStatus) DeepCopyInto(out *CAPTenantStatus) { - *out = *in - in.GenericStatus.DeepCopyInto(&out.GenericStatus) - if in.PreviousCAPApplicationVersions != nil { - in, out := &in.PreviousCAPApplicationVersions, &out.PreviousCAPApplicationVersions - *out = make([]string, len(*in)) - copy(*out, *in) - } - in.LastFullReconciliationTime.DeepCopyInto(&out.LastFullReconciliationTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantStatus. -func (in *CAPTenantStatus) DeepCopy() *CAPTenantStatus { - if in == nil { - return nil +// 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 } - out := new(CAPTenantStatus) - in.DeepCopyInto(out) - return out + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertConfig) DeepCopyInto(out *CertConfig) { +func (in *ClusterDomainList) DeepCopyInto(out *ClusterDomainList) { *out = *in - if in.CertManager != nil { - in, out := &in.CertManager, &out.CertManager - *out = new(CertManager) - **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 CertConfig. -func (in *CertConfig) DeepCopy() *CertConfig { +// 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(CertConfig) + out := new(ClusterDomainList) in.DeepCopyInto(out) return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CertManager) DeepCopyInto(out *CertManager) { - *out = *in - out.IssuerRef = in.IssuerRef - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertManager. -func (in *CertManager) DeepCopy() *CertManager { - if in == nil { - return nil +// 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 } - out := new(CertManager) - in.DeepCopyInto(out) - return out + return nil } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterDomain) DeepCopyInto(out *ClusterDomain) { +func (in *Domain) DeepCopyInto(out *Domain) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -679,18 +433,18 @@ func (in *ClusterDomain) DeepCopyInto(out *ClusterDomain) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDomain. -func (in *ClusterDomain) DeepCopy() *ClusterDomain { +// 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(ClusterDomain) + out := new(Domain) 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 { +func (in *Domain) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -698,13 +452,13 @@ func (in *ClusterDomain) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterDomainList) DeepCopyInto(out *ClusterDomainList) { +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([]ClusterDomain, len(*in)) + *out = make([]Domain, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -712,18 +466,18 @@ func (in *ClusterDomainList) DeepCopyInto(out *ClusterDomainList) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDomainList. -func (in *ClusterDomainList) DeepCopy() *ClusterDomainList { +// 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(ClusterDomainList) + out := new(DomainList) 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 { +func (in *DomainList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -731,493 +485,13 @@ func (in *ClusterDomainList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CommonDetails) DeepCopyInto(out *CommonDetails) { +func (in *NameValue) DeepCopyInto(out *NameValue) { *out = *in - if in.Command != nil { - in, out := &in.Command, &out.Command - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Args != nil { - in, out := &in.Args, &out.Args - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Env != nil { - in, out := &in.Env, &out.Env - *out = make([]v1.EnvVar, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]v1.Volume, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.VolumeMounts != nil { - in, out := &in.VolumeMounts, &out.VolumeMounts - *out = make([]v1.VolumeMount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.Resources.DeepCopyInto(&out.Resources) - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(v1.SecurityContext) - (*in).DeepCopyInto(*out) - } - if in.PodSecurityContext != nil { - in, out := &in.PodSecurityContext, &out.PodSecurityContext - *out = new(v1.PodSecurityContext) - (*in).DeepCopyInto(*out) - } - if in.NodeSelector != nil { - in, out := &in.NodeSelector, &out.NodeSelector - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Affinity != nil { - in, out := &in.Affinity, &out.Affinity - *out = new(v1.Affinity) - (*in).DeepCopyInto(*out) - } - if in.Tolerations != nil { - in, out := &in.Tolerations, &out.Tolerations - *out = make([]v1.Toleration, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.TopologySpreadConstraints != nil { - in, out := &in.TopologySpreadConstraints, &out.TopologySpreadConstraints - *out = make([]v1.TopologySpreadConstraint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.InitContainers != nil { - in, out := &in.InitContainers, &out.InitContainers - *out = make([]v1.Container, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.TerminationGracePeriodSeconds != nil { - in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds - *out = new(int64) - **out = **in - } - if in.Lifecycle != nil { - in, out := &in.Lifecycle, &out.Lifecycle - *out = new(v1.Lifecycle) - (*in).DeepCopyInto(*out) - } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonDetails. -func (in *CommonDetails) DeepCopy() *CommonDetails { - if in == nil { - return nil - } - out := new(CommonDetails) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DNSTemplate) DeepCopyInto(out *DNSTemplate) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSTemplate. -func (in *DNSTemplate) DeepCopy() *DNSTemplate { - if in == nil { - return nil - } - out := new(DNSTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DeletionRules) DeepCopyInto(out *DeletionRules) { - *out = *in - if in.Metrics != nil { - in, out := &in.Metrics, &out.Metrics - *out = make([]MetricRule, len(*in)) - copy(*out, *in) - } - if in.ScalarExpression != nil { - in, out := &in.ScalarExpression, &out.ScalarExpression - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeletionRules. -func (in *DeletionRules) DeepCopy() *DeletionRules { - if in == nil { - return nil - } - out := new(DeletionRules) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DeploymentDetails) DeepCopyInto(out *DeploymentDetails) { - *out = *in - in.CommonDetails.DeepCopyInto(&out.CommonDetails) - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - if in.Ports != nil { - in, out := &in.Ports, &out.Ports - *out = make([]Ports, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.LivenessProbe != nil { - in, out := &in.LivenessProbe, &out.LivenessProbe - *out = new(v1.Probe) - (*in).DeepCopyInto(*out) - } - if in.ReadinessProbe != nil { - in, out := &in.ReadinessProbe, &out.ReadinessProbe - *out = new(v1.Probe) - (*in).DeepCopyInto(*out) - } - if in.StartupProbe != nil { - in, out := &in.StartupProbe, &out.StartupProbe - *out = new(v1.Probe) - (*in).DeepCopyInto(*out) - } - if in.Monitoring != nil { - in, out := &in.Monitoring, &out.Monitoring - *out = new(WorkloadMonitoring) - (*in).DeepCopyInto(*out) - } - if in.PodDisruptionBudget != nil { - in, out := &in.PodDisruptionBudget, &out.PodDisruptionBudget - *out = new(policyv1.PodDisruptionBudgetSpec) - (*in).DeepCopyInto(*out) - } - if in.HorizontalPodAutoscaler != nil { - in, out := &in.HorizontalPodAutoscaler, &out.HorizontalPodAutoscaler - *out = new(HorizontalPodAutoscalerSpec) - (*in).DeepCopyInto(*out) - } - if in.Stickiness != nil { - in, out := &in.Stickiness, &out.Stickiness - *out = new(Stickiness) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentDetails. -func (in *DeploymentDetails) DeepCopy() *DeploymentDetails { - if in == nil { - return nil - } - out := new(DeploymentDetails) - in.DeepCopyInto(out) - 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 *DomainRef) DeepCopyInto(out *DomainRef) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainRef. -func (in *DomainRef) DeepCopy() *DomainRef { - if in == nil { - return nil - } - out := new(DomainRef) - 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 - } - } - if in.DNSTemplates != nil { - in, out := &in.DNSTemplates, &out.DNSTemplates - *out = make([]DNSTemplate, len(*in)) - copy(*out, *in) - } - if in.CertConfig != nil { - in, out := &in.CertConfig, &out.CertConfig - *out = new(CertConfig) - (*in).DeepCopyInto(*out) - } - 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 - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]metav1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericStatus. -func (in *GenericStatus) DeepCopy() *GenericStatus { - if in == nil { - return nil - } - out := new(GenericStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HTTPCookie) DeepCopyInto(out *HTTPCookie) { - *out = *in - if in.Ttl != nil { - in, out := &in.Ttl, &out.Ttl - *out = new(metav1.Duration) - **out = **in - } - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make([]NameValue, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPCookie. -func (in *HTTPCookie) DeepCopy() *HTTPCookie { - if in == nil { - return nil - } - out := new(HTTPCookie) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HorizontalPodAutoscalerSpec) DeepCopyInto(out *HorizontalPodAutoscalerSpec) { - *out = *in - if in.MinReplicas != nil { - in, out := &in.MinReplicas, &out.MinReplicas - *out = new(int32) - **out = **in - } - if in.Metrics != nil { - in, out := &in.Metrics, &out.Metrics - *out = make([]v2.MetricSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Behavior != nil { - in, out := &in.Behavior, &out.Behavior - *out = new(v2.HorizontalPodAutoscalerBehavior) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerSpec. -func (in *HorizontalPodAutoscalerSpec) DeepCopy() *HorizontalPodAutoscalerSpec { - if in == nil { - return nil - } - out := new(HorizontalPodAutoscalerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *JobDetails) DeepCopyInto(out *JobDetails) { - *out = *in - in.CommonDetails.DeepCopyInto(&out.CommonDetails) - if in.BackoffLimit != nil { - in, out := &in.BackoffLimit, &out.BackoffLimit - *out = new(int32) - **out = **in - } - if in.TTLSecondsAfterFinished != nil { - in, out := &in.TTLSecondsAfterFinished, &out.TTLSecondsAfterFinished - *out = new(int32) - **out = **in - } - if in.ActiveDeadlineSeconds != nil { - in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds - *out = new(int64) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobDetails. -func (in *JobDetails) DeepCopy() *JobDetails { - if in == nil { - return nil - } - out := new(JobDetails) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MetricRule) DeepCopyInto(out *MetricRule) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricRule. -func (in *MetricRule) DeepCopy() *MetricRule { - if in == nil { - return nil - } - out := new(MetricRule) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MonitoringConfig) DeepCopyInto(out *MonitoringConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringConfig. -func (in *MonitoringConfig) DeepCopy() *MonitoringConfig { - if in == nil { - return nil - } - out := new(MonitoringConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NameValue) DeepCopyInto(out *NameValue) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NameValue. -func (in *NameValue) DeepCopy() *NameValue { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NameValue. +func (in *NameValue) DeepCopy() *NameValue { if in == nil { return nil } @@ -1225,242 +499,3 @@ func (in *NameValue) DeepCopy() *NameValue { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Ports) DeepCopyInto(out *Ports) { - *out = *in - if in.AppProtocol != nil { - in, out := &in.AppProtocol, &out.AppProtocol - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ports. -func (in *Ports) DeepCopy() *Ports { - if in == nil { - return nil - } - out := new(Ports) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Route) DeepCopyInto(out *Route) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route. -func (in *Route) DeepCopy() *Route { - if in == nil { - return nil - } - out := new(Route) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceExposure) DeepCopyInto(out *ServiceExposure) { - *out = *in - if in.Routes != nil { - in, out := &in.Routes, &out.Routes - *out = make([]Route, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExposure. -func (in *ServiceExposure) DeepCopy() *ServiceExposure { - if in == nil { - return nil - } - out := new(ServiceExposure) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ServiceInfo) DeepCopyInto(out *ServiceInfo) { - *out = *in - if in.SubscriptionDependency != nil { - in, out := &in.SubscriptionDependency, &out.SubscriptionDependency - *out = new(SubscriptionDependency) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInfo. -func (in *ServiceInfo) DeepCopy() *ServiceInfo { - if in == nil { - return nil - } - out := new(ServiceInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Stickiness) DeepCopyInto(out *Stickiness) { - *out = *in - if in.Hash != nil { - in, out := &in.Hash, &out.Hash - *out = new(StickinessHash) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stickiness. -func (in *Stickiness) DeepCopy() *Stickiness { - if in == nil { - return nil - } - out := new(Stickiness) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StickinessHash) DeepCopyInto(out *StickinessHash) { - *out = *in - if in.HttpCookie != nil { - in, out := &in.HttpCookie, &out.HttpCookie - *out = new(HTTPCookie) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StickinessHash. -func (in *StickinessHash) DeepCopy() *StickinessHash { - if in == nil { - return nil - } - out := new(StickinessHash) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TenantOperationWorkloadReference) DeepCopyInto(out *TenantOperationWorkloadReference) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantOperationWorkloadReference. -func (in *TenantOperationWorkloadReference) DeepCopy() *TenantOperationWorkloadReference { - if in == nil { - return nil - } - out := new(TenantOperationWorkloadReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TenantOperations) DeepCopyInto(out *TenantOperations) { - *out = *in - if in.Provisioning != nil { - in, out := &in.Provisioning, &out.Provisioning - *out = make([]TenantOperationWorkloadReference, len(*in)) - copy(*out, *in) - } - if in.Upgrade != nil { - in, out := &in.Upgrade, &out.Upgrade - *out = make([]TenantOperationWorkloadReference, len(*in)) - copy(*out, *in) - } - if in.Deprovisioning != nil { - in, out := &in.Deprovisioning, &out.Deprovisioning - *out = make([]TenantOperationWorkloadReference, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantOperations. -func (in *TenantOperations) DeepCopy() *TenantOperations { - if in == nil { - return nil - } - out := new(TenantOperations) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkloadDetails) DeepCopyInto(out *WorkloadDetails) { - *out = *in - if in.ConsumedBTPServices != nil { - in, out := &in.ConsumedBTPServices, &out.ConsumedBTPServices - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.DeploymentDefinition != nil { - in, out := &in.DeploymentDefinition, &out.DeploymentDefinition - *out = new(DeploymentDetails) - (*in).DeepCopyInto(*out) - } - if in.JobDefinition != nil { - in, out := &in.JobDefinition, &out.JobDefinition - *out = new(JobDetails) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadDetails. -func (in *WorkloadDetails) DeepCopy() *WorkloadDetails { - if in == nil { - return nil - } - out := new(WorkloadDetails) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkloadMonitoring) DeepCopyInto(out *WorkloadMonitoring) { - *out = *in - if in.DeletionRules != nil { - in, out := &in.DeletionRules, &out.DeletionRules - *out = new(DeletionRules) - (*in).DeepCopyInto(*out) - } - if in.ScrapeConfig != nil { - in, out := &in.ScrapeConfig, &out.ScrapeConfig - *out = new(MonitoringConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadMonitoring. -func (in *WorkloadMonitoring) DeepCopy() *WorkloadMonitoring { - if in == nil { - return nil - } - out := new(WorkloadMonitoring) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/apis/sme.sap.com/v1alpha2/doc.go b/pkg/apis/sme.sap.com/v1alpha2/doc.go new file mode 100644 index 00000000..3a0539f8 --- /dev/null +++ b/pkg/apis/sme.sap.com/v1alpha2/doc.go @@ -0,0 +1,9 @@ +// +k8s:deepcopy-gen=package +// +groupName=sme.sap.com + +/* +SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +package v1alpha2 diff --git a/pkg/apis/sme.sap.com/v1alpha2/register.go b/pkg/apis/sme.sap.com/v1alpha2/register.go new file mode 100644 index 00000000..953338e6 --- /dev/null +++ b/pkg/apis/sme.sap.com/v1alpha2/register.go @@ -0,0 +1,73 @@ +/* +SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +package v1alpha2 + +import ( + metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: Group, Version: Version} + +var ( + // SchemeBuilder initializes a scheme builder + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a global function that registers this API group & version to a scheme + AddToScheme = SchemeBuilder.AddToScheme +) + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +// Adds the list of known types to the given scheme +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes( + SchemeGroupVersion, + &CAPApplication{}, + &CAPApplicationList{}, + ) + scheme.AddKnownTypes( + SchemeGroupVersion, + &CAPApplicationVersion{}, + &CAPApplicationVersionList{}, + ) + scheme.AddKnownTypes( + SchemeGroupVersion, + &CAPTenant{}, + &CAPTenantList{}, + ) + scheme.AddKnownTypes( + SchemeGroupVersion, + &CAPTenantOperation{}, + &CAPTenantOperationList{}, + ) + scheme.AddKnownTypes( + SchemeGroupVersion, + &CAPTenantOutput{}, + &CAPTenantOutputList{}, + ) + scheme.AddKnownTypes( + SchemeGroupVersion, + &Domain{}, + &DomainList{}, + ) + scheme.AddKnownTypes( + SchemeGroupVersion, + &ClusterDomain{}, + &ClusterDomainList{}, + ) + metaV1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/pkg/apis/sme.sap.com/v1alpha2/types.go b/pkg/apis/sme.sap.com/v1alpha2/types.go new file mode 100644 index 00000000..61571c32 --- /dev/null +++ b/pkg/apis/sme.sap.com/v1alpha2/types.go @@ -0,0 +1,918 @@ +/* +SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +package v1alpha2 + +import ( + certManagermetav1 "github.com/cert-manager/cert-manager/pkg/apis/meta/v1" + autoscalingv2 "k8s.io/api/autoscaling/v2" + corev1 "k8s.io/api/core/v1" + policyv1 "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + Group = "sme.sap.com" + Version = "v1alpha2" + CAPApplicationKind = "CAPApplication" + CAPApplicationResource = "capapplications" + CAPApplicationVersionKind = "CAPApplicationVersion" + CAPApplicationVersionResource = "capapplicationversions" + CAPTenantKind = "CAPTenant" + CAPTenantResource = "captenants" + CAPTenantOperationKind = "CAPTenantOperation" + CAPTenantOperationResource = "captenantoperations" + CAPTenantOutputKind = "CAPTenantOutput" + CAPTenantOutputResource = "captenantoutputs" + DomainKind = "Domain" + DomainResource = "domains" + ClusterDomainKind = "ClusterDomain" + ClusterDomainResource = "clusterdomains" +) + +// +kubebuilder:resource:shortName=ca +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +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 + +// CAPApplication is the schema for capapplications API +type CAPApplication struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // CAPApplication spec + Spec CAPApplicationSpec `json:"spec"` + // +kubebuilder:validation:Optional + // CAPApplication status + Status CAPApplicationStatus `json:"status"` +} + +type CAPApplicationStatus struct { + GenericStatus `json:",inline"` + // +kubebuilder:validation:Enum="";Consistent;Processing;Error;Deleting + // State of CAPApplication + State CAPApplicationState `json:"state"` + // Represents whether this is a services only scenario + ServicesOnly *bool `json:"servicesOnly,omitempty"` + // Hash representing last known application domains + DomainSpecHash string `json:"domainSpecHash,omitempty"` + // The last time a full reconciliation was completed + LastFullReconciliationTime metav1.Time `json:"lastFullReconciliationTime,omitempty"` + // Last known application subdomains + ObservedSubdomains []string `json:"observedSubdomains,omitempty"` +} + +type CAPApplicationState string + +const ( + // CAPApplication is being reconciled + CAPApplicationStateProcessing CAPApplicationState = "Processing" + // An error occurred during reconciliation + CAPApplicationStateError CAPApplicationState = "Error" + // Deletion has been triggered + CAPApplicationStateDeleting CAPApplicationState = "Deleting" + // CAPApplication has been reconciled and is now consistent + CAPApplicationStateConsistent CAPApplicationState = "Consistent" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPApplicationList contains a list of CAPApplication +type CAPApplicationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []CAPApplication `json:"items"` +} + +// CAPApplicationSpec defines the desired state of CAPApplication +type CAPApplicationSpec struct { + // Reference to `Domain` resources used by the application + DomainRefs []DomainRef `json:"domainRefs,omitempty"` + // The subaccount ID in which the application is provided + ProviderSubaccountId string `json:"providerSubaccountId"` + // Short name for the application (BTP XSAPPNAME) + BTPAppName string `json:"btpAppName"` + // Deprecated: Provider subaccount where application services are created + // Will be removed, consider automating this via BTP / subscription instead! + Provider *BTPTenantIdentification `json:"provider,omitempty"` + // SAP BTP Services consumed by the application + BTP BTP `json:"btp"` + // Rollout on Credentials Update may be used to rollout deployments when dependent service credentials are updated + RolloutOnCredentialUpdate bool `json:"rolloutOnCredentialUpdate,omitempty"` +} + +// Domain references +type DomainRef struct { + // +kubebuilder:validation:Enum=Domain;ClusterDomain + Kind string `json:"kind"` + Name string `json:"name"` +} + +// Application domains +// +// Deprecated: ApplicationDomains exists for historical compatibility and should not be used. +// This will be removed in future versions. Use DomainRef instead. +type ApplicationDomains struct { + // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ + // +kubebuilder:validation:MaxLength=62 + // Primary application domain will be used to generate a wildcard TLS certificate. In project "Gardener" managed clusters this is (usually) a subdomain of the cluster domain + Primary string `json:"primary,omitempty"` + // +kubebuilder:validation:items:Pattern=^[a-z0-9-.]+$ + // Customer specific domains to serve application endpoints (optional) + Secondary []string `json:"secondary,omitempty"` + // +kubebuilder:validation:Pattern=^[a-z0-9-.]*$ + // Public ingress URL for the cluster Load Balancer + DnsTarget string `json:"dnsTarget,omitempty"` + // +kubebuilder:validation:MinItems=1 + // Labels used to identify the istio ingress-gateway component and its corresponding namespace. Usually {"app":"istio-ingressgateway","istio":"ingressgateway"} + IstioIngressGatewayLabels []NameValue `json:"istioIngressGatewayLabels,omitempty"` +} + +//Workaround for pattern for string items +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ +//type PatternString string + +// Generic Name/Value configuration +type NameValue struct { + Name string `json:"name"` + Value string `json:"value"` +} + +// Identifies an SAP BTP subaccount (tenant) +type BTPTenantIdentification struct { + // BTP subaccount subdomain + SubDomain string `json:"subDomain"` + // BTP subaccount Tenant ID + TenantId string `json:"tenantId"` +} + +type BTP struct { + // Details of BTP Services + Services []ServiceInfo `json:"services"` +} + +// Service information +type ServiceInfo struct { + // A unique name of service based on usage in the app (this may be the name of the instance or binding) + Name string `json:"name"` + // Secret containing service access credentials + Secret string `json:"secret"` + // Type of service + Class string `json:"class"` + // SubscriptionDependency may be used to specify whether this service should be part of getDependencies call from subscription service (e.g. saas-registry) + SubscriptionDependency *SubscriptionDependency `json:"subscriptionDependency,omitempty"` +} + +// +kubebuilder:validation:Enum=Auto;Always;Never +type SubscriptionDependency string + +const ( + // Automatically determine if the service needs to be returned in getDependencies call + SubscriptionDependencyAuto SubscriptionDependency = "Auto" + // Always return the service in getDependencies call + SubscriptionDependencyAlways SubscriptionDependency = "Always" + // Never return the service in getDependencies call + SubscriptionDependencyNever SubscriptionDependency = "Never" +) + +// Custom resource status +type GenericStatus struct { + // Observed generation of the resource where this status was identified + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + // State expressed as conditions + Conditions []metav1.Condition `json:"conditions,omitempty"` +} + +type CAPApplicationStatusConditionType string + +const ( + ConditionTypeAllTenantsReady CAPApplicationStatusConditionType = "AllTenantsReady" + ConditionTypeLatestVersionReady CAPApplicationStatusConditionType = "LatestVersionReady" +) + +type StatusConditionType string + +const ( + ConditionTypeReady StatusConditionType = "Ready" +) + +// +kubebuilder:resource:shortName=cav +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPApplicationVersion defines the schema for capapplicationversions API +type CAPApplicationVersion struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // CAPApplicationVersion spec + Spec CAPApplicationVersionSpec `json:"spec"` + // +kubebuilder:validation:Optional + // CAPApplicationVersion status + Status CAPApplicationVersionStatus `json:"status"` +} + +type CAPApplicationVersionStatus struct { + GenericStatus `json:",inline"` + // +kubebuilder:validation:Enum="";Ready;Error;Processing;Deleting + // State of CAPApplicationVersion + State CAPApplicationVersionState `json:"state"` + // List of finished Content Jobs + FinishedJobs []string `json:"finishedJobs,omitempty"` +} + +type CAPApplicationVersionState string + +const ( + // CAPApplicationVersion is being processed + CAPApplicationVersionStateProcessing CAPApplicationVersionState = "Processing" + // An error occurred during reconciliation + CAPApplicationVersionStateError CAPApplicationVersionState = "Error" + // Deletion has been triggered + CAPApplicationVersionStateDeleting CAPApplicationVersionState = "Deleting" + // CAPApplicationVersion is now ready for use (dependent resources have been created) + CAPApplicationVersionStateReady CAPApplicationVersionState = "Ready" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPApplicationVersionList contains a list of CAPApplicationVersion +type CAPApplicationVersionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []CAPApplicationVersion `json:"items"` +} + +// CAPApplicationVersionSpec specifies the desired state of CAPApplicationVersion +type CAPApplicationVersionSpec struct { + // Denotes to which CAPApplication the current version belongs + CAPApplicationInstance string `json:"capApplicationInstance"` + // Semantic version + // +kubebuilder:validation:Pattern=^(0|[1-9]\d*)(\.(0|[1-9]\d*)(\.(0|[1-9]\d*)(-((0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?)?)?$ + Version string `json:"version"` + // Registry secrets used to pull images of the application components + RegistrySecrets []string `json:"registrySecrets,omitempty"` + // Information about the Workloads + // +kubebuilder:validation:MaxItems=100 + Workloads []WorkloadDetails `json:"workloads"` + // Tenant Operations may be used to specify how jobs are sequenced for the different tenant operations + TenantOperations *TenantOperations `json:"tenantOperations,omitempty"` + // Content Jobs may be used to specify the sequence of content jobs when several jobs exist + ContentJobs []string `json:"contentJobs,omitempty"` + // Configuration for the service(s) to be exposed (relevant only for 'Service' type deployment workloads) + ServiceExposures []ServiceExposure `json:"serviceExposures,omitempty"` +} + +// WorkloadDetails specifies the details of the Workload +// +kubebuilder:validation:ExactlyOneOf=deploymentDefinition;jobDefinition +type WorkloadDetails struct { + // Name of the workload + Name string `json:"name"` + // List of BTP services consumed by the current application component workload. These services must be defined in the corresponding CAPApplication. + ConsumedBTPServices []string `json:"consumedBTPServices"` + // Custom labels for the current workload + Labels map[string]string `json:"labels,omitempty"` + // Annotations for the current workload, in case of `Deployments` this also get copied over to any `Service` that may be created + Annotations map[string]string `json:"annotations,omitempty"` + // Definition of a deployment + DeploymentDefinition *DeploymentDetails `json:"deploymentDefinition,omitempty"` + // Definition of a job + JobDefinition *JobDetails `json:"jobDefinition,omitempty"` +} + +// DeploymentDetails specifies the details of the Deployment +type DeploymentDetails struct { + CommonDetails `json:",inline"` + // Type of the Deployment + Type DeploymentType `json:"type"` + // Number of replicas + Replicas *int32 `json:"replicas,omitempty"` + // Port configuration + Ports []Ports `json:"ports,omitempty"` + // Liveness probe + LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"` + // Readiness probe + ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"` + // Startup Probe + StartupProbe *corev1.Probe `json:"startupProbe,omitempty"` + // Workload monitoring specification + Monitoring *WorkloadMonitoring `json:"monitoring,omitempty"` + // Pod Disruption Budget may be used to specify the minimum number of available pods for this workload + PodDisruptionBudget *policyv1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"` + // Horizontal Pod Autoscaler may be used to specify the scaling behavior for this workload + HorizontalPodAutoscaler *HorizontalPodAutoscalerSpec `json:"horizontalPodAutoscaler,omitempty"` + // Stickiness configuration based on istio consistent hashing for the workload. When present, this is used to create a DestinationRule for the workload. + Stickiness *Stickiness `json:"stickiness,omitempty"` +} + +type Stickiness struct { + // Hash based stickiness configuration. + Hash *StickinessHash `json:"hash,omitempty"` +} + +// Loosely based on the options available for consistent hash load balancer in istio (https://istio.io/latest/docs/reference/config/networking/destination-rule/#ConsistentHashLB), but only include the options that make sense for our use case. +// +kubebuilder:validation:AtMostOneOf=httpHeaderName;httpCookie;useSourceIp;httpQueryParameterName +type StickinessHash struct { + // Hash based on a specific HTTP header. + HttpHeaderName string `json:"httpHeaderName,omitempty"` + // Hash based on HTTP cookie. + HttpCookie *HTTPCookie `json:"httpCookie,omitempty"` + // Hash based on the source IP address. + // This is applicable for both TCP and HTTP connections. + UseSourceIp bool `json:"useSourceIp,omitempty"` + // Hash based on a specific HTTP query parameter. + HttpQueryParameterName string `json:"httpQueryParameterName,omitempty"` +} + +type HTTPCookie struct { + // Name of the cookie. + Name string `json:"name,omitempty"` + // Path to set for the cookie. + Path string `json:"path,omitempty"` + // Lifetime of the cookie. If specified, a cookie with the TTL will be + // generated if the cookie is not present. If the TTL is present and zero, + // the generated cookie will be a session cookie. + Ttl *metav1.Duration `json:"ttl,omitempty"` + // Additional attributes for the cookie. They will be used when generating a new cookie. + Attributes []NameValue `json:"attributes,omitempty"` +} + +// HorizontalPodAutoscalerSpec wraps autoscalingv2.HorizontalPodAutoscalerSpec but gets rid of scaleTargetRef, +// as the operator always sets it to the deployment created for the workload. +type HorizontalPodAutoscalerSpec struct { + // minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. + // +optional + MinReplicas *int32 `json:"minReplicas,omitempty"` + // maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. + MaxReplicas int32 `json:"maxReplicas"` + // metrics contains the specifications for which to use to calculate the desired replica count. + // +optional + Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"` + // behavior configures the scaling behavior of the target in both Up and Down directions. + // +optional + Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"` +} + +// ServiceExposure specifies the details of the VirtualService to be exposed for `Service` type workload(s) +type ServiceExposure struct { + // Subdomain under which the service is exposed (used as the Key for identifying the VirtualService) + SubDomain string `json:"subDomain"` + // Routes specifies the routing configuration (http match) for the exposed service + Routes []Route `json:"routes"` +} + +// Routing configuration (http match) for the exposed service +type Route struct { + // Name of the workload (eventually a service to route requests to); must be a valid workload name (Deployment) + WorkloadName string `json:"workloadName"` + // Port number used for the service (must be present in the workload/service) + Port int32 `json:"port"` + // A unique routing path used (as a match/prefix) to route requests to the workload (when omitted, "/" would be used) + Path string `json:"path,omitempty"` +} + +// WorkloadMonitoring specifies the metrics related to the workload +type WorkloadMonitoring struct { + // DeletionRules specify the metrics conditions that need to be satisfied for the version to be deleted automatically. + // Either a set of metrics based rules can be specified, or a PromQL expression which evaluates to a boolean scalar. + DeletionRules *DeletionRules `json:"deletionRules,omitempty"` + // Configuration to be used to create ServiceMonitor for the workload service. + // If not specified, CAP Operator will not attempt to create a ServiceMonitor for the workload + ScrapeConfig *MonitoringConfig `json:"scrapeConfig,omitempty"` +} + +type MonitoringConfig struct { + // Interval at which Prometheus scrapes the metrics from the target. + ScrapeInterval Duration `json:"interval,omitempty"` + // Name of the port (specified on the workload) which will be used by Prometheus server to scrape metrics + WorkloadPort string `json:"port"` + // HTTP path from which to scrape for metrics. + Path string `json:"path,omitempty"` + // Timeout after which Prometheus considers the scrape to be failed. + Timeout Duration `json:"scrapeTimeout,omitempty"` +} + +// +kubebuilder:validation:ExactlyOneOf=metrics;expression +type DeletionRules struct { + Metrics []MetricRule `json:"metrics,omitempty"` + // A promQL expression that evaluates to a scalar boolean (1 or 0). + // Example: scalar(sum(avg_over_time(demo_metric{job="cav-demo-app-4-srv-svc",namespace="demo"}[2m]))) <= bool 0.1 + ScalarExpression *string `json:"expression,omitempty"` +} + +// MetricRule specifies a Prometheus metric and rule which represents a cleanup condition. Metrics of type Gauge and Counter are supported. +// +// Rule evaluation for Gauge type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as an average over the specified period. +// A sum of the calculated average from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. +// Evaluation: `sum(avg_over_time({job=}[])) <= ` +// +// Rule evaluation for Counter type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as rate of increase over the specified period. +// The sum of the calculated rates from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. +// Evaluation: `sum(rate({job=}[])) <= ` +type MetricRule struct { + // Prometheus metric. For example `http_request_count` + Name string `json:"name"` + // Type of Prometheus metric which can be either `Gauge` or `Counter` + // +kubebuilder:validation:Enum=Gauge;Counter + Type MetricType `json:"type"` + // Duration of time series data used for the rule evaluation + CalculationPeriod Duration `json:"calculationPeriod"` + // The threshold value which is compared against the calculated value. If calculated value is less than or equal to the threshold the rule condition is fulfilled. + // +kubebuilder:validation:Format=double + ThresholdValue string `json:"thresholdValue"` +} + +// Duration is a valid time duration that can be parsed by Prometheus +// Supported units: y, w, d, h, m, s, ms +// Examples: `30s`, `1m`, `1h20m15s`, `15d` +// +kubebuilder:validation:Pattern="^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$" +type Duration string + +// Type of Prometheus metric +type MetricType string + +const ( + // Prometheus Metric type Gauge + MetricTypeGauge MetricType = "Gauge" + // Prometheus Metric type Counter + MetricTypeCounter MetricType = "Counter" +) + +// Type of deployment +type DeploymentType string + +const ( + // CAP backend server deployment type + DeploymentCAP DeploymentType = "CAP" + // Application router deployment type + DeploymentRouter DeploymentType = "Router" + // Additional deployment type + DeploymentAdditional DeploymentType = "Additional" + // Service deployment type + DeploymentService DeploymentType = "Service" +) + +// JobDetails specifies the details of the Job +type JobDetails struct { + CommonDetails `json:",inline"` + // Type of Job + Type JobType `json:"type"` + // Specifies the number of retries before marking this job failed. + BackoffLimit *int32 `json:"backoffLimit,omitempty"` + // Specifies the time after which the job may be cleaned up. + TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` + // Specifies the duration in seconds for which the job may be continuously active. + ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` +} + +// Type of Job +type JobType string + +const ( + // job for deploying content or configuration to (BTP) services + JobContent JobType = "Content" + // job for tenant operation e.g. deploying relevant data to a tenant + JobTenantOperation JobType = "TenantOperation" + // job for custom tenant operation e.g. pre/post hooks for a tenant operation + JobCustomTenantOperation JobType = "CustomTenantOperation" +) + +// CommonDetails specifies the common details of the Container/Pod that may be relevant for both Deployments and Jobs +type CommonDetails struct { + // Image info for the container + Image string `json:"image"` + // Pull policy for the container image + ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + // Entrypoint array for the container + Command []string `json:"command,omitempty"` + // Arguments to the entrypoint + Args []string `json:"args,omitempty"` + // Environment Config for the Container + Env []corev1.EnvVar `json:"env,omitempty"` + // Volume Configuration for the Pod + Volumes []corev1.Volume `json:"volumes,omitempty"` + // Volume Mount Configuration for the Container + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` + // Name of the ServiceAccount to use to run the Pod + ServiceAccountName string `json:"serviceAccountName,omitempty"` + // Resources + Resources corev1.ResourceRequirements `json:"resources,omitempty"` + // SecurityContext for the Container + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` + // SecurityContext for the Pod + PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"` + // The name of the node to which the Pod should be assigned to. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename + NodeName string `json:"nodeName,omitempty"` + // The label selectors using which node for the Pod would be determined. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + // Priority class name mapping used to prioritize and schedule the Pod. See: https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass + PriorityClassName string `json:"priorityClassName,omitempty"` + // Affinity/anti-affinity used to provide more constraints for node selection. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity + Affinity *corev1.Affinity `json:"affinity,omitempty"` + // Tolerations used to schedule the Pod. See: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + // The Topology spread constraints used to control how Pods are spread across regions, zones, nodes etc. See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#pod-topology-spread-constraints + // Note: As of now, this field only makes sense for Deployment workloads. If/once we support parallel Job workloads, this field may be relevant for Jobs as well. + TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"` + // List of containers executed before the main container is started + InitContainers []corev1.Container `json:"initContainers,omitempty"` + // Restart policy for the Pod. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy + RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty"` + // Optional duration in seconds the pod needs to terminate gracefully. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination-flow + TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` + // Optional actions that the management system should take in response to container lifecycle events. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination + Lifecycle *corev1.Lifecycle `json:"lifecycle,omitempty"` +} + +// Configuration of Service Ports for the deployment +type Ports struct { + // App protocol used by the service port + AppProtocol *string `json:"appProtocol,omitempty"` + // Name of the service port + Name string `json:"name"` + // +kubebuilder:validation:Enum=Application;Cluster + // Network Policy of the service port + NetworkPolicy PortNetworkPolicyType `json:"networkPolicy,omitempty"` + // The port number used for container and the corresponding service (if any) + Port int32 `json:"port"` + // Destination name which may be used by the Router deployment to reach this backend service + RouterDestinationName string `json:"routerDestinationName,omitempty"` +} + +// Type of NetworkPolicy for the port +type PortNetworkPolicyType string + +const ( + // Expose the port for the current application versions pod(s) scope + PortNetworkPolicyTypeApplication PortNetworkPolicyType = "Application" + // Expose the port for any pod(s) in the overall cluster scope + PortNetworkPolicyTypeCluster PortNetworkPolicyType = "Cluster" +) + +// Configuration used to sequence tenant related jobs for a given tenant operation +type TenantOperations struct { + // Tenant provisioning steps + Provisioning []TenantOperationWorkloadReference `json:"provisioning,omitempty"` + // Tenant upgrade steps + Upgrade []TenantOperationWorkloadReference `json:"upgrade,omitempty"` + // Tenant deprovisioning steps + Deprovisioning []TenantOperationWorkloadReference `json:"deprovisioning,omitempty"` +} + +type TenantOperationWorkloadReference struct { + // Reference to a specified workload of type 'TenantOperation' or 'CustomTenantOperation' + WorkloadName string `json:"workloadName"` + // Indicates whether to proceed with remaining operation steps in case of failure. Relevant only for 'CustomTenantOperation' + ContinueOnFailure bool `json:"continueOnFailure,omitempty"` +} + +// +kubebuilder:resource:shortName=cat +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.state" +// +kubebuilder:printcolumn:name="Subdomain",type="string",JSONPath=".spec.subDomain" +// +kubebuilder:printcolumn:name="Current Version",type="string",JSONPath=".status.currentCAPApplicationVersionInstance" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPTenant defines the schema for captenants API +type CAPTenant struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // CAPTenant spec + Spec CAPTenantSpec `json:"spec"` + // +kubebuilder:validation:Optional + // CAPTenant status + Status CAPTenantStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPTenantList contains a list of CAPTenant +type CAPTenantList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []CAPTenant `json:"items"` +} + +type CAPTenantStatus struct { + GenericStatus `json:",inline"` + // +kubebuilder:validation:Enum="";Ready;Provisioning;Upgrading;Deleting;ProvisioningError;UpgradeError + // State of CAPTenant + State CAPTenantState `json:"state"` + // Specifies the current version of the tenant after provisioning or upgrade + CurrentCAPApplicationVersionInstance string `json:"currentCAPApplicationVersionInstance,omitempty"` + // Previous versions of the tenant (first to last) + PreviousCAPApplicationVersions []string `json:"previousCAPApplicationVersions,omitempty"` + // The last time a full reconciliation was completed + LastFullReconciliationTime metav1.Time `json:"lastFullReconciliationTime,omitempty"` +} + +type CAPTenantState string + +const ( + // Tenant is being provisioned + CAPTenantStateProvisioning CAPTenantState = "Provisioning" + // Tenant provisioning ended in error + CAPTenantStateProvisioningError CAPTenantState = "ProvisioningError" + // Tenant is being upgraded + CAPTenantStateUpgrading CAPTenantState = "Upgrading" + // Tenant upgrade failed + CAPTenantStateUpgradeError CAPTenantState = "UpgradeError" + // Deletion has been triggered + CAPTenantStateDeleting CAPTenantState = "Deleting" + // Tenant has been provisioned/upgraded and is now ready for use + CAPTenantStateReady CAPTenantState = "Ready" +) + +// CAPTenantSpec defines the desired state of the CAPTenant +type CAPTenantSpec struct { + // Denotes to which CAPApplication the current tenant belongs + CAPApplicationInstance string `json:"capApplicationInstance"` + // Details of consumer sub-account subscribing to the application + BTPTenantIdentification `json:",inline"` + // Semver that is used to determine the relevant CAPApplicationVersion that a CAPTenant can be upgraded to (i.e. if it is not already on that version) + Version string `json:"version,omitempty"` + // +kubebuilder:validation:Enum=always;never + // Denotes whether a CAPTenant can be upgraded. One of ('always', 'never') + VersionUpgradeStrategy VersionUpgradeStrategyType `json:"versionUpgradeStrategy,omitempty"` +} + +type VersionUpgradeStrategyType string + +const ( + // Always (default) + VersionUpgradeStrategyTypeAlways VersionUpgradeStrategyType = "always" + // Never + VersionUpgradeStrategyTypeNever VersionUpgradeStrategyType = "never" +) + +// +kubebuilder:resource:shortName=ctop +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Operation",type="string",JSONPath=".spec.operation" +// +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 + +// CAPTenantOperation defines the schema for captenantoperations API +type CAPTenantOperation struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // CAPTenantOperation spec + Spec CAPTenantOperationSpec `json:"spec"` + // +kubebuilder:validation:Optional + // CAPTenantOperation status + Status CAPTenantOperationStatus `json:"status"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPTenantOperationList contains a list of CAPTenantOperation +type CAPTenantOperationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []CAPTenantOperation `json:"items"` +} + +type CAPTenantOperationSpec struct { + // +kubebuilder:validation:Enum=provisioning;deprovisioning;upgrade + // Scope of the tenant lifecycle operation. One of 'provisioning', 'deprovisioning' or 'upgrade' + Operation CAPTenantOperationType `json:"operation"` + // BTP sub-account (tenant) for which request is created + BTPTenantIdentification `json:",inline"` + // Reference to CAPApplicationVersion for executing the operation + CAPApplicationVersionInstance string `json:"capApplicationVersionInstance"` + // Steps (jobs) to be executed for the operation to complete + Steps []CAPTenantOperationStep `json:"steps"` +} + +type CAPTenantOperationStep struct { + // Name of the workload from the referenced CAPApplicationVersion + Name string `json:"name"` + // +kubebuilder:validation:Enum=CustomTenantOperation;TenantOperation + // Type of job. One of 'TenantOperation' or 'CustomTenantOperation' + Type JobType `json:"type"` + // Indicates whether the operation can continue in case of step failure. Relevant only for type 'CustomTenantOperation' + ContinueOnFailure bool `json:"continueOnFailure,omitempty"` +} + +type CAPTenantOperationStatus struct { + GenericStatus `json:",inline"` + // +kubebuilder:validation:Enum="";Processing;Completed;Failed;Deleting + // State of CAPTenantOperation + State CAPTenantOperationState `json:"state"` + // Current step being processed from the sequence of specified steps + CurrentStep *uint32 `json:"currentStep,omitempty"` + // Name of the job being executed for the current step + ActiveJob *string `json:"activeJob,omitempty"` +} + +type CAPTenantOperationState string + +const ( + // CAPTenantOperation is being processed + CAPTenantOperationStateProcessing CAPTenantOperationState = "Processing" + // CAPTenantOperation steps have failed + CAPTenantOperationStateFailed CAPTenantOperationState = "Failed" + // CAPTenantOperation steps completed + CAPTenantOperationStateCompleted CAPTenantOperationState = "Completed" + // CAPTenantOperation deletion has been triggered + CAPTenantOperationStateDeleting CAPTenantOperationState = "Deleting" +) + +type CAPTenantOperationType string + +const ( + // Provision tenant + CAPTenantOperationTypeProvisioning CAPTenantOperationType = "provisioning" + // Deprovision tenant + CAPTenantOperationTypeDeprovisioning CAPTenantOperationType = "deprovisioning" + // Upgrade tenant + CAPTenantOperationTypeUpgrade CAPTenantOperationType = "upgrade" +) + +// +kubebuilder:resource:shortName=ctout +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPTenantOutput is the schema for captenantoutputs API +type CAPTenantOutput struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata"` + // CAPTenantOutput spec + Spec CAPTenantOutputSpec `json:"spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CAPTenantOutputList contains a list of CAPTenantOutput +type CAPTenantOutputList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + Items []CAPTenantOutput `json:"items"` +} + +type CAPTenantOutputSpec struct { + // +kubebuilder:validation:nullable + SubscriptionCallbackData string `json:"subscriptionCallbackData,omitempty"` +} + +// +kubebuilder:resource:shortName=dom +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Domain",type="string",JSONPath=".spec.domain" +// +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 used by an application + Domain string `json:"domain"` + // Selector is the set of labels used to select the ingress pods handling the domain + IngressSelector map[string]string `json:"ingressSelector"` + // +kubebuilder:default:=Simple + // TLS mode for the generated (Istio) Gateway resource. Set this to Mutual when using mTLS with an external gateway. + TLSMode TLSMode `json:"tlsMode"` + // +kubebuilder:default:=None + // DNS mode controls the creation of DNS entries related to the domain + DNSMode DNSMode `json:"dnsMode"` + // DNS templates allows usage of go templates for generating DNS entries when [DNSMode] is set to `Custom` + // +kubebuilder:validation:MaxItems=10 + DNSTemplates []DNSTemplate `json:"dnsTemplates,omitempty"` + // +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ + // DNS Target for traffic to this domain + DNSTarget string `json:"dnsTarget,omitempty"` + // Certificate configuration + CertConfig *CertConfig `json:"certConfig,omitempty"` +} + +// DNSTemplate supports the creation of DNS entries using go templates See: https://pkg.go.dev/text/template +type DNSTemplate struct { + // Domain name for which a DNS record will be created + Name string `json:"name"` + // Target of the DNS record + Target string `json:"target"` +} + +type CertConfig struct { + // Used to specify additional CA certificate that may be used for verifying client certificates in Mutual TLS mode + AdditionalCACertificate string `json:"additionalCACertificate,omitempty"` + // CertManager specific configuration for the certificate to be created for the domain + CertManager *CertManager `json:"certManager,omitempty"` +} + +type CertManager struct { + // Issuer configuration for the certificate + IssuerRef certManagermetav1.IssuerReference `json:"issuerRef"` +} + +// +kubebuilder:validation:Enum=Simple;Mutual;OptionalMutual +type TLSMode string + +const ( + // Simple TLS Mode (Default) + TlsModeSimple TLSMode = "Simple" + // Mutual TLS Mode + TlsModeMutual TLSMode = "Mutual" + // Optional Mutual TLS Mode + TlsModeOptionalMutual TLSMode = "OptionalMutual" +) + +// +kubebuilder:validation:Enum=None;Wildcard;Subdomain;Custom +type DNSMode string + +const ( + // No DNS entries will be created (Default) + DnsModeNone DNSMode = "None" + // Wildcard DNS entry will be created + DnsModeWildcard DNSMode = "Wildcard" + // A DNS entry will be created for each subdomain specified by the applications using this domain + DnsModeSubdomain DNSMode = "Subdomain" + // A DNS entry will be created according to configuration in `[DNSTemplate]` + DnsModeCustom DNSMode = "Custom" +) + +type DomainStatus struct { + GenericStatus `json:",inline"` + // State of the Domain + State DomainState `json:"state"` + // Effective DNS Target identified for this domain + DnsTarget string `json:"dnsTarget,omitempty"` + // Gateway name used for the domain + GatewayName string `json:"gatewayName,omitempty"` + // domain observed during last reconciliation + ObservedDomain string `json:"observedDomain,omitempty"` +} + +// +kubebuilder:validation:Enum="";Ready;Error;Processing;Deleting +type DomainState string + +const ( + DomainStateProcessing DomainState = "Processing" + DomainStateError DomainState = "Error" + DomainStateDeleting DomainState = "Deleting" + DomainStateReady DomainState = "Ready" +) + +// +kubebuilder:resource:scope=Cluster,shortName=cdom +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Domain",type="string",JSONPath=".spec.domain" +// +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"` + // ClusterDomains spec + Spec DomainSpec `json:"spec"` + // +kubebuilder:validation:Optional + // ClusterDomain 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/utils.go b/pkg/apis/sme.sap.com/v1alpha2/utils.go similarity index 99% rename from pkg/apis/sme.sap.com/v1alpha1/utils.go rename to pkg/apis/sme.sap.com/v1alpha2/utils.go index eaa119a8..d595854f 100644 --- a/pkg/apis/sme.sap.com/v1alpha1/utils.go +++ b/pkg/apis/sme.sap.com/v1alpha2/utils.go @@ -3,7 +3,7 @@ SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator SPDX-License-Identifier: Apache-2.0 */ -package v1alpha1 +package v1alpha2 import ( "os" diff --git a/pkg/apis/sme.sap.com/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/sme.sap.com/v1alpha2/zz_generated.deepcopy.go new file mode 100644 index 00000000..e227ab6a --- /dev/null +++ b/pkg/apis/sme.sap.com/v1alpha2/zz_generated.deepcopy.go @@ -0,0 +1,1465 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cap-operator contributors +SPDX-License-Identifier: Apache-2.0 +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha2 + +import ( + v2 "k8s.io/api/autoscaling/v2" + v1 "k8s.io/api/core/v1" + policyv1 "k8s.io/api/policy/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ApplicationDomains) DeepCopyInto(out *ApplicationDomains) { + *out = *in + if in.Secondary != nil { + in, out := &in.Secondary, &out.Secondary + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IstioIngressGatewayLabels != nil { + in, out := &in.IstioIngressGatewayLabels, &out.IstioIngressGatewayLabels + *out = make([]NameValue, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationDomains. +func (in *ApplicationDomains) DeepCopy() *ApplicationDomains { + if in == nil { + return nil + } + out := new(ApplicationDomains) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BTP) DeepCopyInto(out *BTP) { + *out = *in + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = make([]ServiceInfo, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BTP. +func (in *BTP) DeepCopy() *BTP { + if in == nil { + return nil + } + out := new(BTP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BTPTenantIdentification) DeepCopyInto(out *BTPTenantIdentification) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BTPTenantIdentification. +func (in *BTPTenantIdentification) DeepCopy() *BTPTenantIdentification { + if in == nil { + return nil + } + out := new(BTPTenantIdentification) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPApplication) DeepCopyInto(out *CAPApplication) { + *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 CAPApplication. +func (in *CAPApplication) DeepCopy() *CAPApplication { + if in == nil { + return nil + } + out := new(CAPApplication) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPApplication) 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 *CAPApplicationList) DeepCopyInto(out *CAPApplicationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CAPApplication, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationList. +func (in *CAPApplicationList) DeepCopy() *CAPApplicationList { + if in == nil { + return nil + } + out := new(CAPApplicationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPApplicationList) 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 *CAPApplicationSpec) DeepCopyInto(out *CAPApplicationSpec) { + *out = *in + if in.DomainRefs != nil { + in, out := &in.DomainRefs, &out.DomainRefs + *out = make([]DomainRef, len(*in)) + copy(*out, *in) + } + if in.Provider != nil { + in, out := &in.Provider, &out.Provider + *out = new(BTPTenantIdentification) + **out = **in + } + in.BTP.DeepCopyInto(&out.BTP) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationSpec. +func (in *CAPApplicationSpec) DeepCopy() *CAPApplicationSpec { + if in == nil { + return nil + } + out := new(CAPApplicationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPApplicationStatus) DeepCopyInto(out *CAPApplicationStatus) { + *out = *in + in.GenericStatus.DeepCopyInto(&out.GenericStatus) + if in.ServicesOnly != nil { + in, out := &in.ServicesOnly, &out.ServicesOnly + *out = new(bool) + **out = **in + } + in.LastFullReconciliationTime.DeepCopyInto(&out.LastFullReconciliationTime) + if in.ObservedSubdomains != nil { + in, out := &in.ObservedSubdomains, &out.ObservedSubdomains + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationStatus. +func (in *CAPApplicationStatus) DeepCopy() *CAPApplicationStatus { + if in == nil { + return nil + } + out := new(CAPApplicationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPApplicationVersion) DeepCopyInto(out *CAPApplicationVersion) { + *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 CAPApplicationVersion. +func (in *CAPApplicationVersion) DeepCopy() *CAPApplicationVersion { + if in == nil { + return nil + } + out := new(CAPApplicationVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPApplicationVersion) 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 *CAPApplicationVersionList) DeepCopyInto(out *CAPApplicationVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CAPApplicationVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationVersionList. +func (in *CAPApplicationVersionList) DeepCopy() *CAPApplicationVersionList { + if in == nil { + return nil + } + out := new(CAPApplicationVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPApplicationVersionList) 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 *CAPApplicationVersionSpec) DeepCopyInto(out *CAPApplicationVersionSpec) { + *out = *in + if in.RegistrySecrets != nil { + in, out := &in.RegistrySecrets, &out.RegistrySecrets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Workloads != nil { + in, out := &in.Workloads, &out.Workloads + *out = make([]WorkloadDetails, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TenantOperations != nil { + in, out := &in.TenantOperations, &out.TenantOperations + *out = new(TenantOperations) + (*in).DeepCopyInto(*out) + } + if in.ContentJobs != nil { + in, out := &in.ContentJobs, &out.ContentJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceExposures != nil { + in, out := &in.ServiceExposures, &out.ServiceExposures + *out = make([]ServiceExposure, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationVersionSpec. +func (in *CAPApplicationVersionSpec) DeepCopy() *CAPApplicationVersionSpec { + if in == nil { + return nil + } + out := new(CAPApplicationVersionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPApplicationVersionStatus) DeepCopyInto(out *CAPApplicationVersionStatus) { + *out = *in + in.GenericStatus.DeepCopyInto(&out.GenericStatus) + if in.FinishedJobs != nil { + in, out := &in.FinishedJobs, &out.FinishedJobs + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPApplicationVersionStatus. +func (in *CAPApplicationVersionStatus) DeepCopy() *CAPApplicationVersionStatus { + if in == nil { + return nil + } + out := new(CAPApplicationVersionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPTenant) DeepCopyInto(out *CAPTenant) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenant. +func (in *CAPTenant) DeepCopy() *CAPTenant { + if in == nil { + return nil + } + out := new(CAPTenant) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPTenant) 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 *CAPTenantList) DeepCopyInto(out *CAPTenantList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CAPTenant, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantList. +func (in *CAPTenantList) DeepCopy() *CAPTenantList { + if in == nil { + return nil + } + out := new(CAPTenantList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPTenantList) 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 *CAPTenantOperation) DeepCopyInto(out *CAPTenantOperation) { + *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 CAPTenantOperation. +func (in *CAPTenantOperation) DeepCopy() *CAPTenantOperation { + if in == nil { + return nil + } + out := new(CAPTenantOperation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPTenantOperation) 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 *CAPTenantOperationList) DeepCopyInto(out *CAPTenantOperationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CAPTenantOperation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationList. +func (in *CAPTenantOperationList) DeepCopy() *CAPTenantOperationList { + if in == nil { + return nil + } + out := new(CAPTenantOperationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPTenantOperationList) 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 *CAPTenantOperationSpec) DeepCopyInto(out *CAPTenantOperationSpec) { + *out = *in + out.BTPTenantIdentification = in.BTPTenantIdentification + if in.Steps != nil { + in, out := &in.Steps, &out.Steps + *out = make([]CAPTenantOperationStep, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationSpec. +func (in *CAPTenantOperationSpec) DeepCopy() *CAPTenantOperationSpec { + if in == nil { + return nil + } + out := new(CAPTenantOperationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPTenantOperationStatus) DeepCopyInto(out *CAPTenantOperationStatus) { + *out = *in + in.GenericStatus.DeepCopyInto(&out.GenericStatus) + if in.CurrentStep != nil { + in, out := &in.CurrentStep, &out.CurrentStep + *out = new(uint32) + **out = **in + } + if in.ActiveJob != nil { + in, out := &in.ActiveJob, &out.ActiveJob + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationStatus. +func (in *CAPTenantOperationStatus) DeepCopy() *CAPTenantOperationStatus { + if in == nil { + return nil + } + out := new(CAPTenantOperationStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPTenantOperationStep) DeepCopyInto(out *CAPTenantOperationStep) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOperationStep. +func (in *CAPTenantOperationStep) DeepCopy() *CAPTenantOperationStep { + if in == nil { + return nil + } + out := new(CAPTenantOperationStep) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPTenantOutput) DeepCopyInto(out *CAPTenantOutput) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOutput. +func (in *CAPTenantOutput) DeepCopy() *CAPTenantOutput { + if in == nil { + return nil + } + out := new(CAPTenantOutput) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPTenantOutput) 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 *CAPTenantOutputList) DeepCopyInto(out *CAPTenantOutputList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CAPTenantOutput, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOutputList. +func (in *CAPTenantOutputList) DeepCopy() *CAPTenantOutputList { + if in == nil { + return nil + } + out := new(CAPTenantOutputList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CAPTenantOutputList) 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 *CAPTenantOutputSpec) DeepCopyInto(out *CAPTenantOutputSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantOutputSpec. +func (in *CAPTenantOutputSpec) DeepCopy() *CAPTenantOutputSpec { + if in == nil { + return nil + } + out := new(CAPTenantOutputSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPTenantSpec) DeepCopyInto(out *CAPTenantSpec) { + *out = *in + out.BTPTenantIdentification = in.BTPTenantIdentification + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantSpec. +func (in *CAPTenantSpec) DeepCopy() *CAPTenantSpec { + if in == nil { + return nil + } + out := new(CAPTenantSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CAPTenantStatus) DeepCopyInto(out *CAPTenantStatus) { + *out = *in + in.GenericStatus.DeepCopyInto(&out.GenericStatus) + if in.PreviousCAPApplicationVersions != nil { + in, out := &in.PreviousCAPApplicationVersions, &out.PreviousCAPApplicationVersions + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.LastFullReconciliationTime.DeepCopyInto(&out.LastFullReconciliationTime) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CAPTenantStatus. +func (in *CAPTenantStatus) DeepCopy() *CAPTenantStatus { + if in == nil { + return nil + } + out := new(CAPTenantStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertConfig) DeepCopyInto(out *CertConfig) { + *out = *in + if in.CertManager != nil { + in, out := &in.CertManager, &out.CertManager + *out = new(CertManager) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertConfig. +func (in *CertConfig) DeepCopy() *CertConfig { + if in == nil { + return nil + } + out := new(CertConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CertManager) DeepCopyInto(out *CertManager) { + *out = *in + out.IssuerRef = in.IssuerRef + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CertManager. +func (in *CertManager) DeepCopy() *CertManager { + if in == nil { + return nil + } + out := new(CertManager) + in.DeepCopyInto(out) + 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 + if in.Command != nil { + in, out := &in.Command, &out.Command + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Args != nil { + in, out := &in.Args, &out.Args + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]v1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]v1.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = make([]v1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Resources.DeepCopyInto(&out.Resources) + if in.SecurityContext != nil { + in, out := &in.SecurityContext, &out.SecurityContext + *out = new(v1.SecurityContext) + (*in).DeepCopyInto(*out) + } + if in.PodSecurityContext != nil { + in, out := &in.PodSecurityContext, &out.PodSecurityContext + *out = new(v1.PodSecurityContext) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Affinity != nil { + in, out := &in.Affinity, &out.Affinity + *out = new(v1.Affinity) + (*in).DeepCopyInto(*out) + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]v1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TopologySpreadConstraints != nil { + in, out := &in.TopologySpreadConstraints, &out.TopologySpreadConstraints + *out = make([]v1.TopologySpreadConstraint, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.InitContainers != nil { + in, out := &in.InitContainers, &out.InitContainers + *out = make([]v1.Container, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TerminationGracePeriodSeconds != nil { + in, out := &in.TerminationGracePeriodSeconds, &out.TerminationGracePeriodSeconds + *out = new(int64) + **out = **in + } + if in.Lifecycle != nil { + in, out := &in.Lifecycle, &out.Lifecycle + *out = new(v1.Lifecycle) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonDetails. +func (in *CommonDetails) DeepCopy() *CommonDetails { + if in == nil { + return nil + } + out := new(CommonDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DNSTemplate) DeepCopyInto(out *DNSTemplate) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSTemplate. +func (in *DNSTemplate) DeepCopy() *DNSTemplate { + if in == nil { + return nil + } + out := new(DNSTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeletionRules) DeepCopyInto(out *DeletionRules) { + *out = *in + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = make([]MetricRule, len(*in)) + copy(*out, *in) + } + if in.ScalarExpression != nil { + in, out := &in.ScalarExpression, &out.ScalarExpression + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeletionRules. +func (in *DeletionRules) DeepCopy() *DeletionRules { + if in == nil { + return nil + } + out := new(DeletionRules) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeploymentDetails) DeepCopyInto(out *DeploymentDetails) { + *out = *in + in.CommonDetails.DeepCopyInto(&out.CommonDetails) + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.Ports != nil { + in, out := &in.Ports, &out.Ports + *out = make([]Ports, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.LivenessProbe != nil { + in, out := &in.LivenessProbe, &out.LivenessProbe + *out = new(v1.Probe) + (*in).DeepCopyInto(*out) + } + if in.ReadinessProbe != nil { + in, out := &in.ReadinessProbe, &out.ReadinessProbe + *out = new(v1.Probe) + (*in).DeepCopyInto(*out) + } + if in.StartupProbe != nil { + in, out := &in.StartupProbe, &out.StartupProbe + *out = new(v1.Probe) + (*in).DeepCopyInto(*out) + } + if in.Monitoring != nil { + in, out := &in.Monitoring, &out.Monitoring + *out = new(WorkloadMonitoring) + (*in).DeepCopyInto(*out) + } + if in.PodDisruptionBudget != nil { + in, out := &in.PodDisruptionBudget, &out.PodDisruptionBudget + *out = new(policyv1.PodDisruptionBudgetSpec) + (*in).DeepCopyInto(*out) + } + if in.HorizontalPodAutoscaler != nil { + in, out := &in.HorizontalPodAutoscaler, &out.HorizontalPodAutoscaler + *out = new(HorizontalPodAutoscalerSpec) + (*in).DeepCopyInto(*out) + } + if in.Stickiness != nil { + in, out := &in.Stickiness, &out.Stickiness + *out = new(Stickiness) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeploymentDetails. +func (in *DeploymentDetails) DeepCopy() *DeploymentDetails { + if in == nil { + return nil + } + out := new(DeploymentDetails) + in.DeepCopyInto(out) + 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 *DomainRef) DeepCopyInto(out *DomainRef) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DomainRef. +func (in *DomainRef) DeepCopy() *DomainRef { + if in == nil { + return nil + } + out := new(DomainRef) + 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 + } + } + if in.DNSTemplates != nil { + in, out := &in.DNSTemplates, &out.DNSTemplates + *out = make([]DNSTemplate, len(*in)) + copy(*out, *in) + } + if in.CertConfig != nil { + in, out := &in.CertConfig, &out.CertConfig + *out = new(CertConfig) + (*in).DeepCopyInto(*out) + } + 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 + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericStatus. +func (in *GenericStatus) DeepCopy() *GenericStatus { + if in == nil { + return nil + } + out := new(GenericStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HTTPCookie) DeepCopyInto(out *HTTPCookie) { + *out = *in + if in.Ttl != nil { + in, out := &in.Ttl, &out.Ttl + *out = new(metav1.Duration) + **out = **in + } + if in.Attributes != nil { + in, out := &in.Attributes, &out.Attributes + *out = make([]NameValue, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPCookie. +func (in *HTTPCookie) DeepCopy() *HTTPCookie { + if in == nil { + return nil + } + out := new(HTTPCookie) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HorizontalPodAutoscalerSpec) DeepCopyInto(out *HorizontalPodAutoscalerSpec) { + *out = *in + if in.MinReplicas != nil { + in, out := &in.MinReplicas, &out.MinReplicas + *out = new(int32) + **out = **in + } + if in.Metrics != nil { + in, out := &in.Metrics, &out.Metrics + *out = make([]v2.MetricSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Behavior != nil { + in, out := &in.Behavior, &out.Behavior + *out = new(v2.HorizontalPodAutoscalerBehavior) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HorizontalPodAutoscalerSpec. +func (in *HorizontalPodAutoscalerSpec) DeepCopy() *HorizontalPodAutoscalerSpec { + if in == nil { + return nil + } + out := new(HorizontalPodAutoscalerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JobDetails) DeepCopyInto(out *JobDetails) { + *out = *in + in.CommonDetails.DeepCopyInto(&out.CommonDetails) + if in.BackoffLimit != nil { + in, out := &in.BackoffLimit, &out.BackoffLimit + *out = new(int32) + **out = **in + } + if in.TTLSecondsAfterFinished != nil { + in, out := &in.TTLSecondsAfterFinished, &out.TTLSecondsAfterFinished + *out = new(int32) + **out = **in + } + if in.ActiveDeadlineSeconds != nil { + in, out := &in.ActiveDeadlineSeconds, &out.ActiveDeadlineSeconds + *out = new(int64) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobDetails. +func (in *JobDetails) DeepCopy() *JobDetails { + if in == nil { + return nil + } + out := new(JobDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetricRule) DeepCopyInto(out *MetricRule) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetricRule. +func (in *MetricRule) DeepCopy() *MetricRule { + if in == nil { + return nil + } + out := new(MetricRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MonitoringConfig) DeepCopyInto(out *MonitoringConfig) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonitoringConfig. +func (in *MonitoringConfig) DeepCopy() *MonitoringConfig { + if in == nil { + return nil + } + out := new(MonitoringConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NameValue) DeepCopyInto(out *NameValue) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NameValue. +func (in *NameValue) DeepCopy() *NameValue { + if in == nil { + return nil + } + out := new(NameValue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Ports) DeepCopyInto(out *Ports) { + *out = *in + if in.AppProtocol != nil { + in, out := &in.AppProtocol, &out.AppProtocol + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ports. +func (in *Ports) DeepCopy() *Ports { + if in == nil { + return nil + } + out := new(Ports) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Route) DeepCopyInto(out *Route) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route. +func (in *Route) DeepCopy() *Route { + if in == nil { + return nil + } + out := new(Route) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceExposure) DeepCopyInto(out *ServiceExposure) { + *out = *in + if in.Routes != nil { + in, out := &in.Routes, &out.Routes + *out = make([]Route, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceExposure. +func (in *ServiceExposure) DeepCopy() *ServiceExposure { + if in == nil { + return nil + } + out := new(ServiceExposure) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceInfo) DeepCopyInto(out *ServiceInfo) { + *out = *in + if in.SubscriptionDependency != nil { + in, out := &in.SubscriptionDependency, &out.SubscriptionDependency + *out = new(SubscriptionDependency) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceInfo. +func (in *ServiceInfo) DeepCopy() *ServiceInfo { + if in == nil { + return nil + } + out := new(ServiceInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Stickiness) DeepCopyInto(out *Stickiness) { + *out = *in + if in.Hash != nil { + in, out := &in.Hash, &out.Hash + *out = new(StickinessHash) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stickiness. +func (in *Stickiness) DeepCopy() *Stickiness { + if in == nil { + return nil + } + out := new(Stickiness) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StickinessHash) DeepCopyInto(out *StickinessHash) { + *out = *in + if in.HttpCookie != nil { + in, out := &in.HttpCookie, &out.HttpCookie + *out = new(HTTPCookie) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StickinessHash. +func (in *StickinessHash) DeepCopy() *StickinessHash { + if in == nil { + return nil + } + out := new(StickinessHash) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantOperationWorkloadReference) DeepCopyInto(out *TenantOperationWorkloadReference) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantOperationWorkloadReference. +func (in *TenantOperationWorkloadReference) DeepCopy() *TenantOperationWorkloadReference { + if in == nil { + return nil + } + out := new(TenantOperationWorkloadReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TenantOperations) DeepCopyInto(out *TenantOperations) { + *out = *in + if in.Provisioning != nil { + in, out := &in.Provisioning, &out.Provisioning + *out = make([]TenantOperationWorkloadReference, len(*in)) + copy(*out, *in) + } + if in.Upgrade != nil { + in, out := &in.Upgrade, &out.Upgrade + *out = make([]TenantOperationWorkloadReference, len(*in)) + copy(*out, *in) + } + if in.Deprovisioning != nil { + in, out := &in.Deprovisioning, &out.Deprovisioning + *out = make([]TenantOperationWorkloadReference, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TenantOperations. +func (in *TenantOperations) DeepCopy() *TenantOperations { + if in == nil { + return nil + } + out := new(TenantOperations) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadDetails) DeepCopyInto(out *WorkloadDetails) { + *out = *in + if in.ConsumedBTPServices != nil { + in, out := &in.ConsumedBTPServices, &out.ConsumedBTPServices + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DeploymentDefinition != nil { + in, out := &in.DeploymentDefinition, &out.DeploymentDefinition + *out = new(DeploymentDetails) + (*in).DeepCopyInto(*out) + } + if in.JobDefinition != nil { + in, out := &in.JobDefinition, &out.JobDefinition + *out = new(JobDetails) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadDetails. +func (in *WorkloadDetails) DeepCopy() *WorkloadDetails { + if in == nil { + return nil + } + out := new(WorkloadDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadMonitoring) DeepCopyInto(out *WorkloadMonitoring) { + *out = *in + if in.DeletionRules != nil { + in, out := &in.DeletionRules, &out.DeletionRules + *out = new(DeletionRules) + (*in).DeepCopyInto(*out) + } + if in.ScrapeConfig != nil { + in, out := &in.ScrapeConfig, &out.ScrapeConfig + *out = new(MonitoringConfig) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadMonitoring. +func (in *WorkloadMonitoring) DeepCopy() *WorkloadMonitoring { + if in == nil { + return nil + } + out := new(WorkloadMonitoring) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go index 99f5ab97..02a0e310 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplication.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,6 +17,7 @@ import ( // CAPApplicationApplyConfiguration represents a declarative configuration of the CAPApplication type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplication is the schema for capapplications API type CAPApplicationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` @@ -23,7 +25,7 @@ type CAPApplicationApplyConfiguration struct { // CAPApplication spec Spec *CAPApplicationSpecApplyConfiguration `json:"spec,omitempty"` // CAPApplication status - Status *CAPApplicationStatusApplyConfiguration `json:"status,omitempty"` + Status *v1alpha2.CAPApplicationStatusApplyConfiguration `json:"status,omitempty"` } // CAPApplication constructs a declarative configuration of the CAPApplication type for use with @@ -208,7 +210,7 @@ func (b *CAPApplicationApplyConfiguration) WithSpec(value *CAPApplicationSpecApp // 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 *CAPApplicationApplyConfiguration) WithStatus(value *CAPApplicationStatusApplyConfiguration) *CAPApplicationApplyConfiguration { +func (b *CAPApplicationApplyConfiguration) WithStatus(value *v1alpha2.CAPApplicationStatusApplyConfiguration) *CAPApplicationApplyConfiguration { b.Status = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go index 8fba2be2..5b5d1066 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go @@ -7,29 +7,23 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 +import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" +) + // CAPApplicationSpecApplyConfiguration represents a declarative configuration of the CAPApplicationSpec type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplicationSpec defines the desired state of CAPApplication type CAPApplicationSpecApplyConfiguration struct { - // Reference to `Domain` resources used by the application - DomainRefs []DomainRefApplyConfiguration `json:"domainRefs,omitempty"` + // Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. + v1alpha2.CAPApplicationSpecApplyConfiguration `json:""` // Deprecated: Domains used by the application. Will be removed in future versions, use `DomainRefs` instead Domains *ApplicationDomainsApplyConfiguration `json:"domains,omitempty"` // Deprecated: SAP BTP Global Account Identifier where services are entitled for the current application // Will be removed soon, use ProviderSubaccountId instead GlobalAccountId *string `json:"globalAccountId,omitempty"` - // The subaccount ID in which the application is provided - ProviderSubaccountId *string `json:"providerSubaccountId,omitempty"` - // Short name for the application (BTP XSAPPNAME) - BTPAppName *string `json:"btpAppName,omitempty"` - // Deprecated: Provider subaccount where application services are created - // Will be removed, consider automating this via BTP / subscription instead! - Provider *BTPTenantIdentificationApplyConfiguration `json:"provider,omitempty"` - // SAP BTP Services consumed by the application - BTP *BTPApplyConfiguration `json:"btp,omitempty"` - // Rollout on Credentials Update may be used to rollout deployments when dependent service credentials are updated - RolloutOnCredentialUpdate *bool `json:"rolloutOnCredentialUpdate,omitempty"` } // CAPApplicationSpecApplyConfiguration constructs a declarative configuration of the CAPApplicationSpec type for use with @@ -41,37 +35,21 @@ func CAPApplicationSpec() *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 ...*DomainRefApplyConfiguration) *CAPApplicationSpecApplyConfiguration { +func (b *CAPApplicationSpecApplyConfiguration) WithDomainRefs(values ...*v1alpha2.DomainRefApplyConfiguration) *CAPApplicationSpecApplyConfiguration { for i := range values { if values[i] == nil { panic("nil value passed to WithDomainRefs") } - b.DomainRefs = append(b.DomainRefs, *values[i]) + b.CAPApplicationSpecApplyConfiguration.DomainRefs = append(b.CAPApplicationSpecApplyConfiguration.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. -func (b *CAPApplicationSpecApplyConfiguration) WithDomains(value *ApplicationDomainsApplyConfiguration) *CAPApplicationSpecApplyConfiguration { - b.Domains = value - return b -} - -// WithGlobalAccountId sets the GlobalAccountId 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 GlobalAccountId field is set to the value of the last call. -func (b *CAPApplicationSpecApplyConfiguration) WithGlobalAccountId(value string) *CAPApplicationSpecApplyConfiguration { - b.GlobalAccountId = &value - return b -} - // WithProviderSubaccountId sets the ProviderSubaccountId 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 ProviderSubaccountId field is set to the value of the last call. func (b *CAPApplicationSpecApplyConfiguration) WithProviderSubaccountId(value string) *CAPApplicationSpecApplyConfiguration { - b.ProviderSubaccountId = &value + b.CAPApplicationSpecApplyConfiguration.ProviderSubaccountId = &value return b } @@ -79,23 +57,23 @@ func (b *CAPApplicationSpecApplyConfiguration) WithProviderSubaccountId(value st // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the BTPAppName field is set to the value of the last call. func (b *CAPApplicationSpecApplyConfiguration) WithBTPAppName(value string) *CAPApplicationSpecApplyConfiguration { - b.BTPAppName = &value + b.CAPApplicationSpecApplyConfiguration.BTPAppName = &value return b } // WithProvider sets the Provider 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 Provider field is set to the value of the last call. -func (b *CAPApplicationSpecApplyConfiguration) WithProvider(value *BTPTenantIdentificationApplyConfiguration) *CAPApplicationSpecApplyConfiguration { - b.Provider = value +func (b *CAPApplicationSpecApplyConfiguration) WithProvider(value *v1alpha2.BTPTenantIdentificationApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + b.CAPApplicationSpecApplyConfiguration.Provider = value return b } // WithBTP sets the BTP 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 BTP field is set to the value of the last call. -func (b *CAPApplicationSpecApplyConfiguration) WithBTP(value *BTPApplyConfiguration) *CAPApplicationSpecApplyConfiguration { - b.BTP = value +func (b *CAPApplicationSpecApplyConfiguration) WithBTP(value *v1alpha2.BTPApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + b.CAPApplicationSpecApplyConfiguration.BTP = value return b } @@ -103,6 +81,22 @@ func (b *CAPApplicationSpecApplyConfiguration) WithBTP(value *BTPApplyConfigurat // and returns the receiver, so that objects can be built by chaining "With" function invocations. // If called multiple times, the RolloutOnCredentialUpdate field is set to the value of the last call. func (b *CAPApplicationSpecApplyConfiguration) WithRolloutOnCredentialUpdate(value bool) *CAPApplicationSpecApplyConfiguration { - b.RolloutOnCredentialUpdate = &value + b.CAPApplicationSpecApplyConfiguration.RolloutOnCredentialUpdate = &value + 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. +func (b *CAPApplicationSpecApplyConfiguration) WithDomains(value *ApplicationDomainsApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + b.Domains = value + return b +} + +// WithGlobalAccountId sets the GlobalAccountId 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 GlobalAccountId field is set to the value of the last call. +func (b *CAPApplicationSpecApplyConfiguration) WithGlobalAccountId(value string) *CAPApplicationSpecApplyConfiguration { + b.GlobalAccountId = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go index 82ff9603..459c3f04 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversion.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,14 +17,15 @@ import ( // CAPApplicationVersionApplyConfiguration represents a declarative configuration of the CAPApplicationVersion type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPApplicationVersion defines the schema for capapplicationversions API type CAPApplicationVersionApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPApplicationVersion spec - Spec *CAPApplicationVersionSpecApplyConfiguration `json:"spec,omitempty"` + Spec *v1alpha2.CAPApplicationVersionSpecApplyConfiguration `json:"spec,omitempty"` // CAPApplicationVersion status - Status *CAPApplicationVersionStatusApplyConfiguration `json:"status,omitempty"` + Status *v1alpha2.CAPApplicationVersionStatusApplyConfiguration `json:"status,omitempty"` } // CAPApplicationVersion constructs a declarative configuration of the CAPApplicationVersion type for use with @@ -200,7 +202,7 @@ func (b *CAPApplicationVersionApplyConfiguration) ensureObjectMetaApplyConfigura // 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 *CAPApplicationVersionApplyConfiguration) WithSpec(value *CAPApplicationVersionSpecApplyConfiguration) *CAPApplicationVersionApplyConfiguration { +func (b *CAPApplicationVersionApplyConfiguration) WithSpec(value *v1alpha2.CAPApplicationVersionSpecApplyConfiguration) *CAPApplicationVersionApplyConfiguration { b.Spec = value return b } @@ -208,7 +210,7 @@ func (b *CAPApplicationVersionApplyConfiguration) WithSpec(value *CAPApplication // 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 *CAPApplicationVersionApplyConfiguration) WithStatus(value *CAPApplicationVersionStatusApplyConfiguration) *CAPApplicationVersionApplyConfiguration { +func (b *CAPApplicationVersionApplyConfiguration) WithStatus(value *v1alpha2.CAPApplicationVersionStatusApplyConfiguration) *CAPApplicationVersionApplyConfiguration { b.Status = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go index b2edf3f6..f99883d7 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenant.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,14 +17,15 @@ import ( // CAPTenantApplyConfiguration represents a declarative configuration of the CAPTenant type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenant defines the schema for captenants API type CAPTenantApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPTenant spec - Spec *CAPTenantSpecApplyConfiguration `json:"spec,omitempty"` + Spec *v1alpha2.CAPTenantSpecApplyConfiguration `json:"spec,omitempty"` // CAPTenant status - Status *CAPTenantStatusApplyConfiguration `json:"status,omitempty"` + Status *v1alpha2.CAPTenantStatusApplyConfiguration `json:"status,omitempty"` } // CAPTenant constructs a declarative configuration of the CAPTenant type for use with @@ -200,7 +202,7 @@ func (b *CAPTenantApplyConfiguration) ensureObjectMetaApplyConfigurationExists() // 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 *CAPTenantApplyConfiguration) WithSpec(value *CAPTenantSpecApplyConfiguration) *CAPTenantApplyConfiguration { +func (b *CAPTenantApplyConfiguration) WithSpec(value *v1alpha2.CAPTenantSpecApplyConfiguration) *CAPTenantApplyConfiguration { b.Spec = value return b } @@ -208,7 +210,7 @@ func (b *CAPTenantApplyConfiguration) WithSpec(value *CAPTenantSpecApplyConfigur // 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 *CAPTenantApplyConfiguration) WithStatus(value *CAPTenantStatusApplyConfiguration) *CAPTenantApplyConfiguration { +func (b *CAPTenantApplyConfiguration) WithStatus(value *v1alpha2.CAPTenantStatusApplyConfiguration) *CAPTenantApplyConfiguration { b.Status = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go index f689b26a..315e030d 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperation.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,14 +17,15 @@ import ( // CAPTenantOperationApplyConfiguration represents a declarative configuration of the CAPTenantOperation type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantOperation defines the schema for captenantoperations API type CAPTenantOperationApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPTenantOperation spec - Spec *CAPTenantOperationSpecApplyConfiguration `json:"spec,omitempty"` + Spec *v1alpha2.CAPTenantOperationSpecApplyConfiguration `json:"spec,omitempty"` // CAPTenantOperation status - Status *CAPTenantOperationStatusApplyConfiguration `json:"status,omitempty"` + Status *v1alpha2.CAPTenantOperationStatusApplyConfiguration `json:"status,omitempty"` } // CAPTenantOperation constructs a declarative configuration of the CAPTenantOperation type for use with @@ -200,7 +202,7 @@ func (b *CAPTenantOperationApplyConfiguration) ensureObjectMetaApplyConfiguratio // 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 *CAPTenantOperationApplyConfiguration) WithSpec(value *CAPTenantOperationSpecApplyConfiguration) *CAPTenantOperationApplyConfiguration { +func (b *CAPTenantOperationApplyConfiguration) WithSpec(value *v1alpha2.CAPTenantOperationSpecApplyConfiguration) *CAPTenantOperationApplyConfiguration { b.Spec = value return b } @@ -208,7 +210,7 @@ func (b *CAPTenantOperationApplyConfiguration) WithSpec(value *CAPTenantOperatio // 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 *CAPTenantOperationApplyConfiguration) WithStatus(value *CAPTenantOperationStatusApplyConfiguration) *CAPTenantOperationApplyConfiguration { +func (b *CAPTenantOperationApplyConfiguration) WithStatus(value *v1alpha2.CAPTenantOperationStatusApplyConfiguration) *CAPTenantOperationApplyConfiguration { b.Status = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go index 50934e34..62832777 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutput.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,12 +17,13 @@ import ( // CAPTenantOutputApplyConfiguration represents a declarative configuration of the CAPTenantOutput type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // CAPTenantOutput is the schema for captenantoutputs API type CAPTenantOutputApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // CAPTenantOutput spec - Spec *CAPTenantOutputSpecApplyConfiguration `json:"spec,omitempty"` + Spec *v1alpha2.CAPTenantOutputSpecApplyConfiguration `json:"spec,omitempty"` } // CAPTenantOutput constructs a declarative configuration of the CAPTenantOutput type for use with @@ -198,7 +200,7 @@ func (b *CAPTenantOutputApplyConfiguration) ensureObjectMetaApplyConfigurationEx // 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 *CAPTenantOutputApplyConfiguration) WithSpec(value *CAPTenantOutputSpecApplyConfiguration) *CAPTenantOutputApplyConfiguration { +func (b *CAPTenantOutputApplyConfiguration) WithSpec(value *v1alpha2.CAPTenantOutputSpecApplyConfiguration) *CAPTenantOutputApplyConfiguration { b.Spec = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go index d332ee80..bb07ef88 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/clusterdomain.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,14 +17,15 @@ import ( // ClusterDomainApplyConfiguration represents a declarative configuration of the ClusterDomain type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // ClusterDomain is the schema for clusterdomains API type ClusterDomainApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // ClusterDomains spec - Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` + Spec *v1alpha2.DomainSpecApplyConfiguration `json:"spec,omitempty"` // ClusterDomain status - Status *DomainStatusApplyConfiguration `json:"status,omitempty"` + Status *v1alpha2.DomainStatusApplyConfiguration `json:"status,omitempty"` } // ClusterDomain constructs a declarative configuration of the ClusterDomain type for use with @@ -200,7 +202,7 @@ func (b *ClusterDomainApplyConfiguration) ensureObjectMetaApplyConfigurationExis // 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 { +func (b *ClusterDomainApplyConfiguration) WithSpec(value *v1alpha2.DomainSpecApplyConfiguration) *ClusterDomainApplyConfiguration { b.Spec = value return b } @@ -208,7 +210,7 @@ func (b *ClusterDomainApplyConfiguration) WithSpec(value *DomainSpecApplyConfigu // 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 { +func (b *ClusterDomainApplyConfiguration) WithStatus(value *v1alpha2.DomainStatusApplyConfiguration) *ClusterDomainApplyConfiguration { b.Status = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go index 55f0fd93..aca49882 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domain.go @@ -8,6 +8,7 @@ SPDX-License-Identifier: Apache-2.0 package v1alpha1 import ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" v1 "k8s.io/client-go/applyconfigurations/meta/v1" @@ -16,14 +17,15 @@ import ( // DomainApplyConfiguration represents a declarative configuration of the Domain type for use // with apply. // +// Deprecated: sme.sap.com/v1alpha1 is replaced by sme.sap.com/v1alpha2, use the corresponding types/resources from v1alpha2. // Domain is the schema for domains API type DomainApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:""` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` // Domains spec - Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` + Spec *v1alpha2.DomainSpecApplyConfiguration `json:"spec,omitempty"` // Domain status - Status *DomainStatusApplyConfiguration `json:"status,omitempty"` + Status *v1alpha2.DomainStatusApplyConfiguration `json:"status,omitempty"` } // Domain constructs a declarative configuration of the Domain type for use with @@ -200,7 +202,7 @@ func (b *DomainApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { // 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 { +func (b *DomainApplyConfiguration) WithSpec(value *v1alpha2.DomainSpecApplyConfiguration) *DomainApplyConfiguration { b.Spec = value return b } @@ -208,7 +210,7 @@ func (b *DomainApplyConfiguration) WithSpec(value *DomainSpecApplyConfiguration) // 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 { +func (b *DomainApplyConfiguration) WithStatus(value *v1alpha2.DomainStatusApplyConfiguration) *DomainApplyConfiguration { b.Status = value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/btp.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/btp.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/btp.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/btp.go index 6590d3de..829344a2 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/btp.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/btp.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // BTPApplyConfiguration represents a declarative configuration of the BTP type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/btptenantidentification.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/btptenantidentification.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/btptenantidentification.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/btptenantidentification.go index 5ed74251..c895bf65 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/btptenantidentification.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/btptenantidentification.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // BTPTenantIdentificationApplyConfiguration represents a declarative configuration of the BTPTenantIdentification type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplication.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplication.go new file mode 100644 index 00000000..5c7ced50 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplication.go @@ -0,0 +1,236 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CAPApplicationApplyConfiguration represents a declarative configuration of the CAPApplication type for use +// with apply. +// +// CAPApplication is the schema for capapplications API +type CAPApplicationApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // CAPApplication spec + Spec *CAPApplicationSpecApplyConfiguration `json:"spec,omitempty"` + // CAPApplication status + Status *CAPApplicationStatusApplyConfiguration `json:"status,omitempty"` +} + +// CAPApplication constructs a declarative configuration of the CAPApplication type for use with +// apply. +func CAPApplication(name, namespace string) *CAPApplicationApplyConfiguration { + b := &CAPApplicationApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CAPApplication") + b.WithAPIVersion("sme.sap.com/v1alpha2") + return b +} + +func (b CAPApplicationApplyConfiguration) IsApplyConfiguration() {} + +// 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 *CAPApplicationApplyConfiguration) WithKind(value string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithAPIVersion(value string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithName(value string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithGenerateName(value string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithNamespace(value string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithUID(value types.UID) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithResourceVersion(value string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithGeneration(value int64) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithLabels(entries map[string]string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithAnnotations(entries map[string]string) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithFinalizers(values ...string) *CAPApplicationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *CAPApplicationApplyConfiguration) 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 *CAPApplicationApplyConfiguration) WithSpec(value *CAPApplicationSpecApplyConfiguration) *CAPApplicationApplyConfiguration { + 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 *CAPApplicationApplyConfiguration) WithStatus(value *CAPApplicationStatusApplyConfiguration) *CAPApplicationApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *CAPApplicationApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *CAPApplicationApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CAPApplicationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *CAPApplicationApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationspec.go new file mode 100644 index 00000000..bd364d97 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationspec.go @@ -0,0 +1,87 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +// CAPApplicationSpecApplyConfiguration represents a declarative configuration of the CAPApplicationSpec type for use +// with apply. +// +// CAPApplicationSpec defines the desired state of CAPApplication +type CAPApplicationSpecApplyConfiguration struct { + // Reference to `Domain` resources used by the application + DomainRefs []DomainRefApplyConfiguration `json:"domainRefs,omitempty"` + // The subaccount ID in which the application is provided + ProviderSubaccountId *string `json:"providerSubaccountId,omitempty"` + // Short name for the application (BTP XSAPPNAME) + BTPAppName *string `json:"btpAppName,omitempty"` + // Deprecated: Provider subaccount where application services are created + // Will be removed, consider automating this via BTP / subscription instead! + Provider *BTPTenantIdentificationApplyConfiguration `json:"provider,omitempty"` + // SAP BTP Services consumed by the application + BTP *BTPApplyConfiguration `json:"btp,omitempty"` + // Rollout on Credentials Update may be used to rollout deployments when dependent service credentials are updated + RolloutOnCredentialUpdate *bool `json:"rolloutOnCredentialUpdate,omitempty"` +} + +// CAPApplicationSpecApplyConfiguration constructs a declarative configuration of the CAPApplicationSpec type for use with +// apply. +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 ...*DomainRefApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithDomainRefs") + } + b.DomainRefs = append(b.DomainRefs, *values[i]) + } + return b +} + +// WithProviderSubaccountId sets the ProviderSubaccountId 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 ProviderSubaccountId field is set to the value of the last call. +func (b *CAPApplicationSpecApplyConfiguration) WithProviderSubaccountId(value string) *CAPApplicationSpecApplyConfiguration { + b.ProviderSubaccountId = &value + return b +} + +// WithBTPAppName sets the BTPAppName 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 BTPAppName field is set to the value of the last call. +func (b *CAPApplicationSpecApplyConfiguration) WithBTPAppName(value string) *CAPApplicationSpecApplyConfiguration { + b.BTPAppName = &value + return b +} + +// WithProvider sets the Provider 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 Provider field is set to the value of the last call. +func (b *CAPApplicationSpecApplyConfiguration) WithProvider(value *BTPTenantIdentificationApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + b.Provider = value + return b +} + +// WithBTP sets the BTP 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 BTP field is set to the value of the last call. +func (b *CAPApplicationSpecApplyConfiguration) WithBTP(value *BTPApplyConfiguration) *CAPApplicationSpecApplyConfiguration { + b.BTP = value + return b +} + +// WithRolloutOnCredentialUpdate sets the RolloutOnCredentialUpdate 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 RolloutOnCredentialUpdate field is set to the value of the last call. +func (b *CAPApplicationSpecApplyConfiguration) WithRolloutOnCredentialUpdate(value bool) *CAPApplicationSpecApplyConfiguration { + b.RolloutOnCredentialUpdate = &value + return b +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationstatus.go similarity index 95% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationstatus.go index 8b6e81df..389f9715 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationstatus.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -18,7 +18,7 @@ import ( type CAPApplicationStatusApplyConfiguration struct { GenericStatusApplyConfiguration `json:""` // State of CAPApplication - State *smesapcomv1alpha1.CAPApplicationState `json:"state,omitempty"` + State *smesapcomv1alpha2.CAPApplicationState `json:"state,omitempty"` // Represents whether this is a services only scenario ServicesOnly *bool `json:"servicesOnly,omitempty"` // Hash representing last known application domains @@ -59,7 +59,7 @@ func (b *CAPApplicationStatusApplyConfiguration) WithConditions(values ...*metav // 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 *CAPApplicationStatusApplyConfiguration) WithState(value smesapcomv1alpha1.CAPApplicationState) *CAPApplicationStatusApplyConfiguration { +func (b *CAPApplicationStatusApplyConfiguration) WithState(value smesapcomv1alpha2.CAPApplicationState) *CAPApplicationStatusApplyConfiguration { b.State = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversion.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversion.go new file mode 100644 index 00000000..c55d00e9 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversion.go @@ -0,0 +1,236 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CAPApplicationVersionApplyConfiguration represents a declarative configuration of the CAPApplicationVersion type for use +// with apply. +// +// CAPApplicationVersion defines the schema for capapplicationversions API +type CAPApplicationVersionApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // CAPApplicationVersion spec + Spec *CAPApplicationVersionSpecApplyConfiguration `json:"spec,omitempty"` + // CAPApplicationVersion status + Status *CAPApplicationVersionStatusApplyConfiguration `json:"status,omitempty"` +} + +// CAPApplicationVersion constructs a declarative configuration of the CAPApplicationVersion type for use with +// apply. +func CAPApplicationVersion(name, namespace string) *CAPApplicationVersionApplyConfiguration { + b := &CAPApplicationVersionApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CAPApplicationVersion") + b.WithAPIVersion("sme.sap.com/v1alpha2") + return b +} + +func (b CAPApplicationVersionApplyConfiguration) IsApplyConfiguration() {} + +// 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 *CAPApplicationVersionApplyConfiguration) WithKind(value string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithAPIVersion(value string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithName(value string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithGenerateName(value string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithNamespace(value string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithUID(value types.UID) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithResourceVersion(value string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithGeneration(value int64) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithLabels(entries map[string]string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithAnnotations(entries map[string]string) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithFinalizers(values ...string) *CAPApplicationVersionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *CAPApplicationVersionApplyConfiguration) 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 *CAPApplicationVersionApplyConfiguration) WithSpec(value *CAPApplicationVersionSpecApplyConfiguration) *CAPApplicationVersionApplyConfiguration { + 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 *CAPApplicationVersionApplyConfiguration) WithStatus(value *CAPApplicationVersionStatusApplyConfiguration) *CAPApplicationVersionApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *CAPApplicationVersionApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *CAPApplicationVersionApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CAPApplicationVersionApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *CAPApplicationVersionApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversionspec.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionspec.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversionspec.go index 6cd12c33..702b80a1 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversionspec.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // CAPApplicationVersionSpecApplyConfiguration represents a declarative configuration of the CAPApplicationVersionSpec type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversionstatus.go similarity index 93% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversionstatus.go index 739a5cbd..034c32cd 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationversionstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/capapplicationversionstatus.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -17,7 +17,7 @@ import ( type CAPApplicationVersionStatusApplyConfiguration struct { GenericStatusApplyConfiguration `json:""` // State of CAPApplicationVersion - State *smesapcomv1alpha1.CAPApplicationVersionState `json:"state,omitempty"` + State *smesapcomv1alpha2.CAPApplicationVersionState `json:"state,omitempty"` // List of finished Content Jobs FinishedJobs []string `json:"finishedJobs,omitempty"` } @@ -52,7 +52,7 @@ func (b *CAPApplicationVersionStatusApplyConfiguration) WithConditions(values .. // 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 *CAPApplicationVersionStatusApplyConfiguration) WithState(value smesapcomv1alpha1.CAPApplicationVersionState) *CAPApplicationVersionStatusApplyConfiguration { +func (b *CAPApplicationVersionStatusApplyConfiguration) WithState(value smesapcomv1alpha2.CAPApplicationVersionState) *CAPApplicationVersionStatusApplyConfiguration { b.State = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenant.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenant.go new file mode 100644 index 00000000..12000b46 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenant.go @@ -0,0 +1,236 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CAPTenantApplyConfiguration represents a declarative configuration of the CAPTenant type for use +// with apply. +// +// CAPTenant defines the schema for captenants API +type CAPTenantApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // CAPTenant spec + Spec *CAPTenantSpecApplyConfiguration `json:"spec,omitempty"` + // CAPTenant status + Status *CAPTenantStatusApplyConfiguration `json:"status,omitempty"` +} + +// CAPTenant constructs a declarative configuration of the CAPTenant type for use with +// apply. +func CAPTenant(name, namespace string) *CAPTenantApplyConfiguration { + b := &CAPTenantApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CAPTenant") + b.WithAPIVersion("sme.sap.com/v1alpha2") + return b +} + +func (b CAPTenantApplyConfiguration) IsApplyConfiguration() {} + +// 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 *CAPTenantApplyConfiguration) WithKind(value string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithAPIVersion(value string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithName(value string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithGenerateName(value string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithNamespace(value string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithUID(value types.UID) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithResourceVersion(value string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithGeneration(value int64) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithLabels(entries map[string]string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithAnnotations(entries map[string]string) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithFinalizers(values ...string) *CAPTenantApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *CAPTenantApplyConfiguration) 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 *CAPTenantApplyConfiguration) WithSpec(value *CAPTenantSpecApplyConfiguration) *CAPTenantApplyConfiguration { + 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 *CAPTenantApplyConfiguration) WithStatus(value *CAPTenantStatusApplyConfiguration) *CAPTenantApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *CAPTenantApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *CAPTenantApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CAPTenantApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *CAPTenantApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperation.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperation.go new file mode 100644 index 00000000..2b928408 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperation.go @@ -0,0 +1,236 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CAPTenantOperationApplyConfiguration represents a declarative configuration of the CAPTenantOperation type for use +// with apply. +// +// CAPTenantOperation defines the schema for captenantoperations API +type CAPTenantOperationApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // CAPTenantOperation spec + Spec *CAPTenantOperationSpecApplyConfiguration `json:"spec,omitempty"` + // CAPTenantOperation status + Status *CAPTenantOperationStatusApplyConfiguration `json:"status,omitempty"` +} + +// CAPTenantOperation constructs a declarative configuration of the CAPTenantOperation type for use with +// apply. +func CAPTenantOperation(name, namespace string) *CAPTenantOperationApplyConfiguration { + b := &CAPTenantOperationApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CAPTenantOperation") + b.WithAPIVersion("sme.sap.com/v1alpha2") + return b +} + +func (b CAPTenantOperationApplyConfiguration) IsApplyConfiguration() {} + +// 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 *CAPTenantOperationApplyConfiguration) WithKind(value string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithAPIVersion(value string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithName(value string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithGenerateName(value string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithNamespace(value string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithUID(value types.UID) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithResourceVersion(value string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithGeneration(value int64) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithLabels(entries map[string]string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithAnnotations(entries map[string]string) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithFinalizers(values ...string) *CAPTenantOperationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *CAPTenantOperationApplyConfiguration) 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 *CAPTenantOperationApplyConfiguration) WithSpec(value *CAPTenantOperationSpecApplyConfiguration) *CAPTenantOperationApplyConfiguration { + 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 *CAPTenantOperationApplyConfiguration) WithStatus(value *CAPTenantOperationStatusApplyConfiguration) *CAPTenantOperationApplyConfiguration { + b.Status = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *CAPTenantOperationApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *CAPTenantOperationApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CAPTenantOperationApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *CAPTenantOperationApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationspec.go similarity index 94% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationspec.go index 6180997f..43564ced 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationspec.go @@ -5,17 +5,17 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // CAPTenantOperationSpecApplyConfiguration represents a declarative configuration of the CAPTenantOperationSpec type for use // with apply. type CAPTenantOperationSpecApplyConfiguration struct { // Scope of the tenant lifecycle operation. One of 'provisioning', 'deprovisioning' or 'upgrade' - Operation *smesapcomv1alpha1.CAPTenantOperationType `json:"operation,omitempty"` + Operation *smesapcomv1alpha2.CAPTenantOperationType `json:"operation,omitempty"` // BTP sub-account (tenant) for which request is created BTPTenantIdentificationApplyConfiguration `json:""` // Reference to CAPApplicationVersion for executing the operation @@ -33,7 +33,7 @@ func CAPTenantOperationSpec() *CAPTenantOperationSpecApplyConfiguration { // WithOperation sets the Operation 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 Operation field is set to the value of the last call. -func (b *CAPTenantOperationSpecApplyConfiguration) WithOperation(value smesapcomv1alpha1.CAPTenantOperationType) *CAPTenantOperationSpecApplyConfiguration { +func (b *CAPTenantOperationSpecApplyConfiguration) WithOperation(value smesapcomv1alpha2.CAPTenantOperationType) *CAPTenantOperationSpecApplyConfiguration { b.Operation = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationstatus.go similarity index 94% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationstatus.go index e2a6ac25..f4355fb8 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationstatus.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -17,7 +17,7 @@ import ( type CAPTenantOperationStatusApplyConfiguration struct { GenericStatusApplyConfiguration `json:""` // State of CAPTenantOperation - State *smesapcomv1alpha1.CAPTenantOperationState `json:"state,omitempty"` + State *smesapcomv1alpha2.CAPTenantOperationState `json:"state,omitempty"` // Current step being processed from the sequence of specified steps CurrentStep *uint32 `json:"currentStep,omitempty"` // Name of the job being executed for the current step @@ -54,7 +54,7 @@ func (b *CAPTenantOperationStatusApplyConfiguration) WithConditions(values ...*v // 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 *CAPTenantOperationStatusApplyConfiguration) WithState(value smesapcomv1alpha1.CAPTenantOperationState) *CAPTenantOperationStatusApplyConfiguration { +func (b *CAPTenantOperationStatusApplyConfiguration) WithState(value smesapcomv1alpha2.CAPTenantOperationState) *CAPTenantOperationStatusApplyConfiguration { b.State = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstep.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationstep.go similarity index 91% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstep.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationstep.go index bd7a96da..ca4ce710 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoperationstep.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoperationstep.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // CAPTenantOperationStepApplyConfiguration represents a declarative configuration of the CAPTenantOperationStep type for use @@ -17,7 +17,7 @@ type CAPTenantOperationStepApplyConfiguration struct { // Name of the workload from the referenced CAPApplicationVersion Name *string `json:"name,omitempty"` // Type of job. One of 'TenantOperation' or 'CustomTenantOperation' - Type *smesapcomv1alpha1.JobType `json:"type,omitempty"` + Type *smesapcomv1alpha2.JobType `json:"type,omitempty"` // Indicates whether the operation can continue in case of step failure. Relevant only for type 'CustomTenantOperation' ContinueOnFailure *bool `json:"continueOnFailure,omitempty"` } @@ -39,7 +39,7 @@ func (b *CAPTenantOperationStepApplyConfiguration) WithName(value string) *CAPTe // WithType sets the Type 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 Type field is set to the value of the last call. -func (b *CAPTenantOperationStepApplyConfiguration) WithType(value smesapcomv1alpha1.JobType) *CAPTenantOperationStepApplyConfiguration { +func (b *CAPTenantOperationStepApplyConfiguration) WithType(value smesapcomv1alpha2.JobType) *CAPTenantOperationStepApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoutput.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoutput.go new file mode 100644 index 00000000..2980fc45 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoutput.go @@ -0,0 +1,226 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + v1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// CAPTenantOutputApplyConfiguration represents a declarative configuration of the CAPTenantOutput type for use +// with apply. +// +// CAPTenantOutput is the schema for captenantoutputs API +type CAPTenantOutputApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // CAPTenantOutput spec + Spec *CAPTenantOutputSpecApplyConfiguration `json:"spec,omitempty"` +} + +// CAPTenantOutput constructs a declarative configuration of the CAPTenantOutput type for use with +// apply. +func CAPTenantOutput(name, namespace string) *CAPTenantOutputApplyConfiguration { + b := &CAPTenantOutputApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("CAPTenantOutput") + b.WithAPIVersion("sme.sap.com/v1alpha2") + return b +} + +func (b CAPTenantOutputApplyConfiguration) IsApplyConfiguration() {} + +// 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 *CAPTenantOutputApplyConfiguration) WithKind(value string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithAPIVersion(value string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithName(value string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithGenerateName(value string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithNamespace(value string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithUID(value types.UID) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithResourceVersion(value string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithGeneration(value int64) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithLabels(entries map[string]string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithAnnotations(entries map[string]string) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CAPTenantOutputApplyConfiguration { + 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 *CAPTenantOutputApplyConfiguration) WithFinalizers(values ...string) *CAPTenantOutputApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i]) + } + return b +} + +func (b *CAPTenantOutputApplyConfiguration) 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 *CAPTenantOutputApplyConfiguration) WithSpec(value *CAPTenantOutputSpecApplyConfiguration) *CAPTenantOutputApplyConfiguration { + b.Spec = value + return b +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *CAPTenantOutputApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *CAPTenantOutputApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *CAPTenantOutputApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *CAPTenantOutputApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutputspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoutputspec.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutputspec.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoutputspec.go index 67141379..ec45c9c1 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantoutputspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantoutputspec.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // CAPTenantOutputSpecApplyConfiguration represents a declarative configuration of the CAPTenantOutputSpec type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantspec.go similarity index 94% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantspec.go index 8637e57b..2f1ab9b6 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantspec.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // CAPTenantSpecApplyConfiguration represents a declarative configuration of the CAPTenantSpec type for use @@ -23,7 +23,7 @@ type CAPTenantSpecApplyConfiguration struct { // Semver that is used to determine the relevant CAPApplicationVersion that a CAPTenant can be upgraded to (i.e. if it is not already on that version) Version *string `json:"version,omitempty"` // Denotes whether a CAPTenant can be upgraded. One of ('always', 'never') - VersionUpgradeStrategy *smesapcomv1alpha1.VersionUpgradeStrategyType `json:"versionUpgradeStrategy,omitempty"` + VersionUpgradeStrategy *smesapcomv1alpha2.VersionUpgradeStrategyType `json:"versionUpgradeStrategy,omitempty"` } // CAPTenantSpecApplyConfiguration constructs a declarative configuration of the CAPTenantSpec type for use with @@ -67,7 +67,7 @@ func (b *CAPTenantSpecApplyConfiguration) WithVersion(value string) *CAPTenantSp // WithVersionUpgradeStrategy sets the VersionUpgradeStrategy 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 VersionUpgradeStrategy field is set to the value of the last call. -func (b *CAPTenantSpecApplyConfiguration) WithVersionUpgradeStrategy(value smesapcomv1alpha1.VersionUpgradeStrategyType) *CAPTenantSpecApplyConfiguration { +func (b *CAPTenantSpecApplyConfiguration) WithVersionUpgradeStrategy(value smesapcomv1alpha2.VersionUpgradeStrategyType) *CAPTenantSpecApplyConfiguration { b.VersionUpgradeStrategy = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantstatus.go similarity index 95% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantstatus.go index ffe27f85..c4e3db1f 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/captenantstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/captenantstatus.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -18,7 +18,7 @@ import ( type CAPTenantStatusApplyConfiguration struct { GenericStatusApplyConfiguration `json:""` // State of CAPTenant - State *smesapcomv1alpha1.CAPTenantState `json:"state,omitempty"` + State *smesapcomv1alpha2.CAPTenantState `json:"state,omitempty"` // Specifies the current version of the tenant after provisioning or upgrade CurrentCAPApplicationVersionInstance *string `json:"currentCAPApplicationVersionInstance,omitempty"` // Previous versions of the tenant (first to last) @@ -57,7 +57,7 @@ func (b *CAPTenantStatusApplyConfiguration) WithConditions(values ...*metav1.Con // 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 *CAPTenantStatusApplyConfiguration) WithState(value smesapcomv1alpha1.CAPTenantState) *CAPTenantStatusApplyConfiguration { +func (b *CAPTenantStatusApplyConfiguration) WithState(value smesapcomv1alpha2.CAPTenantState) *CAPTenantStatusApplyConfiguration { b.State = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/certconfig.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/certconfig.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/certconfig.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/certconfig.go index a2d49eb1..8c8fbe21 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/certconfig.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/certconfig.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // CertConfigApplyConfiguration represents a declarative configuration of the CertConfig type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/certmanager.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/certmanager.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/certmanager.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/certmanager.go index 74d885cb..cffb6ac5 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/certmanager.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/certmanager.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( v1 "github.com/cert-manager/cert-manager/pkg/apis/meta/v1" diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/clusterdomain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/clusterdomain.go new file mode 100644 index 00000000..f6491dc2 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/clusterdomain.go @@ -0,0 +1,236 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +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. +// +// ClusterDomain is the schema for clusterdomains API +type ClusterDomainApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // ClusterDomains spec + Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` + // ClusterDomain status + 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/v1alpha2") + return b +} + +func (b ClusterDomainApplyConfiguration) IsApplyConfiguration() {} + +// 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 +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *ClusterDomainApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *ClusterDomainApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *ClusterDomainApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *ClusterDomainApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/commondetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/commondetails.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/commondetails.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/commondetails.go index 53adffc2..b6a73cb4 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/commondetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/commondetails.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( v1 "k8s.io/api/core/v1" diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deletionrules.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/deletionrules.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deletionrules.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/deletionrules.go index 860e2ade..ec9f08ad 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deletionrules.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/deletionrules.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // DeletionRulesApplyConfiguration represents a declarative configuration of the DeletionRules type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/deploymentdetails.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/deploymentdetails.go index 64262d97..cc223f2d 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/deploymentdetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/deploymentdetails.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/api/core/v1" policyv1 "k8s.io/api/policy/v1" ) @@ -20,7 +20,7 @@ import ( type DeploymentDetailsApplyConfiguration struct { CommonDetailsApplyConfiguration `json:""` // Type of the Deployment - Type *smesapcomv1alpha1.DeploymentType `json:"type,omitempty"` + Type *smesapcomv1alpha2.DeploymentType `json:"type,omitempty"` // Number of replicas Replicas *int32 `json:"replicas,omitempty"` // Port configuration @@ -240,7 +240,7 @@ func (b *DeploymentDetailsApplyConfiguration) WithLifecycle(value v1.Lifecycle) // WithType sets the Type 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 Type field is set to the value of the last call. -func (b *DeploymentDetailsApplyConfiguration) WithType(value smesapcomv1alpha1.DeploymentType) *DeploymentDetailsApplyConfiguration { +func (b *DeploymentDetailsApplyConfiguration) WithType(value smesapcomv1alpha2.DeploymentType) *DeploymentDetailsApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/dnstemplate.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/dnstemplate.go index 8e283f9f..1eb3936a 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/dnstemplate.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // DNSTemplateApplyConfiguration represents a declarative configuration of the DNSTemplate type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domain.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domain.go new file mode 100644 index 00000000..38e245a1 --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domain.go @@ -0,0 +1,236 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +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. +// +// Domain is the schema for domains API +type DomainApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:""` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + // Domains spec + Spec *DomainSpecApplyConfiguration `json:"spec,omitempty"` + // Domain status + 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/v1alpha2") + return b +} + +func (b DomainApplyConfiguration) IsApplyConfiguration() {} + +// 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 +} + +// GetKind retrieves the value of the Kind field in the declarative configuration. +func (b *DomainApplyConfiguration) GetKind() *string { + return b.TypeMetaApplyConfiguration.Kind +} + +// GetAPIVersion retrieves the value of the APIVersion field in the declarative configuration. +func (b *DomainApplyConfiguration) GetAPIVersion() *string { + return b.TypeMetaApplyConfiguration.APIVersion +} + +// GetName retrieves the value of the Name field in the declarative configuration. +func (b *DomainApplyConfiguration) GetName() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Name +} + +// GetNamespace retrieves the value of the Namespace field in the declarative configuration. +func (b *DomainApplyConfiguration) GetNamespace() *string { + b.ensureObjectMetaApplyConfigurationExists() + return b.ObjectMetaApplyConfiguration.Namespace +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainref.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainref.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainref.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainref.go index 47d4bd98..5601a39d 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainref.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainref.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // DomainRefApplyConfiguration represents a declarative configuration of the DomainRef type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainspec.go similarity index 93% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainspec.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainspec.go index d8205198..6a3c87f2 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainspec.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // DomainSpecApplyConfiguration represents a declarative configuration of the DomainSpec type for use @@ -19,9 +19,9 @@ type DomainSpecApplyConfiguration struct { // Selector is the set of labels used to select the ingress pods handling the domain IngressSelector map[string]string `json:"ingressSelector,omitempty"` // TLS mode for the generated (Istio) Gateway resource. Set this to Mutual when using mTLS with an external gateway. - TLSMode *smesapcomv1alpha1.TLSMode `json:"tlsMode,omitempty"` + TLSMode *smesapcomv1alpha2.TLSMode `json:"tlsMode,omitempty"` // DNS mode controls the creation of DNS entries related to the domain - DNSMode *smesapcomv1alpha1.DNSMode `json:"dnsMode,omitempty"` + DNSMode *smesapcomv1alpha2.DNSMode `json:"dnsMode,omitempty"` // DNS templates allows usage of go templates for generating DNS entries when [DNSMode] is set to `Custom` DNSTemplates []DNSTemplateApplyConfiguration `json:"dnsTemplates,omitempty"` // DNS Target for traffic to this domain @@ -61,7 +61,7 @@ func (b *DomainSpecApplyConfiguration) WithIngressSelector(entries map[string]st // 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 { +func (b *DomainSpecApplyConfiguration) WithTLSMode(value smesapcomv1alpha2.TLSMode) *DomainSpecApplyConfiguration { b.TLSMode = &value return b } @@ -69,7 +69,7 @@ func (b *DomainSpecApplyConfiguration) WithTLSMode(value smesapcomv1alpha1.TLSMo // 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 { +func (b *DomainSpecApplyConfiguration) WithDNSMode(value smesapcomv1alpha2.DNSMode) *DomainSpecApplyConfiguration { b.DNSMode = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainstatus.go similarity index 94% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainstatus.go index b6dd018f..bf1e21d0 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/domainstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/domainstatus.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/client-go/applyconfigurations/meta/v1" ) @@ -17,7 +17,7 @@ import ( type DomainStatusApplyConfiguration struct { GenericStatusApplyConfiguration `json:""` // State of the Domain - State *smesapcomv1alpha1.DomainState `json:"state,omitempty"` + State *smesapcomv1alpha2.DomainState `json:"state,omitempty"` // Effective DNS Target identified for this domain DnsTarget *string `json:"dnsTarget,omitempty"` // Gateway name used for the domain @@ -56,7 +56,7 @@ func (b *DomainStatusApplyConfiguration) WithConditions(values ...*v1.ConditionA // 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 { +func (b *DomainStatusApplyConfiguration) WithState(value smesapcomv1alpha2.DomainState) *DomainStatusApplyConfiguration { b.State = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/genericstatus.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/genericstatus.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/genericstatus.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/genericstatus.go index 543eb843..fc6660ad 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/genericstatus.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/genericstatus.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( v1 "k8s.io/client-go/applyconfigurations/meta/v1" diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/horizontalpodautoscalerspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/horizontalpodautoscalerspec.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/horizontalpodautoscalerspec.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/horizontalpodautoscalerspec.go index b8e9f3f1..af464655 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/horizontalpodautoscalerspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/horizontalpodautoscalerspec.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( v2 "k8s.io/api/autoscaling/v2" diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/httpcookie.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/httpcookie.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/httpcookie.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/httpcookie.go index e7b25f38..aa8ac8a0 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/httpcookie.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/httpcookie.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/jobdetails.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/jobdetails.go index 028c9112..61ce5b75 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/jobdetails.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/api/core/v1" ) @@ -19,7 +19,7 @@ import ( type JobDetailsApplyConfiguration struct { CommonDetailsApplyConfiguration `json:""` // Type of Job - Type *smesapcomv1alpha1.JobType `json:"type,omitempty"` + Type *smesapcomv1alpha2.JobType `json:"type,omitempty"` // Specifies the number of retries before marking this job failed. BackoffLimit *int32 `json:"backoffLimit,omitempty"` // Specifies the time after which the job may be cleaned up. @@ -227,7 +227,7 @@ func (b *JobDetailsApplyConfiguration) WithLifecycle(value v1.Lifecycle) *JobDet // WithType sets the Type 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 Type field is set to the value of the last call. -func (b *JobDetailsApplyConfiguration) WithType(value smesapcomv1alpha1.JobType) *JobDetailsApplyConfiguration { +func (b *JobDetailsApplyConfiguration) WithType(value smesapcomv1alpha2.JobType) *JobDetailsApplyConfiguration { b.Type = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/metricrule.go similarity index 91% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/metricrule.go index a64915ad..3fc9ef38 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/metricrule.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // MetricRuleApplyConfiguration represents a declarative configuration of the MetricRule type for use @@ -27,9 +27,9 @@ type MetricRuleApplyConfiguration struct { // Prometheus metric. For example `http_request_count` Name *string `json:"name,omitempty"` // Type of Prometheus metric which can be either `Gauge` or `Counter` - Type *smesapcomv1alpha1.MetricType `json:"type,omitempty"` + Type *smesapcomv1alpha2.MetricType `json:"type,omitempty"` // Duration of time series data used for the rule evaluation - CalculationPeriod *smesapcomv1alpha1.Duration `json:"calculationPeriod,omitempty"` + CalculationPeriod *smesapcomv1alpha2.Duration `json:"calculationPeriod,omitempty"` // The threshold value which is compared against the calculated value. If calculated value is less than or equal to the threshold the rule condition is fulfilled. ThresholdValue *string `json:"thresholdValue,omitempty"` } @@ -51,7 +51,7 @@ func (b *MetricRuleApplyConfiguration) WithName(value string) *MetricRuleApplyCo // WithType sets the Type 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 Type field is set to the value of the last call. -func (b *MetricRuleApplyConfiguration) WithType(value smesapcomv1alpha1.MetricType) *MetricRuleApplyConfiguration { +func (b *MetricRuleApplyConfiguration) WithType(value smesapcomv1alpha2.MetricType) *MetricRuleApplyConfiguration { b.Type = &value return b } @@ -59,7 +59,7 @@ func (b *MetricRuleApplyConfiguration) WithType(value smesapcomv1alpha1.MetricTy // WithCalculationPeriod sets the CalculationPeriod 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 CalculationPeriod field is set to the value of the last call. -func (b *MetricRuleApplyConfiguration) WithCalculationPeriod(value smesapcomv1alpha1.Duration) *MetricRuleApplyConfiguration { +func (b *MetricRuleApplyConfiguration) WithCalculationPeriod(value smesapcomv1alpha2.Duration) *MetricRuleApplyConfiguration { b.CalculationPeriod = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/monitoringconfig.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/monitoringconfig.go similarity index 88% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/monitoringconfig.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/monitoringconfig.go index a213bea3..7ff1181b 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/monitoringconfig.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/monitoringconfig.go @@ -5,23 +5,23 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // MonitoringConfigApplyConfiguration represents a declarative configuration of the MonitoringConfig type for use // with apply. type MonitoringConfigApplyConfiguration struct { // Interval at which Prometheus scrapes the metrics from the target. - ScrapeInterval *smesapcomv1alpha1.Duration `json:"interval,omitempty"` + ScrapeInterval *smesapcomv1alpha2.Duration `json:"interval,omitempty"` // Name of the port (specified on the workload) which will be used by Prometheus server to scrape metrics WorkloadPort *string `json:"port,omitempty"` // HTTP path from which to scrape for metrics. Path *string `json:"path,omitempty"` // Timeout after which Prometheus considers the scrape to be failed. - Timeout *smesapcomv1alpha1.Duration `json:"scrapeTimeout,omitempty"` + Timeout *smesapcomv1alpha2.Duration `json:"scrapeTimeout,omitempty"` } // MonitoringConfigApplyConfiguration constructs a declarative configuration of the MonitoringConfig type for use with @@ -33,7 +33,7 @@ func MonitoringConfig() *MonitoringConfigApplyConfiguration { // WithScrapeInterval sets the ScrapeInterval 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 ScrapeInterval field is set to the value of the last call. -func (b *MonitoringConfigApplyConfiguration) WithScrapeInterval(value smesapcomv1alpha1.Duration) *MonitoringConfigApplyConfiguration { +func (b *MonitoringConfigApplyConfiguration) WithScrapeInterval(value smesapcomv1alpha2.Duration) *MonitoringConfigApplyConfiguration { b.ScrapeInterval = &value return b } @@ -57,7 +57,7 @@ func (b *MonitoringConfigApplyConfiguration) WithPath(value string) *MonitoringC // WithTimeout sets the Timeout 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 Timeout field is set to the value of the last call. -func (b *MonitoringConfigApplyConfiguration) WithTimeout(value smesapcomv1alpha1.Duration) *MonitoringConfigApplyConfiguration { +func (b *MonitoringConfigApplyConfiguration) WithTimeout(value smesapcomv1alpha2.Duration) *MonitoringConfigApplyConfiguration { b.Timeout = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/namevalue.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/namevalue.go new file mode 100644 index 00000000..15f6e25f --- /dev/null +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/namevalue.go @@ -0,0 +1,41 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +// NameValueApplyConfiguration represents a declarative configuration of the NameValue type for use +// with apply. +// +// Workaround for pattern for string items +kubebuilder:validation:Pattern=^[a-z0-9-.]+$ +// type PatternString string +// Generic Name/Value configuration +type NameValueApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// NameValueApplyConfiguration constructs a declarative configuration of the NameValue type for use with +// apply. +func NameValue() *NameValueApplyConfiguration { + return &NameValueApplyConfiguration{} +} + +// 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 *NameValueApplyConfiguration) WithName(value string) *NameValueApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value 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 Value field is set to the value of the last call. +func (b *NameValueApplyConfiguration) WithValue(value string) *NameValueApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/ports.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/ports.go similarity index 93% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/ports.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/ports.go index 13c83949..059a7687 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/ports.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/ports.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // PortsApplyConfiguration represents a declarative configuration of the Ports type for use @@ -21,7 +21,7 @@ type PortsApplyConfiguration struct { // Name of the service port Name *string `json:"name,omitempty"` // Network Policy of the service port - NetworkPolicy *smesapcomv1alpha1.PortNetworkPolicyType `json:"networkPolicy,omitempty"` + NetworkPolicy *smesapcomv1alpha2.PortNetworkPolicyType `json:"networkPolicy,omitempty"` // The port number used for container and the corresponding service (if any) Port *int32 `json:"port,omitempty"` // Destination name which may be used by the Router deployment to reach this backend service @@ -53,7 +53,7 @@ func (b *PortsApplyConfiguration) WithName(value string) *PortsApplyConfiguratio // WithNetworkPolicy sets the NetworkPolicy 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 NetworkPolicy field is set to the value of the last call. -func (b *PortsApplyConfiguration) WithNetworkPolicy(value smesapcomv1alpha1.PortNetworkPolicyType) *PortsApplyConfiguration { +func (b *PortsApplyConfiguration) WithNetworkPolicy(value smesapcomv1alpha2.PortNetworkPolicyType) *PortsApplyConfiguration { b.NetworkPolicy = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/route.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/route.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/route.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/route.go index 1bdf6d9b..217926b9 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/route.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/route.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // RouteApplyConfiguration represents a declarative configuration of the Route type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/serviceexposure.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/serviceexposure.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/serviceexposure.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/serviceexposure.go index 357a8de8..b8812dd6 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/serviceexposure.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/serviceexposure.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // ServiceExposureApplyConfiguration represents a declarative configuration of the ServiceExposure type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/serviceinfo.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/serviceinfo.go similarity index 92% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/serviceinfo.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/serviceinfo.go index a5e90396..11f16dff 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/serviceinfo.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/serviceinfo.go @@ -5,10 +5,10 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 import ( - smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" ) // ServiceInfoApplyConfiguration represents a declarative configuration of the ServiceInfo type for use @@ -23,7 +23,7 @@ type ServiceInfoApplyConfiguration struct { // Type of service Class *string `json:"class,omitempty"` // SubscriptionDependency may be used to specify whether this service should be part of getDependencies call from subscription service (e.g. saas-registry) - SubscriptionDependency *smesapcomv1alpha1.SubscriptionDependency `json:"subscriptionDependency,omitempty"` + SubscriptionDependency *smesapcomv1alpha2.SubscriptionDependency `json:"subscriptionDependency,omitempty"` } // ServiceInfoApplyConfiguration constructs a declarative configuration of the ServiceInfo type for use with @@ -59,7 +59,7 @@ func (b *ServiceInfoApplyConfiguration) WithClass(value string) *ServiceInfoAppl // WithSubscriptionDependency sets the SubscriptionDependency 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 SubscriptionDependency field is set to the value of the last call. -func (b *ServiceInfoApplyConfiguration) WithSubscriptionDependency(value smesapcomv1alpha1.SubscriptionDependency) *ServiceInfoApplyConfiguration { +func (b *ServiceInfoApplyConfiguration) WithSubscriptionDependency(value smesapcomv1alpha2.SubscriptionDependency) *ServiceInfoApplyConfiguration { b.SubscriptionDependency = &value return b } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/stickiness.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/stickiness.go similarity index 98% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/stickiness.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/stickiness.go index 52a38c82..79a656aa 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/stickiness.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/stickiness.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // StickinessApplyConfiguration represents a declarative configuration of the Stickiness type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/stickinesshash.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/stickinesshash.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/stickinesshash.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/stickinesshash.go index cdb396af..2e2ff12e 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/stickinesshash.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/stickinesshash.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // StickinessHashApplyConfiguration represents a declarative configuration of the StickinessHash type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/tenantoperations.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/tenantoperations.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/tenantoperations.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/tenantoperations.go index 61b9c973..6d82d8a1 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/tenantoperations.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/tenantoperations.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // TenantOperationsApplyConfiguration represents a declarative configuration of the TenantOperations type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/tenantoperationworkloadreference.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/tenantoperationworkloadreference.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/tenantoperationworkloadreference.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/tenantoperationworkloadreference.go index dc36f153..30558f96 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/tenantoperationworkloadreference.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/tenantoperationworkloadreference.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // TenantOperationWorkloadReferenceApplyConfiguration represents a declarative configuration of the TenantOperationWorkloadReference type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/workloaddetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/workloaddetails.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/workloaddetails.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/workloaddetails.go index 3e80e556..0076a041 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/workloaddetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/workloaddetails.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // WorkloadDetailsApplyConfiguration represents a declarative configuration of the WorkloadDetails type for use // with apply. diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/workloadmonitoring.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/workloadmonitoring.go similarity index 99% rename from pkg/client/applyconfiguration/sme.sap.com/v1alpha1/workloadmonitoring.go rename to pkg/client/applyconfiguration/sme.sap.com/v1alpha2/workloadmonitoring.go index f32489f4..7f6bda09 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/workloadmonitoring.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha2/workloadmonitoring.go @@ -5,7 +5,7 @@ SPDX-License-Identifier: Apache-2.0 // Code generated by applyconfiguration-gen. DO NOT EDIT. -package v1alpha1 +package v1alpha2 // WorkloadMonitoringApplyConfiguration represents a declarative configuration of the WorkloadMonitoring type for use // with apply. diff --git a/pkg/client/applyconfiguration/utils.go b/pkg/client/applyconfiguration/utils.go index 7a806870..0c3732ff 100644 --- a/pkg/client/applyconfiguration/utils.go +++ b/pkg/client/applyconfiguration/utils.go @@ -9,8 +9,10 @@ package applyconfiguration import ( v1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" internal "github.com/sap/cap-operator/pkg/client/applyconfiguration/internal" smesapcomv1alpha1 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha1" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" managedfields "k8s.io/apimachinery/pkg/util/managedfields" @@ -23,96 +25,116 @@ func ForKind(kind schema.GroupVersionKind) interface{} { // Group=sme.sap.com, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithKind("ApplicationDomains"): return &smesapcomv1alpha1.ApplicationDomainsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("BTP"): - return &smesapcomv1alpha1.BTPApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("BTPTenantIdentification"): - return &smesapcomv1alpha1.BTPTenantIdentificationApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPApplication"): return &smesapcomv1alpha1.CAPApplicationApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPApplicationSpec"): return &smesapcomv1alpha1.CAPApplicationSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPApplicationStatus"): - return &smesapcomv1alpha1.CAPApplicationStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPApplicationVersion"): return &smesapcomv1alpha1.CAPApplicationVersionApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPApplicationVersionSpec"): - return &smesapcomv1alpha1.CAPApplicationVersionSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPApplicationVersionStatus"): - return &smesapcomv1alpha1.CAPApplicationVersionStatusApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPTenant"): return &smesapcomv1alpha1.CAPTenantApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantOperation"): return &smesapcomv1alpha1.CAPTenantOperationApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantOperationSpec"): - return &smesapcomv1alpha1.CAPTenantOperationSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantOperationStatus"): - return &smesapcomv1alpha1.CAPTenantOperationStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantOperationStep"): - return &smesapcomv1alpha1.CAPTenantOperationStepApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantOutput"): return &smesapcomv1alpha1.CAPTenantOutputApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantOutputSpec"): - return &smesapcomv1alpha1.CAPTenantOutputSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantSpec"): - return &smesapcomv1alpha1.CAPTenantSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CAPTenantStatus"): - return &smesapcomv1alpha1.CAPTenantStatusApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CertConfig"): - return &smesapcomv1alpha1.CertConfigApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("CertManager"): - return &smesapcomv1alpha1.CertManagerApplyConfiguration{} 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("DNSTemplate"): - return &smesapcomv1alpha1.DNSTemplateApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("Domain"): return &smesapcomv1alpha1.DomainApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("DomainRef"): - return &smesapcomv1alpha1.DomainRefApplyConfiguration{} - 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("HorizontalPodAutoscalerSpec"): - return &smesapcomv1alpha1.HorizontalPodAutoscalerSpecApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("HTTPCookie"): - return &smesapcomv1alpha1.HTTPCookieApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("JobDetails"): - return &smesapcomv1alpha1.JobDetailsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("MetricRule"): - return &smesapcomv1alpha1.MetricRuleApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("MonitoringConfig"): - return &smesapcomv1alpha1.MonitoringConfigApplyConfiguration{} case v1alpha1.SchemeGroupVersion.WithKind("NameValue"): return &smesapcomv1alpha1.NameValueApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Ports"): - return &smesapcomv1alpha1.PortsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Route"): - return &smesapcomv1alpha1.RouteApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ServiceExposure"): - return &smesapcomv1alpha1.ServiceExposureApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("ServiceInfo"): - return &smesapcomv1alpha1.ServiceInfoApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("Stickiness"): - return &smesapcomv1alpha1.StickinessApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("StickinessHash"): - return &smesapcomv1alpha1.StickinessHashApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("TenantOperations"): - return &smesapcomv1alpha1.TenantOperationsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("TenantOperationWorkloadReference"): - return &smesapcomv1alpha1.TenantOperationWorkloadReferenceApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("WorkloadDetails"): - return &smesapcomv1alpha1.WorkloadDetailsApplyConfiguration{} - case v1alpha1.SchemeGroupVersion.WithKind("WorkloadMonitoring"): - return &smesapcomv1alpha1.WorkloadMonitoringApplyConfiguration{} + + // Group=sme.sap.com, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithKind("BTP"): + return &smesapcomv1alpha2.BTPApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("BTPTenantIdentification"): + return &smesapcomv1alpha2.BTPTenantIdentificationApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPApplication"): + return &smesapcomv1alpha2.CAPApplicationApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPApplicationSpec"): + return &smesapcomv1alpha2.CAPApplicationSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPApplicationStatus"): + return &smesapcomv1alpha2.CAPApplicationStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPApplicationVersion"): + return &smesapcomv1alpha2.CAPApplicationVersionApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPApplicationVersionSpec"): + return &smesapcomv1alpha2.CAPApplicationVersionSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPApplicationVersionStatus"): + return &smesapcomv1alpha2.CAPApplicationVersionStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenant"): + return &smesapcomv1alpha2.CAPTenantApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOperation"): + return &smesapcomv1alpha2.CAPTenantOperationApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOperationSpec"): + return &smesapcomv1alpha2.CAPTenantOperationSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOperationStatus"): + return &smesapcomv1alpha2.CAPTenantOperationStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOperationStep"): + return &smesapcomv1alpha2.CAPTenantOperationStepApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOutput"): + return &smesapcomv1alpha2.CAPTenantOutputApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOutputSpec"): + return &smesapcomv1alpha2.CAPTenantOutputSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantSpec"): + return &smesapcomv1alpha2.CAPTenantSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CAPTenantStatus"): + return &smesapcomv1alpha2.CAPTenantStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CertConfig"): + return &smesapcomv1alpha2.CertConfigApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CertManager"): + return &smesapcomv1alpha2.CertManagerApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ClusterDomain"): + return &smesapcomv1alpha2.ClusterDomainApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("CommonDetails"): + return &smesapcomv1alpha2.CommonDetailsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DeletionRules"): + return &smesapcomv1alpha2.DeletionRulesApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DeploymentDetails"): + return &smesapcomv1alpha2.DeploymentDetailsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DNSTemplate"): + return &smesapcomv1alpha2.DNSTemplateApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("Domain"): + return &smesapcomv1alpha2.DomainApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DomainRef"): + return &smesapcomv1alpha2.DomainRefApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DomainSpec"): + return &smesapcomv1alpha2.DomainSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("DomainStatus"): + return &smesapcomv1alpha2.DomainStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("GenericStatus"): + return &smesapcomv1alpha2.GenericStatusApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): + return &smesapcomv1alpha2.HorizontalPodAutoscalerSpecApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("HTTPCookie"): + return &smesapcomv1alpha2.HTTPCookieApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("JobDetails"): + return &smesapcomv1alpha2.JobDetailsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("MetricRule"): + return &smesapcomv1alpha2.MetricRuleApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("MonitoringConfig"): + return &smesapcomv1alpha2.MonitoringConfigApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("NameValue"): + return &smesapcomv1alpha2.NameValueApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("Ports"): + return &smesapcomv1alpha2.PortsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("Route"): + return &smesapcomv1alpha2.RouteApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ServiceExposure"): + return &smesapcomv1alpha2.ServiceExposureApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("ServiceInfo"): + return &smesapcomv1alpha2.ServiceInfoApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("Stickiness"): + return &smesapcomv1alpha2.StickinessApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("StickinessHash"): + return &smesapcomv1alpha2.StickinessHashApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TenantOperations"): + return &smesapcomv1alpha2.TenantOperationsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("TenantOperationWorkloadReference"): + return &smesapcomv1alpha2.TenantOperationWorkloadReferenceApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("WorkloadDetails"): + return &smesapcomv1alpha2.WorkloadDetailsApplyConfiguration{} + case v1alpha2.SchemeGroupVersion.WithKind("WorkloadMonitoring"): + return &smesapcomv1alpha2.WorkloadMonitoringApplyConfiguration{} } return nil diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 05ed2447..8a009382 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -12,6 +12,7 @@ import ( http "net/http" smev1alpha1 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1" + smev1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -20,12 +21,14 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterfaces SmeV1alpha1() smev1alpha1.SmeV1alpha1Interface + SmeV1alpha2() smev1alpha2.SmeV1alpha2Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient smeV1alpha1 *smev1alpha1.SmeV1alpha1Client + smeV1alpha2 *smev1alpha2.SmeV1alpha2Client } // SmeV1alpha1 retrieves the SmeV1alpha1Client @@ -33,6 +36,11 @@ func (c *Clientset) SmeV1alpha1() smev1alpha1.SmeV1alpha1Interface { return c.smeV1alpha1 } +// SmeV1alpha2 retrieves the SmeV1alpha2Client +func (c *Clientset) SmeV1alpha2() smev1alpha2.SmeV1alpha2Interface { + return c.smeV1alpha2 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { @@ -81,6 +89,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.smeV1alpha2, err = smev1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -103,6 +115,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { func New(c rest.Interface) *Clientset { var cs Clientset cs.smeV1alpha1 = smev1alpha1.New(c) + cs.smeV1alpha2 = smev1alpha2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index 517b9da6..2c5355f7 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -12,6 +12,8 @@ import ( clientset "github.com/sap/cap-operator/pkg/client/clientset/versioned" smev1alpha1 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1" fakesmev1alpha1 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha1/fake" + smev1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + fakesmev1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" @@ -129,3 +131,8 @@ var ( func (c *Clientset) SmeV1alpha1() smev1alpha1.SmeV1alpha1Interface { return &fakesmev1alpha1.FakeSmeV1alpha1{Fake: &c.Fake} } + +// SmeV1alpha2 retrieves the SmeV1alpha2Client +func (c *Clientset) SmeV1alpha2() smev1alpha2.SmeV1alpha2Interface { + return &fakesmev1alpha2.FakeSmeV1alpha2{Fake: &c.Fake} +} diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 7f75435e..01dda012 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -9,6 +9,7 @@ package fake import ( smev1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smev1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -21,6 +22,7 @@ var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ smev1alpha1.AddToScheme, + smev1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 0f73d922..7ad1e31d 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -9,6 +9,7 @@ package scheme import ( smev1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + smev1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -21,6 +22,7 @@ var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ smev1alpha1.AddToScheme, + smev1alpha2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/capapplication.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/capapplication.go new file mode 100644 index 00000000..d307e810 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/capapplication.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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" +) + +// CAPApplicationsGetter has a method to return a CAPApplicationInterface. +// A group's client should implement this interface. +type CAPApplicationsGetter interface { + CAPApplications(namespace string) CAPApplicationInterface +} + +// CAPApplicationInterface has methods to work with CAPApplication resources. +type CAPApplicationInterface interface { + Create(ctx context.Context, cAPApplication *smesapcomv1alpha2.CAPApplication, opts v1.CreateOptions) (*smesapcomv1alpha2.CAPApplication, error) + Update(ctx context.Context, cAPApplication *smesapcomv1alpha2.CAPApplication, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPApplication, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cAPApplication *smesapcomv1alpha2.CAPApplication, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPApplication, 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) (*smesapcomv1alpha2.CAPApplication, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.CAPApplicationList, 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 *smesapcomv1alpha2.CAPApplication, err error) + Apply(ctx context.Context, cAPApplication *applyconfigurationsmesapcomv1alpha2.CAPApplicationApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPApplication, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cAPApplication *applyconfigurationsmesapcomv1alpha2.CAPApplicationApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPApplication, err error) + CAPApplicationExpansion +} + +// cAPApplications implements CAPApplicationInterface +type cAPApplications struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.CAPApplication, *smesapcomv1alpha2.CAPApplicationList, *applyconfigurationsmesapcomv1alpha2.CAPApplicationApplyConfiguration] +} + +// newCAPApplications returns a CAPApplications +func newCAPApplications(c *SmeV1alpha2Client, namespace string) *cAPApplications { + return &cAPApplications{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.CAPApplication, *smesapcomv1alpha2.CAPApplicationList, *applyconfigurationsmesapcomv1alpha2.CAPApplicationApplyConfiguration]( + "capapplications", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.CAPApplication { return &smesapcomv1alpha2.CAPApplication{} }, + func() *smesapcomv1alpha2.CAPApplicationList { return &smesapcomv1alpha2.CAPApplicationList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/capapplicationversion.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/capapplicationversion.go new file mode 100644 index 00000000..3ef81a56 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/capapplicationversion.go @@ -0,0 +1,65 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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" +) + +// CAPApplicationVersionsGetter has a method to return a CAPApplicationVersionInterface. +// A group's client should implement this interface. +type CAPApplicationVersionsGetter interface { + CAPApplicationVersions(namespace string) CAPApplicationVersionInterface +} + +// CAPApplicationVersionInterface has methods to work with CAPApplicationVersion resources. +type CAPApplicationVersionInterface interface { + Create(ctx context.Context, cAPApplicationVersion *smesapcomv1alpha2.CAPApplicationVersion, opts v1.CreateOptions) (*smesapcomv1alpha2.CAPApplicationVersion, error) + Update(ctx context.Context, cAPApplicationVersion *smesapcomv1alpha2.CAPApplicationVersion, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPApplicationVersion, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cAPApplicationVersion *smesapcomv1alpha2.CAPApplicationVersion, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPApplicationVersion, 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) (*smesapcomv1alpha2.CAPApplicationVersion, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.CAPApplicationVersionList, 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 *smesapcomv1alpha2.CAPApplicationVersion, err error) + Apply(ctx context.Context, cAPApplicationVersion *applyconfigurationsmesapcomv1alpha2.CAPApplicationVersionApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPApplicationVersion, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cAPApplicationVersion *applyconfigurationsmesapcomv1alpha2.CAPApplicationVersionApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPApplicationVersion, err error) + CAPApplicationVersionExpansion +} + +// cAPApplicationVersions implements CAPApplicationVersionInterface +type cAPApplicationVersions struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.CAPApplicationVersion, *smesapcomv1alpha2.CAPApplicationVersionList, *applyconfigurationsmesapcomv1alpha2.CAPApplicationVersionApplyConfiguration] +} + +// newCAPApplicationVersions returns a CAPApplicationVersions +func newCAPApplicationVersions(c *SmeV1alpha2Client, namespace string) *cAPApplicationVersions { + return &cAPApplicationVersions{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.CAPApplicationVersion, *smesapcomv1alpha2.CAPApplicationVersionList, *applyconfigurationsmesapcomv1alpha2.CAPApplicationVersionApplyConfiguration]( + "capapplicationversions", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.CAPApplicationVersion { return &smesapcomv1alpha2.CAPApplicationVersion{} }, + func() *smesapcomv1alpha2.CAPApplicationVersionList { + return &smesapcomv1alpha2.CAPApplicationVersionList{} + }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenant.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenant.go new file mode 100644 index 00000000..eabf7fde --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenant.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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" +) + +// CAPTenantsGetter has a method to return a CAPTenantInterface. +// A group's client should implement this interface. +type CAPTenantsGetter interface { + CAPTenants(namespace string) CAPTenantInterface +} + +// CAPTenantInterface has methods to work with CAPTenant resources. +type CAPTenantInterface interface { + Create(ctx context.Context, cAPTenant *smesapcomv1alpha2.CAPTenant, opts v1.CreateOptions) (*smesapcomv1alpha2.CAPTenant, error) + Update(ctx context.Context, cAPTenant *smesapcomv1alpha2.CAPTenant, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPTenant, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cAPTenant *smesapcomv1alpha2.CAPTenant, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPTenant, 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) (*smesapcomv1alpha2.CAPTenant, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.CAPTenantList, 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 *smesapcomv1alpha2.CAPTenant, err error) + Apply(ctx context.Context, cAPTenant *applyconfigurationsmesapcomv1alpha2.CAPTenantApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPTenant, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cAPTenant *applyconfigurationsmesapcomv1alpha2.CAPTenantApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPTenant, err error) + CAPTenantExpansion +} + +// cAPTenants implements CAPTenantInterface +type cAPTenants struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.CAPTenant, *smesapcomv1alpha2.CAPTenantList, *applyconfigurationsmesapcomv1alpha2.CAPTenantApplyConfiguration] +} + +// newCAPTenants returns a CAPTenants +func newCAPTenants(c *SmeV1alpha2Client, namespace string) *cAPTenants { + return &cAPTenants{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.CAPTenant, *smesapcomv1alpha2.CAPTenantList, *applyconfigurationsmesapcomv1alpha2.CAPTenantApplyConfiguration]( + "captenants", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.CAPTenant { return &smesapcomv1alpha2.CAPTenant{} }, + func() *smesapcomv1alpha2.CAPTenantList { return &smesapcomv1alpha2.CAPTenantList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenantoperation.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenantoperation.go new file mode 100644 index 00000000..266173fa --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenantoperation.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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" +) + +// CAPTenantOperationsGetter has a method to return a CAPTenantOperationInterface. +// A group's client should implement this interface. +type CAPTenantOperationsGetter interface { + CAPTenantOperations(namespace string) CAPTenantOperationInterface +} + +// CAPTenantOperationInterface has methods to work with CAPTenantOperation resources. +type CAPTenantOperationInterface interface { + Create(ctx context.Context, cAPTenantOperation *smesapcomv1alpha2.CAPTenantOperation, opts v1.CreateOptions) (*smesapcomv1alpha2.CAPTenantOperation, error) + Update(ctx context.Context, cAPTenantOperation *smesapcomv1alpha2.CAPTenantOperation, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPTenantOperation, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, cAPTenantOperation *smesapcomv1alpha2.CAPTenantOperation, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPTenantOperation, 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) (*smesapcomv1alpha2.CAPTenantOperation, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.CAPTenantOperationList, 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 *smesapcomv1alpha2.CAPTenantOperation, err error) + Apply(ctx context.Context, cAPTenantOperation *applyconfigurationsmesapcomv1alpha2.CAPTenantOperationApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPTenantOperation, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, cAPTenantOperation *applyconfigurationsmesapcomv1alpha2.CAPTenantOperationApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPTenantOperation, err error) + CAPTenantOperationExpansion +} + +// cAPTenantOperations implements CAPTenantOperationInterface +type cAPTenantOperations struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.CAPTenantOperation, *smesapcomv1alpha2.CAPTenantOperationList, *applyconfigurationsmesapcomv1alpha2.CAPTenantOperationApplyConfiguration] +} + +// newCAPTenantOperations returns a CAPTenantOperations +func newCAPTenantOperations(c *SmeV1alpha2Client, namespace string) *cAPTenantOperations { + return &cAPTenantOperations{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.CAPTenantOperation, *smesapcomv1alpha2.CAPTenantOperationList, *applyconfigurationsmesapcomv1alpha2.CAPTenantOperationApplyConfiguration]( + "captenantoperations", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.CAPTenantOperation { return &smesapcomv1alpha2.CAPTenantOperation{} }, + func() *smesapcomv1alpha2.CAPTenantOperationList { return &smesapcomv1alpha2.CAPTenantOperationList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenantoutput.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenantoutput.go new file mode 100644 index 00000000..d7f8dea6 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/captenantoutput.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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" +) + +// CAPTenantOutputsGetter has a method to return a CAPTenantOutputInterface. +// A group's client should implement this interface. +type CAPTenantOutputsGetter interface { + CAPTenantOutputs(namespace string) CAPTenantOutputInterface +} + +// CAPTenantOutputInterface has methods to work with CAPTenantOutput resources. +type CAPTenantOutputInterface interface { + Create(ctx context.Context, cAPTenantOutput *smesapcomv1alpha2.CAPTenantOutput, opts v1.CreateOptions) (*smesapcomv1alpha2.CAPTenantOutput, error) + Update(ctx context.Context, cAPTenantOutput *smesapcomv1alpha2.CAPTenantOutput, opts v1.UpdateOptions) (*smesapcomv1alpha2.CAPTenantOutput, 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) (*smesapcomv1alpha2.CAPTenantOutput, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.CAPTenantOutputList, 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 *smesapcomv1alpha2.CAPTenantOutput, err error) + Apply(ctx context.Context, cAPTenantOutput *applyconfigurationsmesapcomv1alpha2.CAPTenantOutputApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.CAPTenantOutput, err error) + CAPTenantOutputExpansion +} + +// cAPTenantOutputs implements CAPTenantOutputInterface +type cAPTenantOutputs struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.CAPTenantOutput, *smesapcomv1alpha2.CAPTenantOutputList, *applyconfigurationsmesapcomv1alpha2.CAPTenantOutputApplyConfiguration] +} + +// newCAPTenantOutputs returns a CAPTenantOutputs +func newCAPTenantOutputs(c *SmeV1alpha2Client, namespace string) *cAPTenantOutputs { + return &cAPTenantOutputs{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.CAPTenantOutput, *smesapcomv1alpha2.CAPTenantOutputList, *applyconfigurationsmesapcomv1alpha2.CAPTenantOutputApplyConfiguration]( + "captenantoutputs", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.CAPTenantOutput { return &smesapcomv1alpha2.CAPTenantOutput{} }, + func() *smesapcomv1alpha2.CAPTenantOutputList { return &smesapcomv1alpha2.CAPTenantOutputList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/clusterdomain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/clusterdomain.go new file mode 100644 index 00000000..814bb744 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/clusterdomain.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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 *smesapcomv1alpha2.ClusterDomain, opts v1.CreateOptions) (*smesapcomv1alpha2.ClusterDomain, error) + Update(ctx context.Context, clusterDomain *smesapcomv1alpha2.ClusterDomain, opts v1.UpdateOptions) (*smesapcomv1alpha2.ClusterDomain, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, clusterDomain *smesapcomv1alpha2.ClusterDomain, opts v1.UpdateOptions) (*smesapcomv1alpha2.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) (*smesapcomv1alpha2.ClusterDomain, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.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 *smesapcomv1alpha2.ClusterDomain, err error) + Apply(ctx context.Context, clusterDomain *applyconfigurationsmesapcomv1alpha2.ClusterDomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.ClusterDomain, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, clusterDomain *applyconfigurationsmesapcomv1alpha2.ClusterDomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.ClusterDomain, err error) + ClusterDomainExpansion +} + +// clusterDomains implements ClusterDomainInterface +type clusterDomains struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.ClusterDomain, *smesapcomv1alpha2.ClusterDomainList, *applyconfigurationsmesapcomv1alpha2.ClusterDomainApplyConfiguration] +} + +// newClusterDomains returns a ClusterDomains +func newClusterDomains(c *SmeV1alpha2Client, namespace string) *clusterDomains { + return &clusterDomains{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.ClusterDomain, *smesapcomv1alpha2.ClusterDomainList, *applyconfigurationsmesapcomv1alpha2.ClusterDomainApplyConfiguration]( + "clusterdomains", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.ClusterDomain { return &smesapcomv1alpha2.ClusterDomain{} }, + func() *smesapcomv1alpha2.ClusterDomainList { return &smesapcomv1alpha2.ClusterDomainList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/doc.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/doc.go new file mode 100644 index 00000000..40e67708 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/doc.go @@ -0,0 +1,9 @@ +/* +SPDX-FileCopyrightText: 2026 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. + +// This package has the automatically generated typed clients. +package v1alpha2 diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/domain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/domain.go new file mode 100644 index 00000000..d8b9de4d --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/domain.go @@ -0,0 +1,63 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + applyconfigurationsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + 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 *smesapcomv1alpha2.Domain, opts v1.CreateOptions) (*smesapcomv1alpha2.Domain, error) + Update(ctx context.Context, domain *smesapcomv1alpha2.Domain, opts v1.UpdateOptions) (*smesapcomv1alpha2.Domain, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, domain *smesapcomv1alpha2.Domain, opts v1.UpdateOptions) (*smesapcomv1alpha2.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) (*smesapcomv1alpha2.Domain, error) + List(ctx context.Context, opts v1.ListOptions) (*smesapcomv1alpha2.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 *smesapcomv1alpha2.Domain, err error) + Apply(ctx context.Context, domain *applyconfigurationsmesapcomv1alpha2.DomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.Domain, err error) + // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). + ApplyStatus(ctx context.Context, domain *applyconfigurationsmesapcomv1alpha2.DomainApplyConfiguration, opts v1.ApplyOptions) (result *smesapcomv1alpha2.Domain, err error) + DomainExpansion +} + +// domains implements DomainInterface +type domains struct { + *gentype.ClientWithListAndApply[*smesapcomv1alpha2.Domain, *smesapcomv1alpha2.DomainList, *applyconfigurationsmesapcomv1alpha2.DomainApplyConfiguration] +} + +// newDomains returns a Domains +func newDomains(c *SmeV1alpha2Client, namespace string) *domains { + return &domains{ + gentype.NewClientWithListAndApply[*smesapcomv1alpha2.Domain, *smesapcomv1alpha2.DomainList, *applyconfigurationsmesapcomv1alpha2.DomainApplyConfiguration]( + "domains", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *smesapcomv1alpha2.Domain { return &smesapcomv1alpha2.Domain{} }, + func() *smesapcomv1alpha2.DomainList { return &smesapcomv1alpha2.DomainList{} }, + ), + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/doc.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/doc.go new file mode 100644 index 00000000..9698942d --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/doc.go @@ -0,0 +1,9 @@ +/* +SPDX-FileCopyrightText: 2026 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 has the automatically generated clients. +package fake diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_capapplication.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_capapplication.go new file mode 100644 index 00000000..152e6d40 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_capapplication.go @@ -0,0 +1,42 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeCAPApplications implements CAPApplicationInterface +type fakeCAPApplications struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.CAPApplication, *v1alpha2.CAPApplicationList, *smesapcomv1alpha2.CAPApplicationApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeCAPApplications(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.CAPApplicationInterface { + return &fakeCAPApplications{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.CAPApplication, *v1alpha2.CAPApplicationList, *smesapcomv1alpha2.CAPApplicationApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("capapplications"), + v1alpha2.SchemeGroupVersion.WithKind("CAPApplication"), + func() *v1alpha2.CAPApplication { return &v1alpha2.CAPApplication{} }, + func() *v1alpha2.CAPApplicationList { return &v1alpha2.CAPApplicationList{} }, + func(dst, src *v1alpha2.CAPApplicationList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.CAPApplicationList) []*v1alpha2.CAPApplication { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.CAPApplicationList, items []*v1alpha2.CAPApplication) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_capapplicationversion.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_capapplicationversion.go new file mode 100644 index 00000000..e4436940 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_capapplicationversion.go @@ -0,0 +1,42 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeCAPApplicationVersions implements CAPApplicationVersionInterface +type fakeCAPApplicationVersions struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.CAPApplicationVersion, *v1alpha2.CAPApplicationVersionList, *smesapcomv1alpha2.CAPApplicationVersionApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeCAPApplicationVersions(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.CAPApplicationVersionInterface { + return &fakeCAPApplicationVersions{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.CAPApplicationVersion, *v1alpha2.CAPApplicationVersionList, *smesapcomv1alpha2.CAPApplicationVersionApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("capapplicationversions"), + v1alpha2.SchemeGroupVersion.WithKind("CAPApplicationVersion"), + func() *v1alpha2.CAPApplicationVersion { return &v1alpha2.CAPApplicationVersion{} }, + func() *v1alpha2.CAPApplicationVersionList { return &v1alpha2.CAPApplicationVersionList{} }, + func(dst, src *v1alpha2.CAPApplicationVersionList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.CAPApplicationVersionList) []*v1alpha2.CAPApplicationVersion { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.CAPApplicationVersionList, items []*v1alpha2.CAPApplicationVersion) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenant.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenant.go new file mode 100644 index 00000000..6e669d4a --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenant.go @@ -0,0 +1,40 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeCAPTenants implements CAPTenantInterface +type fakeCAPTenants struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.CAPTenant, *v1alpha2.CAPTenantList, *smesapcomv1alpha2.CAPTenantApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeCAPTenants(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.CAPTenantInterface { + return &fakeCAPTenants{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.CAPTenant, *v1alpha2.CAPTenantList, *smesapcomv1alpha2.CAPTenantApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("captenants"), + v1alpha2.SchemeGroupVersion.WithKind("CAPTenant"), + func() *v1alpha2.CAPTenant { return &v1alpha2.CAPTenant{} }, + func() *v1alpha2.CAPTenantList { return &v1alpha2.CAPTenantList{} }, + func(dst, src *v1alpha2.CAPTenantList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.CAPTenantList) []*v1alpha2.CAPTenant { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha2.CAPTenantList, items []*v1alpha2.CAPTenant) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenantoperation.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenantoperation.go new file mode 100644 index 00000000..7ed875b9 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenantoperation.go @@ -0,0 +1,42 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeCAPTenantOperations implements CAPTenantOperationInterface +type fakeCAPTenantOperations struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.CAPTenantOperation, *v1alpha2.CAPTenantOperationList, *smesapcomv1alpha2.CAPTenantOperationApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeCAPTenantOperations(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.CAPTenantOperationInterface { + return &fakeCAPTenantOperations{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.CAPTenantOperation, *v1alpha2.CAPTenantOperationList, *smesapcomv1alpha2.CAPTenantOperationApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("captenantoperations"), + v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOperation"), + func() *v1alpha2.CAPTenantOperation { return &v1alpha2.CAPTenantOperation{} }, + func() *v1alpha2.CAPTenantOperationList { return &v1alpha2.CAPTenantOperationList{} }, + func(dst, src *v1alpha2.CAPTenantOperationList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.CAPTenantOperationList) []*v1alpha2.CAPTenantOperation { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.CAPTenantOperationList, items []*v1alpha2.CAPTenantOperation) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenantoutput.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenantoutput.go new file mode 100644 index 00000000..fb26bc87 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_captenantoutput.go @@ -0,0 +1,42 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeCAPTenantOutputs implements CAPTenantOutputInterface +type fakeCAPTenantOutputs struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.CAPTenantOutput, *v1alpha2.CAPTenantOutputList, *smesapcomv1alpha2.CAPTenantOutputApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeCAPTenantOutputs(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.CAPTenantOutputInterface { + return &fakeCAPTenantOutputs{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.CAPTenantOutput, *v1alpha2.CAPTenantOutputList, *smesapcomv1alpha2.CAPTenantOutputApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("captenantoutputs"), + v1alpha2.SchemeGroupVersion.WithKind("CAPTenantOutput"), + func() *v1alpha2.CAPTenantOutput { return &v1alpha2.CAPTenantOutput{} }, + func() *v1alpha2.CAPTenantOutputList { return &v1alpha2.CAPTenantOutputList{} }, + func(dst, src *v1alpha2.CAPTenantOutputList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.CAPTenantOutputList) []*v1alpha2.CAPTenantOutput { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.CAPTenantOutputList, items []*v1alpha2.CAPTenantOutput) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_clusterdomain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_clusterdomain.go new file mode 100644 index 00000000..416459cd --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_clusterdomain.go @@ -0,0 +1,42 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeClusterDomains implements ClusterDomainInterface +type fakeClusterDomains struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.ClusterDomain, *v1alpha2.ClusterDomainList, *smesapcomv1alpha2.ClusterDomainApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeClusterDomains(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.ClusterDomainInterface { + return &fakeClusterDomains{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.ClusterDomain, *v1alpha2.ClusterDomainList, *smesapcomv1alpha2.ClusterDomainApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("clusterdomains"), + v1alpha2.SchemeGroupVersion.WithKind("ClusterDomain"), + func() *v1alpha2.ClusterDomain { return &v1alpha2.ClusterDomain{} }, + func() *v1alpha2.ClusterDomainList { return &v1alpha2.ClusterDomainList{} }, + func(dst, src *v1alpha2.ClusterDomainList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.ClusterDomainList) []*v1alpha2.ClusterDomain { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha2.ClusterDomainList, items []*v1alpha2.ClusterDomain) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_domain.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_domain.go new file mode 100644 index 00000000..1b6836fe --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_domain.go @@ -0,0 +1,40 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/applyconfiguration/sme.sap.com/v1alpha2" + typedsmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + gentype "k8s.io/client-go/gentype" +) + +// fakeDomains implements DomainInterface +type fakeDomains struct { + *gentype.FakeClientWithListAndApply[*v1alpha2.Domain, *v1alpha2.DomainList, *smesapcomv1alpha2.DomainApplyConfiguration] + Fake *FakeSmeV1alpha2 +} + +func newFakeDomains(fake *FakeSmeV1alpha2, namespace string) typedsmesapcomv1alpha2.DomainInterface { + return &fakeDomains{ + gentype.NewFakeClientWithListAndApply[*v1alpha2.Domain, *v1alpha2.DomainList, *smesapcomv1alpha2.DomainApplyConfiguration]( + fake.Fake, + namespace, + v1alpha2.SchemeGroupVersion.WithResource("domains"), + v1alpha2.SchemeGroupVersion.WithKind("Domain"), + func() *v1alpha2.Domain { return &v1alpha2.Domain{} }, + func() *v1alpha2.DomainList { return &v1alpha2.DomainList{} }, + func(dst, src *v1alpha2.DomainList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha2.DomainList) []*v1alpha2.Domain { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha2.DomainList, items []*v1alpha2.Domain) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, + } +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_sme.sap.com_client.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_sme.sap.com_client.go new file mode 100644 index 00000000..b8c7e460 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/fake/fake_sme.sap.com_client.go @@ -0,0 +1,53 @@ +/* +SPDX-FileCopyrightText: 2026 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 ( + v1alpha2 "github.com/sap/cap-operator/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeSmeV1alpha2 struct { + *testing.Fake +} + +func (c *FakeSmeV1alpha2) CAPApplications(namespace string) v1alpha2.CAPApplicationInterface { + return newFakeCAPApplications(c, namespace) +} + +func (c *FakeSmeV1alpha2) CAPApplicationVersions(namespace string) v1alpha2.CAPApplicationVersionInterface { + return newFakeCAPApplicationVersions(c, namespace) +} + +func (c *FakeSmeV1alpha2) CAPTenants(namespace string) v1alpha2.CAPTenantInterface { + return newFakeCAPTenants(c, namespace) +} + +func (c *FakeSmeV1alpha2) CAPTenantOperations(namespace string) v1alpha2.CAPTenantOperationInterface { + return newFakeCAPTenantOperations(c, namespace) +} + +func (c *FakeSmeV1alpha2) CAPTenantOutputs(namespace string) v1alpha2.CAPTenantOutputInterface { + return newFakeCAPTenantOutputs(c, namespace) +} + +func (c *FakeSmeV1alpha2) ClusterDomains(namespace string) v1alpha2.ClusterDomainInterface { + return newFakeClusterDomains(c, namespace) +} + +func (c *FakeSmeV1alpha2) Domains(namespace string) v1alpha2.DomainInterface { + return newFakeDomains(c, namespace) +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSmeV1alpha2) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/generated_expansion.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/generated_expansion.go new file mode 100644 index 00000000..99a33aab --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/generated_expansion.go @@ -0,0 +1,22 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +type CAPApplicationExpansion interface{} + +type CAPApplicationVersionExpansion interface{} + +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/v1alpha2/sme.sap.com_client.go b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/sme.sap.com_client.go new file mode 100644 index 00000000..99742973 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/sme.sap.com/v1alpha2/sme.sap.com_client.go @@ -0,0 +1,120 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + http "net/http" + + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + scheme "github.com/sap/cap-operator/pkg/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type SmeV1alpha2Interface interface { + RESTClient() rest.Interface + CAPApplicationsGetter + CAPApplicationVersionsGetter + CAPTenantsGetter + CAPTenantOperationsGetter + CAPTenantOutputsGetter + ClusterDomainsGetter + DomainsGetter +} + +// SmeV1alpha2Client is used to interact with features provided by the sme.sap.com group. +type SmeV1alpha2Client struct { + restClient rest.Interface +} + +func (c *SmeV1alpha2Client) CAPApplications(namespace string) CAPApplicationInterface { + return newCAPApplications(c, namespace) +} + +func (c *SmeV1alpha2Client) CAPApplicationVersions(namespace string) CAPApplicationVersionInterface { + return newCAPApplicationVersions(c, namespace) +} + +func (c *SmeV1alpha2Client) CAPTenants(namespace string) CAPTenantInterface { + return newCAPTenants(c, namespace) +} + +func (c *SmeV1alpha2Client) CAPTenantOperations(namespace string) CAPTenantOperationInterface { + return newCAPTenantOperations(c, namespace) +} + +func (c *SmeV1alpha2Client) CAPTenantOutputs(namespace string) CAPTenantOutputInterface { + return newCAPTenantOutputs(c, namespace) +} + +func (c *SmeV1alpha2Client) ClusterDomains(namespace string) ClusterDomainInterface { + return newClusterDomains(c, namespace) +} + +func (c *SmeV1alpha2Client) Domains(namespace string) DomainInterface { + return newDomains(c, namespace) +} + +// NewForConfig creates a new SmeV1alpha2Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*SmeV1alpha2Client, error) { + config := *c + setConfigDefaults(&config) + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new SmeV1alpha2Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SmeV1alpha2Client, error) { + config := *c + setConfigDefaults(&config) + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &SmeV1alpha2Client{client}, nil +} + +// NewForConfigOrDie creates a new SmeV1alpha2Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SmeV1alpha2Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SmeV1alpha2Client for the given RESTClient. +func New(c rest.Interface) *SmeV1alpha2Client { + return &SmeV1alpha2Client{c} +} + +func setConfigDefaults(config *rest.Config) { + gv := smesapcomv1alpha2.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *SmeV1alpha2Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index a4865180..90bcf037 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -11,6 +11,7 @@ import ( fmt "fmt" v1alpha1 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha1" + v1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -57,6 +58,22 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case v1alpha1.SchemeGroupVersion.WithResource("domains"): return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha1().Domains().Informer()}, nil + // Group=sme.sap.com, Version=v1alpha2 + case v1alpha2.SchemeGroupVersion.WithResource("capapplications"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().CAPApplications().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("capapplicationversions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().CAPApplicationVersions().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("captenants"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().CAPTenants().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("captenantoperations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().CAPTenantOperations().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("captenantoutputs"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().CAPTenantOutputs().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("clusterdomains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().ClusterDomains().Informer()}, nil + case v1alpha2.SchemeGroupVersion.WithResource("domains"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Sme().V1alpha2().Domains().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/pkg/client/informers/externalversions/sme.sap.com/interface.go b/pkg/client/informers/externalversions/sme.sap.com/interface.go index e1f19bd2..310914b6 100644 --- a/pkg/client/informers/externalversions/sme.sap.com/interface.go +++ b/pkg/client/informers/externalversions/sme.sap.com/interface.go @@ -10,12 +10,15 @@ package sme import ( internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" v1alpha1 "github.com/sap/cap-operator/pkg/client/informers/externalversions/sme.sap.com/v1alpha1" + v1alpha2 "github.com/sap/cap-operator/pkg/client/informers/externalversions/sme.sap.com/v1alpha2" ) // Interface provides access to each of this group's versions. type Interface interface { // V1alpha1 provides access to shared informers for resources in V1alpha1. V1alpha1() v1alpha1.Interface + // V1alpha2 provides access to shared informers for resources in V1alpha2. + V1alpha2() v1alpha2.Interface } type group struct { @@ -33,3 +36,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (g *group) V1alpha1() v1alpha1.Interface { return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) } + +// V1alpha2 returns a new v1alpha2.Interface. +func (g *group) V1alpha2() v1alpha2.Interface { + return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/capapplication.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/capapplication.go new file mode 100644 index 00000000..7740544a --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/capapplication.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CAPApplicationInformer provides access to a shared informer and lister for +// CAPApplications. Prefer using the type-safe variant (see [TypedCAPApplicationInformer]). +type CAPApplicationInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.CAPApplicationLister +} + +// TypedCAPApplicationInformer provides access to a shared informer and lister for +// CAPApplications, including the type-safe TypedInformer variant. +// It is a superset of CAPApplicationInformer. +type TypedCAPApplicationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPApplicationIndexInformer + Lister() smesapcomv1alpha2.CAPApplicationLister +} + +// CAPApplicationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPApplicationIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplication] + +// CAPApplicationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPApplication. +type CAPApplicationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.CAPApplication] + +// CAPApplicationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPApplication. +type CAPApplicationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.CAPApplication] + +// CAPApplicationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPApplication. +type CAPApplicationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.CAPApplication] + +// CAPApplicationIndexers is a specialization of [cache.TypedIndexers] for CAPApplication. +type CAPApplicationIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.CAPApplication] + +// DeletedCAPApplication is a specialization of [cache.DeletedObject] for CAPApplication. +type DeletedCAPApplication = cache.DeletedObject[*apissmesapcomv1alpha2.CAPApplication] + +type cAPApplicationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCAPApplicationInformer constructs a new informer for CAPApplication 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationInformer]). +func NewCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedCAPApplicationInformer constructs a new informer for CAPApplication 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 NewTypedCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationIndexers) CAPApplicationIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredCAPApplicationInformer constructs a new informer for CAPApplication 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPApplicationInformer]). +func NewFilteredCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPApplicationInformer constructs a new informer for CAPApplication 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 NewTypedFilteredCAPApplicationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPApplicationIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewCAPApplicationInformerWithOptions constructs a new informer for CAPApplication type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationInformerWithOptions]). +func NewCAPApplicationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPApplicationInformerWithOptions constructs a new informer for CAPApplication type with additional options. +// 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 NewTypedCAPApplicationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPApplicationIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "capapplications"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplication](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplications(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplications(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplications(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplications(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.CAPApplication{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *cAPApplicationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedCAPApplicationInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *cAPApplicationInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *cAPApplicationInformer) TypedInformer() CAPApplicationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplication](f.factory.InformerFor(&apissmesapcomv1alpha2.CAPApplication{}, f.defaultInformer)) +} + +func (f *cAPApplicationInformer) Lister() smesapcomv1alpha2.CAPApplicationLister { + return smesapcomv1alpha2.NewCAPApplicationLister(f.Informer().GetIndexer()) +} + +// ToTypedCAPApplicationInformer converts an untyped informer into a TypedCAPApplicationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplication. If that is not the case, calling type-safe methods of the returned +// TypedCAPApplicationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPApplicationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPApplicationInformer(informer CAPApplicationInformer) TypedCAPApplicationInformer { + if informer, ok := informer.(TypedCAPApplicationInformer); ok { + return informer + } + return &cAPApplicationTypedInformerAdapter{informer} +} + +type cAPApplicationTypedInformerAdapter struct { + CAPApplicationInformer +} + +func (a *cAPApplicationTypedInformerAdapter) TypedInformer() CAPApplicationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplication](a.Informer()) +} + +// ToCAPApplicationIndexInformer converts an untyped informer into a CAPApplicationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplication. If that is not the case, calling type-safe methods of the returned +// CAPApplicationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPApplicationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPApplicationIndexInformer(informer cache.SharedIndexInformer) CAPApplicationIndexInformer { + if informer, ok := informer.(CAPApplicationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplication](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/capapplicationversion.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/capapplicationversion.go new file mode 100644 index 00000000..749e8e44 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/capapplicationversion.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CAPApplicationVersionInformer provides access to a shared informer and lister for +// CAPApplicationVersions. Prefer using the type-safe variant (see [TypedCAPApplicationVersionInformer]). +type CAPApplicationVersionInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.CAPApplicationVersionLister +} + +// TypedCAPApplicationVersionInformer provides access to a shared informer and lister for +// CAPApplicationVersions, including the type-safe TypedInformer variant. +// It is a superset of CAPApplicationVersionInformer. +type TypedCAPApplicationVersionInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPApplicationVersionIndexInformer + Lister() smesapcomv1alpha2.CAPApplicationVersionLister +} + +// CAPApplicationVersionIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPApplicationVersionIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplicationVersion] + +// CAPApplicationVersionHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPApplicationVersion. +type CAPApplicationVersionHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.CAPApplicationVersion] + +// CAPApplicationVersionDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPApplicationVersion. +type CAPApplicationVersionDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.CAPApplicationVersion] + +// CAPApplicationVersionFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPApplicationVersion. +type CAPApplicationVersionFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.CAPApplicationVersion] + +// CAPApplicationVersionIndexers is a specialization of [cache.TypedIndexers] for CAPApplicationVersion. +type CAPApplicationVersionIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.CAPApplicationVersion] + +// DeletedCAPApplicationVersion is a specialization of [cache.DeletedObject] for CAPApplicationVersion. +type DeletedCAPApplicationVersion = cache.DeletedObject[*apissmesapcomv1alpha2.CAPApplicationVersion] + +type cAPApplicationVersionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationVersionInformer]). +func NewCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion 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 NewTypedCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationVersionIndexers) CAPApplicationVersionIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPApplicationVersionInformer]). +func NewFilteredCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPApplicationVersionInformer constructs a new informer for CAPApplicationVersion 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 NewTypedFilteredCAPApplicationVersionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPApplicationVersionIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPApplicationVersionIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewCAPApplicationVersionInformerWithOptions constructs a new informer for CAPApplicationVersion type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPApplicationVersionInformerWithOptions]). +func NewCAPApplicationVersionInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPApplicationVersionInformerWithOptions constructs a new informer for CAPApplicationVersion type with additional options. +// 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 NewTypedCAPApplicationVersionInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPApplicationVersionIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "capapplicationversions"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplicationVersion](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplicationVersions(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplicationVersions(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplicationVersions(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPApplicationVersions(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.CAPApplicationVersion{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *cAPApplicationVersionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedCAPApplicationVersionInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *cAPApplicationVersionInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *cAPApplicationVersionInformer) TypedInformer() CAPApplicationVersionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplicationVersion](f.factory.InformerFor(&apissmesapcomv1alpha2.CAPApplicationVersion{}, f.defaultInformer)) +} + +func (f *cAPApplicationVersionInformer) Lister() smesapcomv1alpha2.CAPApplicationVersionLister { + return smesapcomv1alpha2.NewCAPApplicationVersionLister(f.Informer().GetIndexer()) +} + +// ToTypedCAPApplicationVersionInformer converts an untyped informer into a TypedCAPApplicationVersionInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplicationVersion. If that is not the case, calling type-safe methods of the returned +// TypedCAPApplicationVersionInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPApplicationVersionInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPApplicationVersionInformer(informer CAPApplicationVersionInformer) TypedCAPApplicationVersionInformer { + if informer, ok := informer.(TypedCAPApplicationVersionInformer); ok { + return informer + } + return &cAPApplicationVersionTypedInformerAdapter{informer} +} + +type cAPApplicationVersionTypedInformerAdapter struct { + CAPApplicationVersionInformer +} + +func (a *cAPApplicationVersionTypedInformerAdapter) TypedInformer() CAPApplicationVersionIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplicationVersion](a.Informer()) +} + +// ToCAPApplicationVersionIndexInformer converts an untyped informer into a CAPApplicationVersionIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPApplicationVersion. If that is not the case, calling type-safe methods of the returned +// CAPApplicationVersionIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPApplicationVersionIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPApplicationVersionIndexInformer(informer cache.SharedIndexInformer) CAPApplicationVersionIndexInformer { + if informer, ok := informer.(CAPApplicationVersionIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPApplicationVersion](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenant.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenant.go new file mode 100644 index 00000000..776cb5d2 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenant.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CAPTenantInformer provides access to a shared informer and lister for +// CAPTenants. Prefer using the type-safe variant (see [TypedCAPTenantInformer]). +type CAPTenantInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.CAPTenantLister +} + +// TypedCAPTenantInformer provides access to a shared informer and lister for +// CAPTenants, including the type-safe TypedInformer variant. +// It is a superset of CAPTenantInformer. +type TypedCAPTenantInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPTenantIndexInformer + Lister() smesapcomv1alpha2.CAPTenantLister +} + +// CAPTenantIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPTenantIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenant] + +// CAPTenantHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPTenant. +type CAPTenantHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.CAPTenant] + +// CAPTenantDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPTenant. +type CAPTenantDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.CAPTenant] + +// CAPTenantFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPTenant. +type CAPTenantFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.CAPTenant] + +// CAPTenantIndexers is a specialization of [cache.TypedIndexers] for CAPTenant. +type CAPTenantIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.CAPTenant] + +// DeletedCAPTenant is a specialization of [cache.DeletedObject] for CAPTenant. +type DeletedCAPTenant = cache.DeletedObject[*apissmesapcomv1alpha2.CAPTenant] + +type cAPTenantInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCAPTenantInformer constructs a new informer for CAPTenant 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantInformer]). +func NewCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedCAPTenantInformer constructs a new informer for CAPTenant 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 NewTypedCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantIndexers) CAPTenantIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredCAPTenantInformer constructs a new informer for CAPTenant 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPTenantInformer]). +func NewFilteredCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPTenantInformer constructs a new informer for CAPTenant 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 NewTypedFilteredCAPTenantInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPTenantIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewCAPTenantInformerWithOptions constructs a new informer for CAPTenant type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantInformerWithOptions]). +func NewCAPTenantInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPTenantInformerWithOptions constructs a new informer for CAPTenant type with additional options. +// 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 NewTypedCAPTenantInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPTenantIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "captenants"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenant](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenants(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenants(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenants(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenants(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.CAPTenant{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *cAPTenantInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedCAPTenantInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *cAPTenantInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *cAPTenantInformer) TypedInformer() CAPTenantIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenant](f.factory.InformerFor(&apissmesapcomv1alpha2.CAPTenant{}, f.defaultInformer)) +} + +func (f *cAPTenantInformer) Lister() smesapcomv1alpha2.CAPTenantLister { + return smesapcomv1alpha2.NewCAPTenantLister(f.Informer().GetIndexer()) +} + +// ToTypedCAPTenantInformer converts an untyped informer into a TypedCAPTenantInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenant. If that is not the case, calling type-safe methods of the returned +// TypedCAPTenantInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPTenantInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPTenantInformer(informer CAPTenantInformer) TypedCAPTenantInformer { + if informer, ok := informer.(TypedCAPTenantInformer); ok { + return informer + } + return &cAPTenantTypedInformerAdapter{informer} +} + +type cAPTenantTypedInformerAdapter struct { + CAPTenantInformer +} + +func (a *cAPTenantTypedInformerAdapter) TypedInformer() CAPTenantIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenant](a.Informer()) +} + +// ToCAPTenantIndexInformer converts an untyped informer into a CAPTenantIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenant. If that is not the case, calling type-safe methods of the returned +// CAPTenantIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPTenantIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPTenantIndexInformer(informer cache.SharedIndexInformer) CAPTenantIndexInformer { + if informer, ok := informer.(CAPTenantIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenant](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenantoperation.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenantoperation.go new file mode 100644 index 00000000..629775eb --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenantoperation.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CAPTenantOperationInformer provides access to a shared informer and lister for +// CAPTenantOperations. Prefer using the type-safe variant (see [TypedCAPTenantOperationInformer]). +type CAPTenantOperationInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.CAPTenantOperationLister +} + +// TypedCAPTenantOperationInformer provides access to a shared informer and lister for +// CAPTenantOperations, including the type-safe TypedInformer variant. +// It is a superset of CAPTenantOperationInformer. +type TypedCAPTenantOperationInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPTenantOperationIndexInformer + Lister() smesapcomv1alpha2.CAPTenantOperationLister +} + +// CAPTenantOperationIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPTenantOperationIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOperation] + +// CAPTenantOperationHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPTenantOperation. +type CAPTenantOperationHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.CAPTenantOperation] + +// CAPTenantOperationDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPTenantOperation. +type CAPTenantOperationDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.CAPTenantOperation] + +// CAPTenantOperationFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPTenantOperation. +type CAPTenantOperationFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.CAPTenantOperation] + +// CAPTenantOperationIndexers is a specialization of [cache.TypedIndexers] for CAPTenantOperation. +type CAPTenantOperationIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.CAPTenantOperation] + +// DeletedCAPTenantOperation is a specialization of [cache.DeletedObject] for CAPTenantOperation. +type DeletedCAPTenantOperation = cache.DeletedObject[*apissmesapcomv1alpha2.CAPTenantOperation] + +type cAPTenantOperationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCAPTenantOperationInformer constructs a new informer for CAPTenantOperation 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOperationInformer]). +func NewCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedCAPTenantOperationInformer constructs a new informer for CAPTenantOperation 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 NewTypedCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOperationIndexers) CAPTenantOperationIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredCAPTenantOperationInformer constructs a new informer for CAPTenantOperation 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPTenantOperationInformer]). +func NewFilteredCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPTenantOperationInformer constructs a new informer for CAPTenantOperation 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 NewTypedFilteredCAPTenantOperationInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOperationIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPTenantOperationIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewCAPTenantOperationInformerWithOptions constructs a new informer for CAPTenantOperation type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOperationInformerWithOptions]). +func NewCAPTenantOperationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPTenantOperationInformerWithOptions constructs a new informer for CAPTenantOperation type with additional options. +// 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 NewTypedCAPTenantOperationInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPTenantOperationIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "captenantoperations"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOperation](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOperations(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOperations(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOperations(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOperations(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.CAPTenantOperation{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *cAPTenantOperationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedCAPTenantOperationInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *cAPTenantOperationInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *cAPTenantOperationInformer) TypedInformer() CAPTenantOperationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOperation](f.factory.InformerFor(&apissmesapcomv1alpha2.CAPTenantOperation{}, f.defaultInformer)) +} + +func (f *cAPTenantOperationInformer) Lister() smesapcomv1alpha2.CAPTenantOperationLister { + return smesapcomv1alpha2.NewCAPTenantOperationLister(f.Informer().GetIndexer()) +} + +// ToTypedCAPTenantOperationInformer converts an untyped informer into a TypedCAPTenantOperationInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOperation. If that is not the case, calling type-safe methods of the returned +// TypedCAPTenantOperationInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPTenantOperationInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPTenantOperationInformer(informer CAPTenantOperationInformer) TypedCAPTenantOperationInformer { + if informer, ok := informer.(TypedCAPTenantOperationInformer); ok { + return informer + } + return &cAPTenantOperationTypedInformerAdapter{informer} +} + +type cAPTenantOperationTypedInformerAdapter struct { + CAPTenantOperationInformer +} + +func (a *cAPTenantOperationTypedInformerAdapter) TypedInformer() CAPTenantOperationIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOperation](a.Informer()) +} + +// ToCAPTenantOperationIndexInformer converts an untyped informer into a CAPTenantOperationIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOperation. If that is not the case, calling type-safe methods of the returned +// CAPTenantOperationIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPTenantOperationIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPTenantOperationIndexInformer(informer cache.SharedIndexInformer) CAPTenantOperationIndexInformer { + if informer, ok := informer.(CAPTenantOperationIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOperation](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenantoutput.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenantoutput.go new file mode 100644 index 00000000..5ed5a5f7 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/captenantoutput.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// CAPTenantOutputInformer provides access to a shared informer and lister for +// CAPTenantOutputs. Prefer using the type-safe variant (see [TypedCAPTenantOutputInformer]). +type CAPTenantOutputInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.CAPTenantOutputLister +} + +// TypedCAPTenantOutputInformer provides access to a shared informer and lister for +// CAPTenantOutputs, including the type-safe TypedInformer variant. +// It is a superset of CAPTenantOutputInformer. +type TypedCAPTenantOutputInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() CAPTenantOutputIndexInformer + Lister() smesapcomv1alpha2.CAPTenantOutputLister +} + +// CAPTenantOutputIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type CAPTenantOutputIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOutput] + +// CAPTenantOutputHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for CAPTenantOutput. +type CAPTenantOutputHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.CAPTenantOutput] + +// CAPTenantOutputDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for CAPTenantOutput. +type CAPTenantOutputDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.CAPTenantOutput] + +// CAPTenantOutputFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for CAPTenantOutput. +type CAPTenantOutputFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.CAPTenantOutput] + +// CAPTenantOutputIndexers is a specialization of [cache.TypedIndexers] for CAPTenantOutput. +type CAPTenantOutputIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.CAPTenantOutput] + +// DeletedCAPTenantOutput is a specialization of [cache.DeletedObject] for CAPTenantOutput. +type DeletedCAPTenantOutput = cache.DeletedObject[*apissmesapcomv1alpha2.CAPTenantOutput] + +type cAPTenantOutputInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewCAPTenantOutputInformer constructs a new informer for CAPTenantOutput 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOutputInformer]). +func NewCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedCAPTenantOutputInformer constructs a new informer for CAPTenantOutput 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 NewTypedCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOutputIndexers) CAPTenantOutputIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// NewFilteredCAPTenantOutputInformer constructs a new informer for CAPTenantOutput 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredCAPTenantOutputInformer]). +func NewFilteredCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredCAPTenantOutputInformer constructs a new informer for CAPTenantOutput 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 NewTypedFilteredCAPTenantOutputInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers CAPTenantOutputIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) CAPTenantOutputIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewCAPTenantOutputInformerWithOptions constructs a new informer for CAPTenantOutput type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedCAPTenantOutputInformerWithOptions]). +func NewCAPTenantOutputInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, namespace, options) +} + +// NewTypedCAPTenantOutputInformerWithOptions constructs a new informer for CAPTenantOutput type with additional options. +// 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 NewTypedCAPTenantOutputInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) CAPTenantOutputIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "captenantoutputs"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOutput](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOutputs(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOutputs(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOutputs(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().CAPTenantOutputs(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.CAPTenantOutput{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *cAPTenantOutputInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedCAPTenantOutputInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *cAPTenantOutputInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *cAPTenantOutputInformer) TypedInformer() CAPTenantOutputIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOutput](f.factory.InformerFor(&apissmesapcomv1alpha2.CAPTenantOutput{}, f.defaultInformer)) +} + +func (f *cAPTenantOutputInformer) Lister() smesapcomv1alpha2.CAPTenantOutputLister { + return smesapcomv1alpha2.NewCAPTenantOutputLister(f.Informer().GetIndexer()) +} + +// ToTypedCAPTenantOutputInformer converts an untyped informer into a TypedCAPTenantOutputInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOutput. If that is not the case, calling type-safe methods of the returned +// TypedCAPTenantOutputInformer leads to runtime panics. A safer alternative is to pass +// around a TypedCAPTenantOutputInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedCAPTenantOutputInformer(informer CAPTenantOutputInformer) TypedCAPTenantOutputInformer { + if informer, ok := informer.(TypedCAPTenantOutputInformer); ok { + return informer + } + return &cAPTenantOutputTypedInformerAdapter{informer} +} + +type cAPTenantOutputTypedInformerAdapter struct { + CAPTenantOutputInformer +} + +func (a *cAPTenantOutputTypedInformerAdapter) TypedInformer() CAPTenantOutputIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOutput](a.Informer()) +} + +// ToCAPTenantOutputIndexInformer converts an untyped informer into a CAPTenantOutputIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *CAPTenantOutput. If that is not the case, calling type-safe methods of the returned +// CAPTenantOutputIndexInformer leads to runtime panics. A safer alternative is to pass +// around a CAPTenantOutputIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToCAPTenantOutputIndexInformer(informer cache.SharedIndexInformer) CAPTenantOutputIndexInformer { + if informer, ok := informer.(CAPTenantOutputIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.CAPTenantOutput](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/clusterdomain.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/clusterdomain.go new file mode 100644 index 00000000..760464e8 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/clusterdomain.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// ClusterDomainInformer provides access to a shared informer and lister for +// ClusterDomains. Prefer using the type-safe variant (see [TypedClusterDomainInformer]). +type ClusterDomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.ClusterDomainLister +} + +// TypedClusterDomainInformer provides access to a shared informer and lister for +// ClusterDomains, including the type-safe TypedInformer variant. +// It is a superset of ClusterDomainInformer. +type TypedClusterDomainInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() ClusterDomainIndexInformer + Lister() smesapcomv1alpha2.ClusterDomainLister +} + +// ClusterDomainIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type ClusterDomainIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.ClusterDomain] + +// ClusterDomainHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for ClusterDomain. +type ClusterDomainHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.ClusterDomain] + +// ClusterDomainDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for ClusterDomain. +type ClusterDomainDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.ClusterDomain] + +// ClusterDomainFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for ClusterDomain. +type ClusterDomainFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.ClusterDomain] + +// ClusterDomainIndexers is a specialization of [cache.TypedIndexers] for ClusterDomain. +type ClusterDomainIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.ClusterDomain] + +// DeletedClusterDomain is a specialization of [cache.DeletedObject] for ClusterDomain. +type DeletedClusterDomain = cache.DeletedObject[*apissmesapcomv1alpha2.ClusterDomain] + +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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterDomainInformer]). +func NewClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedClusterDomainInformer 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 NewTypedClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers ClusterDomainIndexers) ClusterDomainIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredClusterDomainInformer]). +func NewFilteredClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredClusterDomainInformer 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 NewTypedFilteredClusterDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers ClusterDomainIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) ClusterDomainIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewClusterDomainInformerWithOptions constructs a new informer for ClusterDomain type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedClusterDomainInformerWithOptions]). +func NewClusterDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, namespace, options) +} + +// NewTypedClusterDomainInformerWithOptions constructs a new informer for ClusterDomain type with additional options. +// 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 NewTypedClusterDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) ClusterDomainIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "clusterdomains"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.ClusterDomain](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().ClusterDomains(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().ClusterDomains(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().ClusterDomains(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().ClusterDomains(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.ClusterDomain{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *clusterDomainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedClusterDomainInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *clusterDomainInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *clusterDomainInformer) TypedInformer() ClusterDomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.ClusterDomain](f.factory.InformerFor(&apissmesapcomv1alpha2.ClusterDomain{}, f.defaultInformer)) +} + +func (f *clusterDomainInformer) Lister() smesapcomv1alpha2.ClusterDomainLister { + return smesapcomv1alpha2.NewClusterDomainLister(f.Informer().GetIndexer()) +} + +// ToTypedClusterDomainInformer converts an untyped informer into a TypedClusterDomainInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterDomain. If that is not the case, calling type-safe methods of the returned +// TypedClusterDomainInformer leads to runtime panics. A safer alternative is to pass +// around a TypedClusterDomainInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedClusterDomainInformer(informer ClusterDomainInformer) TypedClusterDomainInformer { + if informer, ok := informer.(TypedClusterDomainInformer); ok { + return informer + } + return &clusterDomainTypedInformerAdapter{informer} +} + +type clusterDomainTypedInformerAdapter struct { + ClusterDomainInformer +} + +func (a *clusterDomainTypedInformerAdapter) TypedInformer() ClusterDomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.ClusterDomain](a.Informer()) +} + +// ToClusterDomainIndexInformer converts an untyped informer into a ClusterDomainIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *ClusterDomain. If that is not the case, calling type-safe methods of the returned +// ClusterDomainIndexInformer leads to runtime panics. A safer alternative is to pass +// around a ClusterDomainIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToClusterDomainIndexInformer(informer cache.SharedIndexInformer) ClusterDomainIndexInformer { + if informer, ok := informer.(ClusterDomainIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.ClusterDomain](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/domain.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/domain.go new file mode 100644 index 00000000..f8c26964 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/domain.go @@ -0,0 +1,197 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + context "context" + time "time" + + apissmesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + versioned "github.com/sap/cap-operator/pkg/client/clientset/versioned" + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/client/listers/sme.sap.com/v1alpha2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// DomainInformer provides access to a shared informer and lister for +// Domains. Prefer using the type-safe variant (see [TypedDomainInformer]). +type DomainInformer interface { + Informer() cache.SharedIndexInformer + Lister() smesapcomv1alpha2.DomainLister +} + +// TypedDomainInformer provides access to a shared informer and lister for +// Domains, including the type-safe TypedInformer variant. +// It is a superset of DomainInformer. +type TypedDomainInformer interface { + Informer() cache.SharedIndexInformer + TypedInformer() DomainIndexInformer + Lister() smesapcomv1alpha2.DomainLister +} + +// DomainIndexInformer is a wrapper around the underlying [cache.SharedIndexInformer] +// with type-safe variants of several methods. +type DomainIndexInformer cache.TypedSharedIndexInformer[*apissmesapcomv1alpha2.Domain] + +// DomainHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerFuncs] for Domain. +type DomainHandlerFuncs = cache.TypedResourceEventHandlerFuncs[*apissmesapcomv1alpha2.Domain] + +// DomainDetailedHandlerFuncs is a specialization of [cache.TypedResourceEventHandlerDetailedFuncs] for Domain. +type DomainDetailedHandlerFuncs = cache.TypedResourceEventHandlerDetailedFuncs[*apissmesapcomv1alpha2.Domain] + +// DomainFilteringHandler is a specialization of [cache.TypedFilteringResourceEventHandler] for Domain. +type DomainFilteringHandler = cache.TypedFilteringResourceEventHandler[*apissmesapcomv1alpha2.Domain] + +// DomainIndexers is a specialization of [cache.TypedIndexers] for Domain. +type DomainIndexers = cache.TypedIndexers[*apissmesapcomv1alpha2.Domain] + +// DeletedDomain is a specialization of [cache.DeletedObject] for Domain. +type DeletedDomain = cache.DeletedObject[*apissmesapcomv1alpha2.Domain] + +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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDomainInformer]). +func NewDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers}) +} + +// NewTypedDomainInformer 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 NewTypedDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers DomainIndexers) DomainIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers)}) +} + +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedFilteredDomainInformer]). +func NewFilteredDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: indexers, TweakListOptions: tweakListOptions}) +} + +// NewTypedFilteredDomainInformer 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 NewTypedFilteredDomainInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers DomainIndexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) DomainIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.TypedIndexersToIndexers(indexers), TweakListOptions: tweakListOptions}) +} + +// NewDomainInformerWithOptions constructs a new informer for Domain type with additional options. +// 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. +// If you really need an independent one, prefer using the type-safe variant (see [NewTypedDomainInformerWithOptions]). +func NewDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer { + return NewTypedDomainInformerWithOptions(client, namespace, options) +} + +// NewTypedDomainInformerWithOptions constructs a new informer for Domain type with additional options. +// 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 NewTypedDomainInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) DomainIndexInformer { + gvr := schema.GroupVersionResource{Group: "sme.sap.com", Version: "v1alpha2", Resource: "domains"} + identifier := options.InformerName.WithResource(gvr) + tweakListOptions := options.TweakListOptions + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.Domain](cache.NewSharedIndexInformerWithOptions( + cache.ToListWatcherWithWatchListSemantics(&cache.ListWatch{ + ListFunc: func(opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().Domains(namespace).List(context.Background(), opts) + }, + WatchFunc: func(opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().Domains(namespace).Watch(context.Background(), opts) + }, + ListWithContextFunc: func(ctx context.Context, opts v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().Domains(namespace).List(ctx, opts) + }, + WatchFuncWithContext: func(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&opts) + } + return client.SmeV1alpha2().Domains(namespace).Watch(ctx, opts) + }, + }, client), + &apissmesapcomv1alpha2.Domain{}, + cache.SharedIndexInformerOptions{ + ResyncPeriod: options.ResyncPeriod, + Indexers: options.Indexers, + Identifier: identifier, + }, + )) +} + +func (f *domainInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewTypedDomainInformerWithOptions(client, f.namespace, internalinterfaces.InformerOptions{ResyncPeriod: resyncPeriod, Indexers: cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, InformerName: f.factory.InformerName(), TweakListOptions: f.tweakListOptions}) +} + +func (f *domainInformer) Informer() cache.SharedIndexInformer { + return f.TypedInformer() +} + +func (f *domainInformer) TypedInformer() DomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.Domain](f.factory.InformerFor(&apissmesapcomv1alpha2.Domain{}, f.defaultInformer)) +} + +func (f *domainInformer) Lister() smesapcomv1alpha2.DomainLister { + return smesapcomv1alpha2.NewDomainLister(f.Informer().GetIndexer()) +} + +// ToTypedDomainInformer converts an untyped informer into a TypedDomainInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Domain. If that is not the case, calling type-safe methods of the returned +// TypedDomainInformer leads to runtime panics. A safer alternative is to pass +// around a TypedDomainInformer instances that was obtained from a +// SharedInformerFactory. +func ToTypedDomainInformer(informer DomainInformer) TypedDomainInformer { + if informer, ok := informer.(TypedDomainInformer); ok { + return informer + } + return &domainTypedInformerAdapter{informer} +} + +type domainTypedInformerAdapter struct { + DomainInformer +} + +func (a *domainTypedInformerAdapter) TypedInformer() DomainIndexInformer { + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.Domain](a.Informer()) +} + +// ToDomainIndexInformer converts an untyped informer into a DomainIndexInformer. +// +// WARNING: this conversion is only safe if the informer handles objects of type +// *Domain. If that is not the case, calling type-safe methods of the returned +// DomainIndexInformer leads to runtime panics. A safer alternative is to pass +// around a DomainIndexInformer instances that was obtained from a +// SharedInformerFactory. +func ToDomainIndexInformer(informer cache.SharedIndexInformer) DomainIndexInformer { + if informer, ok := informer.(DomainIndexInformer); ok { + return informer + } + return cache.NewTypedSharedIndexInformer[*apissmesapcomv1alpha2.Domain](informer) +} diff --git a/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/interface.go b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/interface.go new file mode 100644 index 00000000..9e91ec45 --- /dev/null +++ b/pkg/client/informers/externalversions/sme.sap.com/v1alpha2/interface.go @@ -0,0 +1,76 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + internalinterfaces "github.com/sap/cap-operator/pkg/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // CAPApplications returns a CAPApplicationInformer. + CAPApplications() TypedCAPApplicationInformer + // CAPApplicationVersions returns a CAPApplicationVersionInformer. + CAPApplicationVersions() TypedCAPApplicationVersionInformer + // CAPTenants returns a CAPTenantInformer. + CAPTenants() TypedCAPTenantInformer + // CAPTenantOperations returns a CAPTenantOperationInformer. + CAPTenantOperations() TypedCAPTenantOperationInformer + // CAPTenantOutputs returns a CAPTenantOutputInformer. + CAPTenantOutputs() TypedCAPTenantOutputInformer + // ClusterDomains returns a ClusterDomainInformer. + ClusterDomains() TypedClusterDomainInformer + // Domains returns a DomainInformer. + Domains() TypedDomainInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// CAPApplications returns a TypedCAPApplicationInformer. +func (v *version) CAPApplications() TypedCAPApplicationInformer { + return &cAPApplicationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// CAPApplicationVersions returns a TypedCAPApplicationVersionInformer. +func (v *version) CAPApplicationVersions() TypedCAPApplicationVersionInformer { + return &cAPApplicationVersionInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// CAPTenants returns a TypedCAPTenantInformer. +func (v *version) CAPTenants() TypedCAPTenantInformer { + return &cAPTenantInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// CAPTenantOperations returns a TypedCAPTenantOperationInformer. +func (v *version) CAPTenantOperations() TypedCAPTenantOperationInformer { + return &cAPTenantOperationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// CAPTenantOutputs returns a TypedCAPTenantOutputInformer. +func (v *version) CAPTenantOutputs() TypedCAPTenantOutputInformer { + return &cAPTenantOutputInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// ClusterDomains returns a TypedClusterDomainInformer. +func (v *version) ClusterDomains() TypedClusterDomainInformer { + return &clusterDomainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// Domains returns a TypedDomainInformer. +func (v *version) Domains() TypedDomainInformer { + return &domainInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/capapplication.go b/pkg/client/listers/sme.sap.com/v1alpha2/capapplication.go new file mode 100644 index 00000000..e425e85b --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/capapplication.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// CAPApplicationLister helps list CAPApplications. +// All objects returned here must be treated as read-only. +type CAPApplicationLister interface { + // List lists all CAPApplications in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPApplication, err error) + // CAPApplications returns an object that can list and get CAPApplications. + CAPApplications(namespace string) CAPApplicationNamespaceLister + CAPApplicationListerExpansion +} + +// cAPApplicationLister implements the CAPApplicationLister interface. +type cAPApplicationLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPApplication] +} + +// NewCAPApplicationLister returns a new CAPApplicationLister. +func NewCAPApplicationLister(indexer cache.Indexer) CAPApplicationLister { + return &cAPApplicationLister{listers.New[*smesapcomv1alpha2.CAPApplication](indexer, smesapcomv1alpha2.Resource("capapplication"))} +} + +// CAPApplications returns an object that can list and get CAPApplications. +func (s *cAPApplicationLister) CAPApplications(namespace string) CAPApplicationNamespaceLister { + return cAPApplicationNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.CAPApplication](s.ResourceIndexer, namespace)} +} + +// CAPApplicationNamespaceLister helps list and get CAPApplications. +// All objects returned here must be treated as read-only. +type CAPApplicationNamespaceLister interface { + // List lists all CAPApplications in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPApplication, err error) + // Get retrieves the CAPApplication from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha2.CAPApplication, error) + CAPApplicationNamespaceListerExpansion +} + +// cAPApplicationNamespaceLister implements the CAPApplicationNamespaceLister +// interface. +type cAPApplicationNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPApplication] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/capapplicationversion.go b/pkg/client/listers/sme.sap.com/v1alpha2/capapplicationversion.go new file mode 100644 index 00000000..5bffc846 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/capapplicationversion.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// CAPApplicationVersionLister helps list CAPApplicationVersions. +// All objects returned here must be treated as read-only. +type CAPApplicationVersionLister interface { + // List lists all CAPApplicationVersions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPApplicationVersion, err error) + // CAPApplicationVersions returns an object that can list and get CAPApplicationVersions. + CAPApplicationVersions(namespace string) CAPApplicationVersionNamespaceLister + CAPApplicationVersionListerExpansion +} + +// cAPApplicationVersionLister implements the CAPApplicationVersionLister interface. +type cAPApplicationVersionLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPApplicationVersion] +} + +// NewCAPApplicationVersionLister returns a new CAPApplicationVersionLister. +func NewCAPApplicationVersionLister(indexer cache.Indexer) CAPApplicationVersionLister { + return &cAPApplicationVersionLister{listers.New[*smesapcomv1alpha2.CAPApplicationVersion](indexer, smesapcomv1alpha2.Resource("capapplicationversion"))} +} + +// CAPApplicationVersions returns an object that can list and get CAPApplicationVersions. +func (s *cAPApplicationVersionLister) CAPApplicationVersions(namespace string) CAPApplicationVersionNamespaceLister { + return cAPApplicationVersionNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.CAPApplicationVersion](s.ResourceIndexer, namespace)} +} + +// CAPApplicationVersionNamespaceLister helps list and get CAPApplicationVersions. +// All objects returned here must be treated as read-only. +type CAPApplicationVersionNamespaceLister interface { + // List lists all CAPApplicationVersions in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPApplicationVersion, err error) + // Get retrieves the CAPApplicationVersion from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha2.CAPApplicationVersion, error) + CAPApplicationVersionNamespaceListerExpansion +} + +// cAPApplicationVersionNamespaceLister implements the CAPApplicationVersionNamespaceLister +// interface. +type cAPApplicationVersionNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPApplicationVersion] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/captenant.go b/pkg/client/listers/sme.sap.com/v1alpha2/captenant.go new file mode 100644 index 00000000..2fd05f19 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/captenant.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// CAPTenantLister helps list CAPTenants. +// All objects returned here must be treated as read-only. +type CAPTenantLister interface { + // List lists all CAPTenants in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPTenant, err error) + // CAPTenants returns an object that can list and get CAPTenants. + CAPTenants(namespace string) CAPTenantNamespaceLister + CAPTenantListerExpansion +} + +// cAPTenantLister implements the CAPTenantLister interface. +type cAPTenantLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPTenant] +} + +// NewCAPTenantLister returns a new CAPTenantLister. +func NewCAPTenantLister(indexer cache.Indexer) CAPTenantLister { + return &cAPTenantLister{listers.New[*smesapcomv1alpha2.CAPTenant](indexer, smesapcomv1alpha2.Resource("captenant"))} +} + +// CAPTenants returns an object that can list and get CAPTenants. +func (s *cAPTenantLister) CAPTenants(namespace string) CAPTenantNamespaceLister { + return cAPTenantNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.CAPTenant](s.ResourceIndexer, namespace)} +} + +// CAPTenantNamespaceLister helps list and get CAPTenants. +// All objects returned here must be treated as read-only. +type CAPTenantNamespaceLister interface { + // List lists all CAPTenants in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPTenant, err error) + // Get retrieves the CAPTenant from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha2.CAPTenant, error) + CAPTenantNamespaceListerExpansion +} + +// cAPTenantNamespaceLister implements the CAPTenantNamespaceLister +// interface. +type cAPTenantNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPTenant] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/captenantoperation.go b/pkg/client/listers/sme.sap.com/v1alpha2/captenantoperation.go new file mode 100644 index 00000000..d44edb97 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/captenantoperation.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// CAPTenantOperationLister helps list CAPTenantOperations. +// All objects returned here must be treated as read-only. +type CAPTenantOperationLister interface { + // List lists all CAPTenantOperations in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPTenantOperation, err error) + // CAPTenantOperations returns an object that can list and get CAPTenantOperations. + CAPTenantOperations(namespace string) CAPTenantOperationNamespaceLister + CAPTenantOperationListerExpansion +} + +// cAPTenantOperationLister implements the CAPTenantOperationLister interface. +type cAPTenantOperationLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPTenantOperation] +} + +// NewCAPTenantOperationLister returns a new CAPTenantOperationLister. +func NewCAPTenantOperationLister(indexer cache.Indexer) CAPTenantOperationLister { + return &cAPTenantOperationLister{listers.New[*smesapcomv1alpha2.CAPTenantOperation](indexer, smesapcomv1alpha2.Resource("captenantoperation"))} +} + +// CAPTenantOperations returns an object that can list and get CAPTenantOperations. +func (s *cAPTenantOperationLister) CAPTenantOperations(namespace string) CAPTenantOperationNamespaceLister { + return cAPTenantOperationNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.CAPTenantOperation](s.ResourceIndexer, namespace)} +} + +// CAPTenantOperationNamespaceLister helps list and get CAPTenantOperations. +// All objects returned here must be treated as read-only. +type CAPTenantOperationNamespaceLister interface { + // List lists all CAPTenantOperations in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPTenantOperation, err error) + // Get retrieves the CAPTenantOperation from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha2.CAPTenantOperation, error) + CAPTenantOperationNamespaceListerExpansion +} + +// cAPTenantOperationNamespaceLister implements the CAPTenantOperationNamespaceLister +// interface. +type cAPTenantOperationNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPTenantOperation] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/captenantoutput.go b/pkg/client/listers/sme.sap.com/v1alpha2/captenantoutput.go new file mode 100644 index 00000000..8d670249 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/captenantoutput.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" +) + +// CAPTenantOutputLister helps list CAPTenantOutputs. +// All objects returned here must be treated as read-only. +type CAPTenantOutputLister interface { + // List lists all CAPTenantOutputs in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPTenantOutput, err error) + // CAPTenantOutputs returns an object that can list and get CAPTenantOutputs. + CAPTenantOutputs(namespace string) CAPTenantOutputNamespaceLister + CAPTenantOutputListerExpansion +} + +// cAPTenantOutputLister implements the CAPTenantOutputLister interface. +type cAPTenantOutputLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPTenantOutput] +} + +// NewCAPTenantOutputLister returns a new CAPTenantOutputLister. +func NewCAPTenantOutputLister(indexer cache.Indexer) CAPTenantOutputLister { + return &cAPTenantOutputLister{listers.New[*smesapcomv1alpha2.CAPTenantOutput](indexer, smesapcomv1alpha2.Resource("captenantoutput"))} +} + +// CAPTenantOutputs returns an object that can list and get CAPTenantOutputs. +func (s *cAPTenantOutputLister) CAPTenantOutputs(namespace string) CAPTenantOutputNamespaceLister { + return cAPTenantOutputNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.CAPTenantOutput](s.ResourceIndexer, namespace)} +} + +// CAPTenantOutputNamespaceLister helps list and get CAPTenantOutputs. +// All objects returned here must be treated as read-only. +type CAPTenantOutputNamespaceLister interface { + // List lists all CAPTenantOutputs in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*smesapcomv1alpha2.CAPTenantOutput, err error) + // Get retrieves the CAPTenantOutput from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*smesapcomv1alpha2.CAPTenantOutput, error) + CAPTenantOutputNamespaceListerExpansion +} + +// cAPTenantOutputNamespaceLister implements the CAPTenantOutputNamespaceLister +// interface. +type cAPTenantOutputNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.CAPTenantOutput] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/clusterdomain.go b/pkg/client/listers/sme.sap.com/v1alpha2/clusterdomain.go new file mode 100644 index 00000000..377bc9f6 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/clusterdomain.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + 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 []*smesapcomv1alpha2.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[*smesapcomv1alpha2.ClusterDomain] +} + +// NewClusterDomainLister returns a new ClusterDomainLister. +func NewClusterDomainLister(indexer cache.Indexer) ClusterDomainLister { + return &clusterDomainLister{listers.New[*smesapcomv1alpha2.ClusterDomain](indexer, smesapcomv1alpha2.Resource("clusterdomain"))} +} + +// ClusterDomains returns an object that can list and get ClusterDomains. +func (s *clusterDomainLister) ClusterDomains(namespace string) ClusterDomainNamespaceLister { + return clusterDomainNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.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 []*smesapcomv1alpha2.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) (*smesapcomv1alpha2.ClusterDomain, error) + ClusterDomainNamespaceListerExpansion +} + +// clusterDomainNamespaceLister implements the ClusterDomainNamespaceLister +// interface. +type clusterDomainNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.ClusterDomain] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/domain.go b/pkg/client/listers/sme.sap.com/v1alpha2/domain.go new file mode 100644 index 00000000..4c7951f3 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/domain.go @@ -0,0 +1,59 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +import ( + smesapcomv1alpha2 "github.com/sap/cap-operator/pkg/apis/sme.sap.com/v1alpha2" + 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 []*smesapcomv1alpha2.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[*smesapcomv1alpha2.Domain] +} + +// NewDomainLister returns a new DomainLister. +func NewDomainLister(indexer cache.Indexer) DomainLister { + return &domainLister{listers.New[*smesapcomv1alpha2.Domain](indexer, smesapcomv1alpha2.Resource("domain"))} +} + +// Domains returns an object that can list and get Domains. +func (s *domainLister) Domains(namespace string) DomainNamespaceLister { + return domainNamespaceLister{listers.NewNamespaced[*smesapcomv1alpha2.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 []*smesapcomv1alpha2.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) (*smesapcomv1alpha2.Domain, error) + DomainNamespaceListerExpansion +} + +// domainNamespaceLister implements the DomainNamespaceLister +// interface. +type domainNamespaceLister struct { + listers.ResourceIndexer[*smesapcomv1alpha2.Domain] +} diff --git a/pkg/client/listers/sme.sap.com/v1alpha2/expansion_generated.go b/pkg/client/listers/sme.sap.com/v1alpha2/expansion_generated.go new file mode 100644 index 00000000..0754c069 --- /dev/null +++ b/pkg/client/listers/sme.sap.com/v1alpha2/expansion_generated.go @@ -0,0 +1,64 @@ +/* +SPDX-FileCopyrightText: 2026 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 v1alpha2 + +// CAPApplicationListerExpansion allows custom methods to be added to +// CAPApplicationLister. +type CAPApplicationListerExpansion interface{} + +// CAPApplicationNamespaceListerExpansion allows custom methods to be added to +// CAPApplicationNamespaceLister. +type CAPApplicationNamespaceListerExpansion interface{} + +// CAPApplicationVersionListerExpansion allows custom methods to be added to +// CAPApplicationVersionLister. +type CAPApplicationVersionListerExpansion interface{} + +// CAPApplicationVersionNamespaceListerExpansion allows custom methods to be added to +// CAPApplicationVersionNamespaceLister. +type CAPApplicationVersionNamespaceListerExpansion interface{} + +// CAPTenantListerExpansion allows custom methods to be added to +// CAPTenantLister. +type CAPTenantListerExpansion interface{} + +// CAPTenantNamespaceListerExpansion allows custom methods to be added to +// CAPTenantNamespaceLister. +type CAPTenantNamespaceListerExpansion interface{} + +// CAPTenantOperationListerExpansion allows custom methods to be added to +// CAPTenantOperationLister. +type CAPTenantOperationListerExpansion interface{} + +// CAPTenantOperationNamespaceListerExpansion allows custom methods to be added to +// CAPTenantOperationNamespaceLister. +type CAPTenantOperationNamespaceListerExpansion interface{} + +// CAPTenantOutputListerExpansion allows custom methods to be added to +// CAPTenantOutputLister. +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{} diff --git a/website/content/en/docs/usage/domain-management/_index.md b/website/content/en/docs/usage/domain-management/_index.md index fcad1301..3bbea1d7 100644 --- a/website/content/en/docs/usage/domain-management/_index.md +++ b/website/content/en/docs/usage/domain-management/_index.md @@ -109,10 +109,9 @@ Create the `Domain` and `ClusterDomain` resources manually (see sections above),
### Mutation Webhook -A mutation webhook ensures consistency: if a `CAPApplication` is submitted with a `domains` section, the webhook converts it to `Domain`/`ClusterDomain` resources and populates `domainRefs` automatically. {{% alert color="warning" title="Warning" %}} -The webhook rejects updates that reintroduce the deprecated `domains` section. If you add or modify the `domains` section in your manifest, the webhook rejects the change and provides an error message instructing you to use `domainRefs` instead. +The mutating webhook has been removed as of [v0.37.0](https://github.com/SAP/cap-operator/releases/tag/v0.37.0) {{% /alert %}} ### Automatic Migration (v0.15.0 – v0.25.0)