From 76335e0250972129930bc3f26cefc4993de260c7 Mon Sep 17 00:00:00 2001 From: Pavan <25031267+Pavan-SAP@users.noreply.github.com> Date: Thu, 1 Aug 2024 13:13:57 +0200 Subject: [PATCH] [Misc] Operator: Logs updated (#107) Several updates to logging --------- Co-authored-by: i325261 --- .../controller/reconcile-capapplication.go | 24 ++++----- .../reconcile-capapplicationversion.go | 42 +++++++++------- .../reconcile-capapplicationversion_test.go | 6 +-- internal/controller/reconcile-captenant.go | 32 ++++++------ .../reconcile-captenantoperation.go | 29 +++++++---- internal/controller/reconcile-domains.go | 50 +++++++++---------- internal/controller/reconcile.go | 19 +++---- .../testdata/captenant/cat-03.expected.yaml | 2 + .../testdata/captenant/cat-07.expected.yaml | 1 + .../testdata/captenant/cat-09.expected.yaml | 2 + .../testdata/captenant/cat-24.expected.yaml | 1 + .../testdata/captenant/cat-25.expected.yaml | 1 + .../testdata/captenant/cat-27.expected.yaml | 1 + .../testdata/captenant/cat-28.expected.yaml | 2 + .../captenantoperation/ctop-01.expected.yaml | 2 + .../captenantoperation/ctop-02.expected.yaml | 2 + .../captenantoperation/ctop-02.initial.yaml | 2 + .../captenantoperation/ctop-03.expected.yaml | 2 + .../captenantoperation/ctop-03.initial.yaml | 2 + .../captenantoperation/ctop-04.expected.yaml | 2 + .../captenantoperation/ctop-04.initial.yaml | 2 + .../captenantoperation/ctop-05.expected.yaml | 1 + .../captenantoperation/ctop-06.expected.yaml | 1 + .../captenantoperation/ctop-06.initial.yaml | 1 + .../captenantoperation/ctop-07.expected.yaml | 1 + .../captenantoperation/ctop-07.initial.yaml | 1 + .../captenantoperation/ctop-08.expected.yaml | 1 + .../captenantoperation/ctop-08.initial.yaml | 1 + .../captenantoperation/ctop-09.expected.yaml | 1 + .../captenantoperation/ctop-09.initial.yaml | 1 + .../captenantoperation/ctop-10.expected.yaml | 1 + .../captenantoperation/ctop-10.initial.yaml | 1 + .../captenantoperation/ctop-11.expected.yaml | 1 + .../captenantoperation/ctop-11.initial.yaml | 1 + .../captenantoperation/ctop-12.expected.yaml | 1 + .../captenantoperation/ctop-12.initial.yaml | 1 + .../captenantoperation/ctop-13.expected.yaml | 1 + .../captenantoperation/ctop-13.initial.yaml | 1 + .../captenantoperation/ctop-14.expected.yaml | 1 + .../captenantoperation/ctop-14.initial.yaml | 1 + .../captenantoperation/ctop-16.expected.yaml | 2 + .../captenantoperation/ctop-16.initial.yaml | 2 + .../captenantoperation/ctop-17.expected.yaml | 2 + .../captenantoperation/ctop-17.initial.yaml | 2 + .../captenantoperation/ctop-18.expected.yaml | 2 + .../captenantoperation/ctop-18.initial.yaml | 2 + .../captenantoperation/ctop-19.expected.yaml | 2 + .../captenantoperation/ctop-19.initial.yaml | 2 + .../captenantoperation/ctop-20.expected.yaml | 2 + .../captenantoperation/ctop-20.initial.yaml | 2 + .../captenantoperation/ctop-21.expected.yaml | 2 + .../captenantoperation/ctop-21.initial.yaml | 2 + .../captenantoperation/ctop-22.expected.yaml | 2 + .../captenantoperation/ctop-22.initial.yaml | 2 + .../captenantoperation/ctop-23.expected.yaml | 1 + .../captenantoperation/ctop-23.initial.yaml | 1 + .../captenantoperation/ctop-24.expected.yaml | 2 + .../captenantoperation/ctop-24.initial.yaml | 2 + .../captenantoperation/ctop-25.expected.yaml | 1 + .../captenantoperation/ctop-25.initial.yaml | 1 + .../captenantoperation/ctop-26.expected.yaml | 1 + .../captenantoperation/ctop-26.initial.yaml | 1 + .../ctop-init-custom.expected.yaml | 1 + .../ctop-init-custom.initial.yaml | 1 + .../ctop-init.expected.yaml | 2 + .../captenantoperation/ctop-init.initial.yaml | 2 + .../ctop-scheduling-custom.expected.yaml | 1 + .../ctop-scheduling-custom.initial.yaml | 1 + .../ctop-scheduling.expected.yaml | 2 + .../ctop-scheduling.initial.yaml | 2 + .../ctop-vol-custom.expected.yaml | 1 + .../ctop-vol-custom.initial.yaml | 1 + .../captenantoperation/ctop-vol.expected.yaml | 2 + .../captenantoperation/ctop-vol.initial.yaml | 2 + internal/util/log.go | 8 +-- 75 files changed, 208 insertions(+), 101 deletions(-) diff --git a/internal/controller/reconcile-capapplication.go b/internal/controller/reconcile-capapplication.go index 0aad7cd..1eb6b47 100644 --- a/internal/controller/reconcile-capapplication.go +++ b/internal/controller/reconcile-capapplication.go @@ -119,7 +119,7 @@ func (c *Controller) handleCAPApplicationDependentResources(ctx context.Context, return } - // step 5 - check state of dependant resources + // step 5 - check state of dependent resources if processing, err = c.checkPrimaryDomainResources(ctx, ca); err != nil || processing { return } @@ -270,7 +270,7 @@ func (c *Controller) validateSecrets(ctx context.Context, ca *v1alpha1.CAPApplic // waiting for secrets message := fmt.Sprintf("waiting for secrets to get ready for %s %s.%s", v1alpha1.CAPApplicationKind, ca.Name, ca.Namespace) - util.LogInfo(message, string(ApplicationProcessing), ca, nil) + util.LogInfo("Waiting for secrets", string(Processing), ca, nil) c.Event(ca, nil, corev1.EventTypeWarning, CAPApplicationEventMissingSecrets, EventActionProcessingSecrets, message) ca.SetStatusWithReadyCondition(ca.Status.State, metav1.ConditionFalse, EventActionProcessingSecrets, message) return true, nil @@ -324,13 +324,13 @@ func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, }, }, metav1.CreateOptions{}) if err != nil { - util.LogError(err, "Error creating tenant subscription context secret", string(ApplicationProcessing), ca, nil, "tenantId", ca.Spec.Provider.TenantId) + 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()) return false, err } // Create provider tenant - util.LogInfo("Creating Provider tenant", string(ApplicationProcessing), ca, nil, "tenantId", ca.Spec.Provider.TenantId) + util.LogInfo("Creating provider tenant", string(Processing), ca, nil, "tenantId", ca.Spec.Provider.TenantId) if tenant, err = c.crdClient.SmeV1alpha1().CAPTenants(ca.Namespace).Create( ctx, &v1alpha1.CAPTenant{ @@ -366,7 +366,7 @@ func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, } _, 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(ApplicationProcessing), ca, nil, "tenantId", ca.Spec.Provider.TenantId) + 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()) return false, err } @@ -382,7 +382,7 @@ func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, } 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) - util.LogInfo(msg, string(ApplicationProcessing), ca, tenant, "tenantId", ca.Spec.Provider.TenantId) + 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) return true, nil } @@ -393,34 +393,34 @@ func (c *Controller) reconcileCAPApplicationProviderTenant(ctx context.Context, func (c *Controller) handleCAPApplicationDeletion(ctx context.Context, ca *v1alpha1.CAPApplication) (*ReconcileResult, error) { var err error - util.LogInfo("Attempting to delete CAPApplication", string(ApplicationDeleting), ca, nil) + util.LogInfo("Attempting to delete application", string(Deleting), ca, nil) if ca.Status.State != v1alpha1.CAPApplicationStateDeleting { ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateDeleting, metav1.ConditionFalse, "DeleteTriggered", "") return NewReconcileResultWithResource(ResourceCAPApplication, ca.Name, ca.Namespace, 0), nil } // TODO: cleanup domain resources via reconciliation - util.LogInfo("Removing Primary Domain Certificate", string(ApplicationDeleting), ca, nil) + util.LogInfo("Removing primary domain certificate", string(Deleting), ca, nil) if err = c.deletePrimaryDomainCertificate(ctx, ca); err != nil && !k8sErrors.IsNotFound(err) { return nil, err } // delete CAPTenants - return if found in this loop, to verify deletion var tenantFound bool - util.LogInfo("Deleting Tenants", string(ApplicationDeleting), ca, nil) + util.LogInfo("Deleting dependent tenants", string(Deleting), ca, nil) if tenantFound, err = c.deleteTenants(ctx, ca); tenantFound || err != nil { - util.LogInfo("Could not delete; tenants exists for this application", string(ApplicationDeleting), ca, nil) + util.LogError(err, "Could not delete dependent tenant", string(Deleting), ca, nil) return nil, err } - util.LogInfo("Cleaning up secrets", string(ApplicationDeleting), ca, nil) + util.LogInfo("Cleaning up secrets", string(Deleting), ca, nil) if err = c.cleanupPreservedSecrets(ca.Spec.BTP.Services, ca.Namespace); err != nil && !k8sErrors.IsNotFound(err) { return nil, err } // delete CAPApplication if removeFinalizer(&ca.Finalizers, FinalizerCAPApplication) { - util.LogInfo("Removing Finalizer; finished deleting this application", string(ApplicationDeleting), ca, nil) + util.LogInfo("Removing Finalizer; finished deleting this application", string(Deleting), ca, nil) return nil, c.updateCAPApplication(ctx, ca) } diff --git a/internal/controller/reconcile-capapplicationversion.go b/internal/controller/reconcile-capapplicationversion.go index d6c0956..c35ab58 100644 --- a/internal/controller/reconcile-capapplicationversion.go +++ b/internal/controller/reconcile-capapplicationversion.go @@ -85,7 +85,7 @@ func (c *Controller) updateCAPApplicationVersionStatus(ctx context.Context, cav *cav = *cavUpdated } if statusErr != nil { - util.LogError(statusErr, "could not update status of application version", string(ApplicationVersionProcessing), cav, nil) + util.LogError(statusErr, "Could not update status of application version", string(Processing), cav, nil, "version", cav.Spec.Version) } return statusErr @@ -107,7 +107,7 @@ func (c *Controller) handleCAPApplicationVersion(ctx context.Context, cav *v1alp err := c.checkSecretsExist(ca.Spec.BTP.Services, ca.Namespace) if err != nil { // Requeue after 10s to check if secrets exist - util.LogInfo("Missing secrets; Check again if the required secrets exists after 10 seconds", string(ApplicationVersionProcessing), cav, nil) + util.LogInfo("Missing secrets; check again if the required secrets exists 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"}) } @@ -187,8 +187,11 @@ func (c *Controller) processDeployments(ctx context.Context, ca *v1alpha1.CAPApp return nil, err } - // We do not want to wait until the deployments are actually "Ready", we only rely on Content Job completing successfully! - util.LogInfo("All deployments and services created successfully", string(ApplicationVersionReady), cav, nil) + // For now, we do not want to wait until the deployments are actually "Ready", we only rely on Content Job completing successfully! + if cav.Status.State == v1alpha1.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: "CreatedDeployments"}) } @@ -254,7 +257,7 @@ func (c *Controller) handleContentDeployJob(ca *v1alpha1.CAPApplication, cav *v1 if err == nil { contentDeployJob, err = c.kubeClient.BatchV1().Jobs(cav.Namespace).Create(context.TODO(), newContentDeploymentJob(ca, cav, workload, ownerRef, vcapSecretName), metav1.CreateOptions{}) if err == nil { - util.LogInfo("Content Job created successfully", string(ApplicationVersionProcessing), cav, contentDeployJob) + util.LogInfo("Content job created successfully", string(Processing), cav, contentDeployJob, "version", cav.Spec.Version) } } } @@ -274,7 +277,7 @@ func newContentDeploymentJob(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPAppli contentJobName := getContentJobName(workload.Name, cav) - util.LogInfo("Creating content Job", string(ApplicationVersionProcessing), cav, nil, "contentJobName", contentJobName) + util.LogInfo("Creating content job", string(Processing), cav, nil, "contentJobName", contentJobName, "version", cav.Spec.Version) return &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ @@ -375,7 +378,7 @@ func (c *Controller) updateServices(ca *v1alpha1.CAPApplication, cav *v1alpha1.C if k8sErrors.IsNotFound(err) { service, err = c.kubeClient.CoreV1().Services(cav.Namespace).Create(context.TODO(), newService(ca, cav, workloadServicePortInfo), metav1.CreateOptions{}) if err == nil { - util.LogInfo("Service created successfully", string(ApplicationVersionProcessing), cav, service) + util.LogInfo("Service created successfully", string(Processing), cav, service, "version", cav.Spec.Version) } } @@ -403,7 +406,7 @@ func newService(ca *v1alpha1.CAPApplication, cav *v1alpha1.CAPApplicationVersion labels := copyMaps(workload.Labels, getLabels(ca, cav, CategoryService, workloadServicePortInfo.DeploymentType, workloadServicePortInfo.WorkloadName+ServiceSuffix, true)) - util.LogInfo("Creating service", string(ApplicationVersionProcessing), cav, nil, "serviceName", workloadServicePortInfo.WorkloadName+ServiceSuffix) + util.LogInfo("Creating service", string(Processing), cav, nil, "serviceName", workloadServicePortInfo.WorkloadName+ServiceSuffix, "version", cav.Spec.Version) return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ @@ -466,7 +469,7 @@ func (c *Controller) createNetworkPolicy(name string, spec networkingv1.NetworkP networkPolicy, err := c.kubeClient.NetworkingV1().NetworkPolicies(cav.Namespace).Get(context.TODO(), name, metav1.GetOptions{}) // If the resource doesn't exist, we'll create it if k8sErrors.IsNotFound(err) { - util.LogInfo("Creating network policy", string(ApplicationVersionProcessing), cav, nil, "networkPolicyName", name) + util.LogInfo("Creating network policy", string(Processing), cav, nil, "networkPolicyName", name, "version", cav.Spec.Version) networkPolicy, err = c.kubeClient.NetworkingV1().NetworkPolicies(cav.Namespace).Create(context.TODO(), &networkingv1.NetworkPolicy{ ObjectMeta: metav1.ObjectMeta{ Name: name, @@ -478,7 +481,7 @@ func (c *Controller) createNetworkPolicy(name string, spec networkingv1.NetworkP Spec: spec, }, metav1.CreateOptions{}) if err == nil { - util.LogInfo("Network Policy created successfully", string(ApplicationVersionProcessing), cav, networkPolicy) + util.LogInfo("Network policy created successfully", string(Processing), cav, networkPolicy, "version", cav.Spec.Version) } } return doChecks(err, networkPolicy, cav, "NetworkPolicy") @@ -566,7 +569,7 @@ func (c *Controller) updateDeployment(ca *v1alpha1.CAPApplication, cav *v1alpha1 if err == nil { workloadDeployment, err = c.kubeClient.AppsV1().Deployments(cav.Namespace).Create(context.TODO(), newDeployment(ca, cav, workload, ownerRef, vcapSecretName), metav1.CreateOptions{}) if err == nil { - util.LogInfo("Deployment created successfully", string(ApplicationVersionProcessing), cav, workloadDeployment) + util.LogInfo("Deployment created successfully", string(Processing), cav, workloadDeployment, "version", cav.Spec.Version) } } } @@ -592,7 +595,7 @@ func createDeployment(params *DeploymentParameters) *appsv1.Deployment { annotations := copyMaps(params.WorkloadDetails.Annotations, getAnnotations(params.CA, params.CAV, true)) labels := copyMaps(params.WorkloadDetails.Labels, getLabels(params.CA, params.CAV, CategoryWorkload, string(params.WorkloadDetails.DeploymentDefinition.Type), workloadName, true)) - util.LogInfo("Creating deployment", string(ApplicationVersionProcessing), params.CAV, nil, "deploymentName", workloadName) + util.LogInfo("Creating deployment", string(Processing), params.CAV, nil, "deploymentName", workloadName, "version", params.CAV.Spec.Version) return &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ @@ -824,7 +827,7 @@ func doChecks(err error, obj metav1.Object, cav *v1alpha1.CAPApplicationVersion, // attempt processing again later. This could have been caused by a // temporary network failure, or any other transient reason. if err != nil { - util.LogError(err, "Error during CAPApplicationVersion Processing", string(ApplicationVersionProcessing), cav, obj, "resource", res) + util.LogError(err, "Error during application version processing", string(Processing), cav, obj, "resource", res, "version", cav.Spec.Version) return err } @@ -895,13 +898,16 @@ func (c *Controller) checkContentWorkloadStatus(ctx context.Context, cav *v1alph // If the job is still running, set processing to true if !cav.CheckFinishedJobs(job) { - util.LogInfo("Waiting for Content Job(s) to complete", string(ApplicationVersionProcessing), cav, nil, util.DependantName, job, util.DependantKind, "Job") + util.LogInfo("Waiting for content job(s) to complete", string(Processing), cav, nil, util.DependentName, job, util.DependentKind, "Job", "version", cav.Spec.Version) return true, nil } } // All Jobs are executed - util.LogInfo("Content Job(s) Completed", string(ApplicationVersionProcessing), cav, nil) + if cav.Status.State != v1alpha1.CAPApplicationVersionStateReady { + // Only log this state if cav is not already in Ready state as the resource might be reconciled again + util.LogInfo("Content job(s) completed", string(Processing), cav, nil, "version", cav.Spec.Version) + } return false, nil } @@ -925,7 +931,7 @@ func (c *Controller) getRelevantTenantsForCAV(cav *v1alpha1.CAPApplicationVersio func (c *Controller) deleteCAPApplicationVersion(ctx context.Context, cav *v1alpha1.CAPApplicationVersion) (*ReconcileResult, error) { // Update State if it is not set yet - util.LogInfo("Deleting CAPApplicationVersion", string(ApplicationVersionDeleting), cav, nil) + util.LogInfo("Deleting application version", string(Deleting), cav, nil, "version", cav.Spec.Version) if cav.Status.State != v1alpha1.CAPApplicationVersionStateDeleting { var deleteCondition metav1.Condition if len(cav.Status.Conditions) > 0 { @@ -946,10 +952,10 @@ func (c *Controller) deleteCAPApplicationVersion(ctx context.Context, cav *v1alp // Check if tenants exists if len(tenants) > 0 { // Requeue after 10s to check if all tenants are gone - util.LogInfo("Could not delete; tenants exists in this version", string(ApplicationVersionDeleting), cav, nil) + util.LogInfo("Could not delete; tenants exists in this version", string(Deleting), cav, nil, "version", cav.Spec.Version) return NewReconcileResultWithResource(ResourceCAPApplicationVersion, cav.Name, cav.Namespace, 10*time.Second), nil } else if removeFinalizer(&cav.Finalizers, FinalizerCAPApplicationVersion) { // All tenants are gone --> remove finalizer and process deletion - util.LogInfo("Removing Finalizer; finished deleting this version", string(ApplicationVersionDeleting), cav, nil) + util.LogInfo("Removing finalizer; finished deleting this version", string(Deleting), cav, nil, "version", cav.Spec.Version) return nil, c.updateCAPApplicationVersion(ctx, cav) } diff --git a/internal/controller/reconcile-capapplicationversion_test.go b/internal/controller/reconcile-capapplicationversion_test.go index aecc1d6..fb28157 100644 --- a/internal/controller/reconcile-capapplicationversion_test.go +++ b/internal/controller/reconcile-capapplicationversion_test.go @@ -440,7 +440,7 @@ func TestCAV_DeletingWithReadyTenants(t *testing.T) { "testdata/capapplicationversion/cav-ready-deleting.yaml", }, expectedResources: "testdata/capapplicationversion/expected/cav-deleting.yaml", - expectError: false, // cav is requeued until dependants are gone + expectError: false, // cav is requeued until dependents are gone expectedRequeue: map[int][]NamespacedResourceKey{ResourceCAPApplicationVersion: {{Namespace: "default", Name: "test-cap-01-cav-v1"}}}, }, ) @@ -451,7 +451,7 @@ func TestCAV_DeletingWithUpgradingVersionTenants(t *testing.T) { context.TODO(), t, QueueItem{Key: ResourceCAPApplicationVersion, ResourceKey: NamespacedResourceKey{Namespace: "default", Name: "test-cap-01-cav-v1"}}, TestData{ - description: "capapplication deleting with valid upgrading (version dependant) tenants", + description: "capapplication deleting with valid upgrading (version dependent) tenants", initialResources: []string{ "testdata/common/capapplication.yaml", "testdata/common/credential-secrets.yaml", @@ -460,7 +460,7 @@ func TestCAV_DeletingWithUpgradingVersionTenants(t *testing.T) { "testdata/capapplicationversion/cav-ready-deleting.yaml", }, expectedResources: "testdata/capapplicationversion/expected/cav-deleting.yaml", - expectError: false, // cav is requeued until dependants are gone + expectError: false, // cav is requeued until dependents are gone expectedRequeue: map[int][]NamespacedResourceKey{ResourceCAPApplicationVersion: {{Namespace: "default", Name: "test-cap-01-cav-v1"}}}, }, ) diff --git a/internal/controller/reconcile-captenant.go b/internal/controller/reconcile-captenant.go index 5e88db3..56c49ec 100644 --- a/internal/controller/reconcile-captenant.go +++ b/internal/controller/reconcile-captenant.go @@ -77,9 +77,9 @@ const ( ) var operationTypeMsgMap = map[v1alpha1.CAPTenantOperationType]string{ - v1alpha1.CAPTenantOperationTypeProvisioning: string(TenantProvisioning), - v1alpha1.CAPTenantOperationTypeUpgrade: string(TenantUpgrading), - v1alpha1.CAPTenantOperationTypeDeprovisioning: string(TenantDeprovisioning), + v1alpha1.CAPTenantOperationTypeProvisioning: string(Provisioning), + v1alpha1.CAPTenantOperationTypeUpgrade: string(Upgrading), + v1alpha1.CAPTenantOperationTypeDeprovisioning: string(Deprovisioning), } // maps tenant operation types (and their status) to CAPTenant status changes @@ -137,13 +137,13 @@ func getTenantReconcileResultConsideringDeletion(cat *v1alpha1.CAPTenant, fallba var handleWaitingForTenantOperation = func(ctx context.Context, c *Controller, cat *v1alpha1.CAPTenant, target StateCondition, ctop *v1alpha1.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 CAPTenantOperation to complete", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + 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)) return NewReconcileResultWithResource(ResourceCAPTenant, cat.Name, cat.Namespace, 15*time.Second), 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) { - util.LogInfo("CAPTenantOperation successfully completed", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + 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) c.Event(cat, ctop, corev1.EventTypeNormal, target.conditionReason, string(target.state), message) @@ -156,7 +156,7 @@ var handleCompletedProvisioningUpgradeOperation = func(ctx context.Context, c *C // Check if all Tenant DNSEntries are Ready processing, err := c.checkTenantDNSEntries(ctx, cat) if err != nil { - util.LogError(err, "DNS Entries error", string(TenantProcessing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + util.LogError(err, "DNS entries error", string(Processing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) return nil, err } if processing { @@ -184,11 +184,11 @@ var handleFailingTenantOperation = func(ctx context.Context, c *Controller, cat related runtime.Object = nil ) if ctop == nil { - message = fmt.Sprintf("could not identify %s for tenant state %s", v1alpha1.CAPTenantOperationKind, cat.Status.State) - util.LogInfo(message, string(TenantProcessing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + message = fmt.Sprintf("Could not identify %s for tenant state %s", v1alpha1.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) - util.LogInfo("CAPTenantOperation failed", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + util.LogInfo("Tenant operation failed", operationTypeMsgMap[ctop.Spec.Operation], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) related = ctop } @@ -204,7 +204,7 @@ var removeTenantFinalizers = func(ctx context.Context, c *Controller, cat *v1alp // remove known finalizer if removeFinalizer(&cat.Finalizers, FinalizerCAPTenant) { - util.LogInfo("Removing Finalizer; finished deleting this tenant", string(TenantDeleting), cat, nil) + util.LogInfo("Removing finalizer; finished deleting this tenant", string(Deleting), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) return c.updateCAPTenant(ctx, cat, false) } return nil, nil @@ -233,7 +233,7 @@ func (c *Controller) reconcileCAPTenant(ctx context.Context, item QueueItem, att // Skip processing until the right version is set on the CAPTenant (via CAPApplication) // This indirectly ensures that we do not create duplicate tenant operations for consumer tenant provisioning scenarios! if cat.Spec.Version == "" { - util.LogInfo("Tenant without version detected, skip processing until version is set", string(TenantProcessing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + util.LogInfo("Tenant without version detected, skip processing until version is set", string(Processing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) return requeue, nil } @@ -253,7 +253,7 @@ func (c *Controller) reconcileCAPTenant(ctx context.Context, item QueueItem, att if cat.DeletionTimestamp == nil && cat.Status.CurrentCAPApplicationVersionInstance != "" { requeue, err = c.reconcileTenantNetworking(ctx, cat, cat.Status.CurrentCAPApplicationVersionInstance, nil) if requeue == nil && err == nil { - util.LogInfo("Tenant processing completed", string(TenantProcessing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + util.LogInfo("Tenant processing completed", string(Ready), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) } } @@ -317,7 +317,7 @@ func (c *Controller) handleTenantOperationsForCAPTenant(ctx context.Context, cat // [1] wait for active operations to complete if len(ops.active) > 0 { if len(ops.active) > 1 { - util.LogInfo("identified multiple active CAPTenantOperations", string(TenantProcessing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + util.LogInfo("Identified multiple active tenant operations", string(Processing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) } ctop := findLatestCreatedTenantOperation(ops.active, CAPTenantOperationTypeSelectorAll) targetInfo := TenantOperationStatusMap[ctop.Spec.Operation].processing @@ -439,7 +439,7 @@ func (c *Controller) createCAPTenantOperation(ctx context.Context, cat *v1alpha1 }, } addCAPTenantOperationLabels(ctop, cat) // NOTE: this is very important to do here as subsequent reconciliation of tenant will be inconsistent otherwise - util.LogInfo("Creating CAPTenantOperations", operationTypeMsgMap[opType], cat, ctop, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + 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{}) } @@ -556,12 +556,12 @@ func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context. if err != nil { return nil, err } - util.LogInfo("identified CAPApplicationVersion", operationTypeMsgMap[opType], cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) + 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) if cat.Status.CurrentCAPApplicationVersionInstance == "" { err := fmt.Errorf("cannot identify %s for %s %s.%s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name) - util.LogError(err, "cannot identify CAPApplicationVersion", string(TenantDeprovisioning), cat, nil, "tenantId", cat.Spec.TenantId) + util.LogError(err, "Cannot identify applicaion 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{}) diff --git a/internal/controller/reconcile-captenantoperation.go b/internal/controller/reconcile-captenantoperation.go index d26d238..50393c6 100644 --- a/internal/controller/reconcile-captenantoperation.go +++ b/internal/controller/reconcile-captenantoperation.go @@ -195,7 +195,7 @@ func (c *Controller) updateCAPTenantOperation(ctx context.Context, ctop *v1alpha func (c *Controller) handleCAPTenantOperationDeletion(ctx context.Context, ctop *v1alpha1.CAPTenantOperation) (*ReconcileResult, error) { // remove finalizer if removeFinalizer(&ctop.Finalizers, FinalizerCAPTenantOperation) { - util.LogInfo("Removing Finalizer; finished deleting this tenant operation", string(TenantOperationDeleting), ctop, nil) + util.LogInfo("Removing finalizer; finished deleting this tenant operation", string(Deleting), ctop, nil, "tenantId", ctop.Spec.TenantId, "version", ctop.Labels[LabelCAVVersion]) return c.updateCAPTenantOperation(ctx, ctop, false) } return nil, nil @@ -294,13 +294,13 @@ func (c *Controller) setCAPTenantOperationStatusFromJob(ctop *v1alpha1.CAPTenant processStepCompletion := func() { status.conditionReason = CAPTenantOperationConditionReasonStepCompleted - util.LogInfo("Tenant Operation "+status.conditionMessage, string(TenantOperationProcessing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, LabelBTPApplicationIdentifierHash, job.Labels[LabelBTPApplicationIdentifierHash]) + 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.conditionStatus = metav1.ConditionTrue ctop.SetStatusCurrentStep(nil, nil) - util.LogInfo("Completed Tenant Operation(s) successfully", string(TenantOperationReady), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, LabelBTPApplicationIdentifierHash, job.Labels[LabelBTPApplicationIdentifierHash]) + 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.conditionStatus = metav1.ConditionFalse @@ -434,12 +434,12 @@ func (c *Controller) initiateJobForCAPTenantOperationStep(ctx context.Context, c job, err = c.createCustomTenantOperationJob(ctx, ctop, workload, params) } if err != nil { - util.LogError(err, "Failed to create job for tenant operation", string(TenantOperationProcessing), ctop, nil, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, LabelBTPApplicationIdentifierHash, job.Labels[LabelBTPApplicationIdentifierHash]) + util.LogError(err, "Failed to create job for tenant operation", string(Processing), ctop, nil, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, "version", ctop.Labels[LabelCAVVersion]) return } msg := fmt.Sprintf("step %v/%v : job %s.%s created", *ctop.Status.CurrentStep, len(ctop.Spec.Steps), job.Namespace, job.Name) - util.LogInfo(msg+" successfully", string(TenantOperationProcessing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, LabelBTPApplicationIdentifierHash, job.Labels[LabelBTPApplicationIdentifierHash]) + 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.SetStatusCurrentStep(ctop.Status.CurrentStep, &job.Name) c.Event(ctop, job, corev1.EventTypeNormal, CAPTenantOperationConditionReasonStepInitiated, EventActionCreateJob, msg) @@ -512,7 +512,7 @@ func (c *Controller) createTenantOperationJob(ctx context.Context, ctop *v1alpha }, } - util.LogInfo("Creating job for tenant operation", string(TenantOperationProcessing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, LabelBTPApplicationIdentifierHash, job.Labels[LabelBTPApplicationIdentifierHash]) + util.LogInfo("Creating tenant operation job", string(Processing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, "version", ctop.Labels[LabelCAVVersion]) return c.kubeClient.BatchV1().Jobs(ctop.Namespace).Create(ctx, job, metav1.CreateOptions{}) } @@ -662,7 +662,7 @@ func (c *Controller) createCustomTenantOperationJob(ctx context.Context, ctop *v }, } - util.LogInfo("Creating job for custom tenant operation", string(TenantOperationProcessing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, LabelBTPApplicationIdentifierHash, job.Labels[LabelBTPApplicationIdentifierHash]) + util.LogInfo("Creating custom tenant operation job", string(Processing), ctop, job, "tenantId", ctop.Spec.TenantId, "operation", ctop.Spec.Operation, "version", ctop.Labels[LabelCAVVersion]) return c.kubeClient.BatchV1().Jobs(ctop.Namespace).Create(ctx, job, metav1.CreateOptions{}) } @@ -690,11 +690,20 @@ func addCAPTenantOperationLabels(ctop *v1alpha1.CAPTenantOperation, cat *v1alpha updated = true } + // Check and add missing labels + if _, ok := ctop.Labels[LabelBTPApplicationIdentifierHash]; !ok { + // Add missing BTPApplicationIdentifierHash label + ctop.Labels[LabelBTPApplicationIdentifierHash] = cat.Labels[LabelBTPApplicationIdentifierHash] + updated = true + } if _, ok := ctop.Labels[LabelTenantOperationType]; !ok { + // Add missing Tenant operation type label ctop.Labels[LabelTenantOperationType] = string(ctop.Spec.Operation) - if ctop.Spec.Operation == v1alpha1.CAPTenantOperationTypeUpgrade { - ctop.Labels[LabelCAVVersion] = cat.Spec.Version - } + updated = true + } + if _, ok := ctop.Labels[LabelCAVVersion]; !ok { + // Also update version label + ctop.Labels[LabelCAVVersion] = cat.Spec.Version updated = true } return updated diff --git a/internal/controller/reconcile-domains.go b/internal/controller/reconcile-domains.go index 0c79c08..2683c4a 100644 --- a/internal/controller/reconcile-domains.go +++ b/internal/controller/reconcile-domains.go @@ -52,7 +52,7 @@ const ( func (c *Controller) handleDomains(ctx context.Context, ca *v1alpha1.CAPApplication) (*ReconcileResult, error) { domains, err := json.Marshal(ca.Spec.Domains) if err != nil { - util.LogError(err, "error occurred while encoding domains to json", string(ApplicationProcessing), ca, nil) + util.LogError(err, "Error occurred while encoding domains to json", string(Processing), ca, nil) return nil, fmt.Errorf("error occurred while encoding domains to json: %w", err) } domainsHash := sha256Sum(string(domains)) @@ -111,7 +111,7 @@ func (c *Controller) handlePrimaryDomainGateway(ctx context.Context, ca *v1alpha // create gateway if errors.IsNotFound(err) { - util.LogInfo("Creating Gateway for primary domain", string(ApplicationProcessing), ca, nil, "gatewayName", gwName) + util.LogInfo("Creating gateway for primary domain", string(Processing), ca, nil, "gatewayName", gwName) _, err = c.istioClient.NetworkingV1beta1().Gateways(namespace).Create( ctx, &istionwv1beta1.Gateway{ ObjectMeta: metav1.ObjectMeta{ @@ -137,7 +137,7 @@ func (c *Controller) handlePrimaryDomainGateway(ctx context.Context, ca *v1alpha updateResourceAnnotation(&gw.ObjectMeta, hash) // Trigger the actual update on the resource - util.LogInfo("Updating Gateway for primary domain", string(ApplicationProcessing), ca, gw) + util.LogInfo("Updating gateway for primary domain", string(Processing), ca, gw) _, err = c.istioClient.NetworkingV1beta1().Gateways(namespace).Update(ctx, gw, metav1.UpdateOptions{}) } @@ -159,7 +159,7 @@ func (c *Controller) handlePrimaryDomainCertificate(ctx context.Context, ca *v1a gardenerCertSpec := getGardenerCertificateSpec(commonName, secretName) if errors.IsNotFound(err) { // create certificate - util.LogInfo("Creating gardener certificates for primary domain", string(ApplicationProcessing), ca, nil, "certificateName", certName) + util.LogInfo("Creating gardener certificates for primary domain", string(Processing), ca, nil, "certificateName", certName) _, err = c.gardenerCertificateClient.CertV1alpha1().Certificates(istioNamespace).Create( ctx, &certv1alpha1.Certificate{ ObjectMeta: metav1.ObjectMeta{ @@ -186,7 +186,7 @@ func (c *Controller) handlePrimaryDomainCertificate(ctx context.Context, ca *v1a updateResourceAnnotation(&gardenerCert.ObjectMeta, hash) // Trigger the actual update on the resource - util.LogInfo("Updating gardener certificates for primary domain", string(ApplicationProcessing), ca, gardenerCert) + util.LogInfo("Updating gardener certificates for primary domain", string(Processing), ca, gardenerCert) _, err = c.gardenerCertificateClient.CertV1alpha1().Certificates(istioNamespace).Update(ctx, gardenerCert, metav1.UpdateOptions{}) } @@ -197,7 +197,7 @@ func (c *Controller) handlePrimaryDomainCertificate(ctx context.Context, ca *v1a if errors.IsNotFound(err) { // create certificate - util.LogInfo("Creating certManager certificates for primary domain", string(ApplicationProcessing), ca, nil, "certificateName", certName) + util.LogInfo("Creating cert-manager certificates for primary domain", string(Processing), ca, nil, "certificateName", certName) _, err = c.certManagerCertificateClient.CertmanagerV1().Certificates(istioNamespace).Create( ctx, &certManagerv1.Certificate{ ObjectMeta: metav1.ObjectMeta{ @@ -224,7 +224,7 @@ func (c *Controller) handlePrimaryDomainCertificate(ctx context.Context, ca *v1a updateResourceAnnotation(&certManagerCert.ObjectMeta, hash) // Trigger the actual update on the resource - util.LogInfo("Updating certManager certificates for primary domain", string(ApplicationProcessing), ca, certManagerCert) + util.LogInfo("Updating cert-manager certificates for primary domain", string(Processing), ca, certManagerCert) _, err = c.certManagerCertificateClient.CertmanagerV1().Certificates(istioNamespace).Update(ctx, certManagerCert, metav1.UpdateOptions{}) } } @@ -250,7 +250,7 @@ func (c *Controller) handlePrimaryDomainDNSEntry(ctx context.Context, ca *v1alph if errors.IsNotFound(err) { // create DNSEntry - util.LogInfo("Creating DNSEntry for primary domain", string(ApplicationProcessing), ca, nil, "dnsEntryName", dnsEntryName) + util.LogInfo("Creating dns entry for primary domain", string(Processing), ca, nil, "dnsEntryName", dnsEntryName) _, err = c.gardenerDNSClient.DnsV1alpha1().DNSEntries(namespace).Create( ctx, &dnsv1alpha1.DNSEntry{ ObjectMeta: metav1.ObjectMeta{ @@ -277,7 +277,7 @@ func (c *Controller) handlePrimaryDomainDNSEntry(ctx context.Context, ca *v1alph updateResourceAnnotation(&dnsEntry.ObjectMeta, hash) // Trigger the actual update on the resource - util.LogInfo("Updating DNSEntry for primary domain", string(ApplicationProcessing), ca, dnsEntry) + util.LogInfo("Updating dns entry for primary domain", string(Processing), ca, dnsEntry) _, err = c.gardenerDNSClient.DnsV1alpha1().DNSEntries(namespace).Update(ctx, dnsEntry, metav1.UpdateOptions{}) } return err @@ -302,14 +302,14 @@ func (c *Controller) checkPrimaryDomainResources(ctx context.Context, ca *v1alph var istioIngressGatewayInfo *ingressGatewayInfo istioIngressGatewayInfo, err = c.getIngressGatewayInfo(ctx, ca) if err != nil { - util.LogError(err, "", string(ApplicationProcessing), ca, nil) + util.LogError(err, "", string(Processing), ca, nil) return false, err } certName := getResourceName(ca.Spec.BTPAppName, CertificateSuffix) // check for certificate status if processing, err := c.checkCertificateStatus(ctx, ca, istioIngressGatewayInfo.Namespace, certName); err != nil || processing { - util.LogError(err, "", string(ApplicationProcessing), ca, nil, "certificateName", certName) + util.LogError(err, "", string(Processing), ca, nil, "certificateName", certName) return processing, err } @@ -324,10 +324,10 @@ func (c *Controller) checkPrimaryDomainResources(ctx context.Context, ca *v1alph // check for ready state if dnsEntry.Status.State == dnsv1alpha1.STATE_ERROR { err := fmt.Errorf(formatResourceStateErr, dnsv1alpha1.DNSEntryKind, dnsv1alpha1.STATE_ERROR, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name, *dnsEntry.Status.Message) - util.LogError(err, "", string(ApplicationProcessing), ca, dnsEntry) + util.LogError(err, "", string(Processing), ca, dnsEntry) return false, err } else if dnsEntry.Status.State != dnsv1alpha1.STATE_READY { - util.LogInfo("DNSEntry resource not ready for primary domain", string(ApplicationProcessing), ca, dnsEntry) + util.LogInfo("DNS entry resource not ready for primary domain", string(Processing), ca, dnsEntry) ca.SetStatusWithReadyCondition(v1alpha1.CAPApplicationStateProcessing, metav1.ConditionFalse, "DomainResourcesProcessing", "") return true, nil } @@ -408,7 +408,7 @@ func (c *Controller) checkCertificateStatus(ctx context.Context, ca *v1alpha1.CA if certificate.Status.State == certv1alpha1.StateError { return false, fmt.Errorf(formatResourceStateErr, certv1alpha1.CertificateKind, certv1alpha1.StateError, v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name, *certificate.Status.Message) } else if certificate.Status.State != certv1alpha1.StateReady { - util.LogInfo("gardener certificate resource not ready for primary domain", string(ApplicationProcessing), ca, certificate) + util.LogInfo("Gardener certificate resource not ready for primary domain", string(Processing), ca, certificate) return true, nil } case certManagerCertManagerIO: @@ -422,7 +422,7 @@ func (c *Controller) checkCertificateStatus(ctx context.Context, ca *v1alpha1.CA readyCond := getCertManagerReadyCondition(certificate) // check for ready state if readyCond == nil || readyCond.Status == certManagermetav1.ConditionUnknown { - util.LogInfo("certManager certificate resource not ready for primary domain", string(ApplicationProcessing), ca, certificate) + util.LogInfo("cert-manager certificate resource not ready for primary domain", string(Processing), ca, certificate) return true, nil } else if readyCond.Status == certManagermetav1.ConditionFalse { return false, fmt.Errorf(formatResourceStateErr, certManagerv1.CertificateKind, "not ready", v1alpha1.CAPApplicationKind, ca.Namespace, ca.Name, readyCond.Message) @@ -539,7 +539,7 @@ func (c *Controller) reconcileTenantDNSEntries(ctx context.Context, cat *v1alpha // Create DNS Entries for index, domain := range ca.Spec.Domains.Secondary { dnsEntryName := cat.Name + strconv.Itoa(index) - util.LogInfo("Creating DNSEntry for secondary domain", string(TenantProcessing), cat, nil, "dnsEntryName", dnsEntryName) + util.LogInfo("Creating dns entry for secondary domain", string(Processing), cat, nil, "dnsEntryName", dnsEntryName, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) _, err = c.gardenerDNSClient.DnsV1alpha1().DNSEntries(ca.Namespace).Create( ctx, &dnsv1alpha1.DNSEntry{ ObjectMeta: metav1.ObjectMeta{ @@ -588,7 +588,7 @@ func (c *Controller) checkTenantDNSEntries(ctx context.Context, cat *v1alpha1.CA if dnsEntry.Status.State == dnsv1alpha1.STATE_ERROR { return false, fmt.Errorf(formatResourceStateErr, dnsv1alpha1.DNSEntryKind, dnsv1alpha1.STATE_ERROR, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name, *dnsEntry.Status.Message) } else if dnsEntry.Status.State != dnsv1alpha1.STATE_READY { - util.LogInfo("DNSEntry resource not ready", string(TenantProcessing), cat, dnsEntry) + util.LogInfo("DNS entry resource not ready", string(Processing), cat, dnsEntry, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) return true, nil } } @@ -619,13 +619,13 @@ func (c *Controller) reconcileTenantNetworking(ctx context.Context, cat *v1alpha }() if drModified, err = c.reconcileTenantDestinationRule(ctx, cat, cavName, ca); err != nil { - util.LogError(err, "DestinationRule reconcilation failed", string(TenantProcessing), cat, nil) + util.LogError(err, "Destination rule reconcilation failed", string(Processing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) reason = CAPTenantEventDestinationRuleModificationFailed return } if vsModified, err = c.reconcileTenantVirtualService(ctx, cat, cavName, ca); err != nil { - util.LogError(err, "VirtualService reconcilation failed", string(TenantProcessing), cat, nil) + util.LogError(err, "Virtual service reconcilation failed", string(Processing), cat, nil, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) reason = CAPTenantEventVirtualServiceModificationFailed return } @@ -665,15 +665,15 @@ func (c *Controller) reconcileTenantDestinationRule(ctx context.Context, cat *v1 } if update, err = c.getUpdatedTenantDestinationRuleObject(ctx, cat, dr, cavName); err != nil { - util.LogError(err, "", string(TenantProcessing), cat, dr) + util.LogError(err, "", string(Processing), cat, dr, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) return } if create { - util.LogInfo("Creating DestinationRule", string(TenantProcessing), cat, dr) + util.LogInfo("Creating destination rule", string(Processing), cat, dr, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) _, err = c.istioClient.NetworkingV1beta1().DestinationRules(cat.Namespace).Create(ctx, dr, metav1.CreateOptions{}) } else if update { - util.LogInfo("Updating DestinationRule", string(TenantProcessing), cat, dr) + util.LogInfo("Updating destination rule", string(Processing), cat, dr, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) _, err = c.istioClient.NetworkingV1beta1().DestinationRules(cat.Namespace).Update(ctx, dr, metav1.UpdateOptions{}) } @@ -748,15 +748,15 @@ func (c *Controller) reconcileTenantVirtualService(ctx context.Context, cat *v1a } if update, err = c.getUpdatedTenantVirtualServiceObject(ctx, cat, vs, cavName, ca); err != nil { - util.LogError(err, "", string(TenantProcessing), cat, nil) + util.LogError(err, "", string(Processing), cat, nil, "tenantId", cat.Spec.TenantId) return } if create { - util.LogInfo("Creating VirtualService", string(TenantProcessing), cat, vs) + util.LogInfo("Creating virtual service", string(Processing), cat, vs, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) _, err = c.istioClient.NetworkingV1beta1().VirtualServices(cat.Namespace).Create(ctx, vs, metav1.CreateOptions{}) } else if update { - util.LogInfo("Updating VirtualService", string(TenantProcessing), cat, vs) + util.LogInfo("Updating virtual service", string(Processing), cat, vs, "tenantId", cat.Spec.TenantId, "version", cat.Spec.Version) _, err = c.istioClient.NetworkingV1beta1().VirtualServices(cat.Namespace).Update(ctx, vs, metav1.UpdateOptions{}) } diff --git a/internal/controller/reconcile.go b/internal/controller/reconcile.go index fae1b94..2aa9479 100644 --- a/internal/controller/reconcile.go +++ b/internal/controller/reconcile.go @@ -136,19 +136,12 @@ type RouterDestination struct { type Steps string const ( - ApplicationProcessing Steps = "Application Processing" - ApplicationDeleting Steps = "Application Deleting" - ApplicationVersionProcessing Steps = "ApplicationVersion Processing" - ApplicationVersionDeleting Steps = "ApplicationVersion Deleting" - ApplicationVersionReady Steps = "ApplicationVersion Ready" - TenantProcessing Steps = "Tenant Processing" - TenantProvisioning Steps = "Tenant Provisioning" - TenantDeprovisioning Steps = "Tenant Deprovisioning" - TenantDeleting Steps = "Tenant Deleting" - TenantUpgrading Steps = "Tenant Upgrading" - TenantOperationProcessing Steps = "TenantOperation Processing" - TenantOperationDeleting Steps = "TenantOperation Deleting" - TenantOperationReady Steps = "TenantOperation Ready" + Processing Steps = "Processing" + Provisioning Steps = "Provisioning" + Upgrading Steps = "Upgrading" + Deprovisioning Steps = "Deprovisioning" + Deleting Steps = "Deleting" + Ready Steps = "Ready" ) func (c *Controller) Event(main runtime.Object, related runtime.Object, eventType, reason, action, message string) { diff --git a/internal/controller/testdata/captenant/cat-03.expected.yaml b/internal/controller/testdata/captenant/cat-03.expected.yaml index 459db89..71e2681 100644 --- a/internal/controller/testdata/captenant/cat-03.expected.yaml +++ b/internal/controller/testdata/captenant/cat-03.expected.yaml @@ -48,6 +48,8 @@ metadata: annotations: sme.sap.com/owner-identifier: default.test-cap-01-consumer labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: 5.6.7 sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: a9df2080f99fd77b1b2c7e4cee1e1bff69498511 sme.sap.com/tenant-operation-type: provisioning diff --git a/internal/controller/testdata/captenant/cat-07.expected.yaml b/internal/controller/testdata/captenant/cat-07.expected.yaml index cd16b27..f66dc64 100644 --- a/internal/controller/testdata/captenant/cat-07.expected.yaml +++ b/internal/controller/testdata/captenant/cat-07.expected.yaml @@ -47,6 +47,7 @@ metadata: annotations: sme.sap.com/owner-identifier: default.test-cap-01-provider labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec sme.sap.com/tenant-operation-type: upgrade diff --git a/internal/controller/testdata/captenant/cat-09.expected.yaml b/internal/controller/testdata/captenant/cat-09.expected.yaml index a2a3d0c..efe30f3 100644 --- a/internal/controller/testdata/captenant/cat-09.expected.yaml +++ b/internal/controller/testdata/captenant/cat-09.expected.yaml @@ -48,6 +48,8 @@ metadata: annotations: sme.sap.com/owner-identifier: default.test-cap-01-provider labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: 5.6.7 sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec sme.sap.com/tenant-operation-type: deprovisioning diff --git a/internal/controller/testdata/captenant/cat-24.expected.yaml b/internal/controller/testdata/captenant/cat-24.expected.yaml index 0d2e497..93b335a 100644 --- a/internal/controller/testdata/captenant/cat-24.expected.yaml +++ b/internal/controller/testdata/captenant/cat-24.expected.yaml @@ -50,6 +50,7 @@ metadata: annotations: sme.sap.com/owner-identifier: default.test-cap-01-provider labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/owner-generation: "3" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec sme.sap.com/tenant-operation-type: upgrade diff --git a/internal/controller/testdata/captenant/cat-25.expected.yaml b/internal/controller/testdata/captenant/cat-25.expected.yaml index fc05413..98a9a85 100644 --- a/internal/controller/testdata/captenant/cat-25.expected.yaml +++ b/internal/controller/testdata/captenant/cat-25.expected.yaml @@ -50,6 +50,7 @@ metadata: annotations: sme.sap.com/owner-identifier: "default.test-cap-01-provider" labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/owner-generation: "2" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec sme.sap.com/tenant-operation-type: upgrade diff --git a/internal/controller/testdata/captenant/cat-27.expected.yaml b/internal/controller/testdata/captenant/cat-27.expected.yaml index 9d9acc4..25a72fd 100644 --- a/internal/controller/testdata/captenant/cat-27.expected.yaml +++ b/internal/controller/testdata/captenant/cat-27.expected.yaml @@ -47,6 +47,7 @@ metadata: annotations: sme.sap.com/owner-identifier: default.test-cap-01-provider labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec sme.sap.com/tenant-operation-type: upgrade diff --git a/internal/controller/testdata/captenant/cat-28.expected.yaml b/internal/controller/testdata/captenant/cat-28.expected.yaml index 2709cf5..c208a59 100644 --- a/internal/controller/testdata/captenant/cat-28.expected.yaml +++ b/internal/controller/testdata/captenant/cat-28.expected.yaml @@ -48,6 +48,8 @@ metadata: annotations: sme.sap.com/owner-identifier: default.test-cap-01-consumer labels: + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: 8.9.10 sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: a9df2080f99fd77b1b2c7e4cee1e1bff69498511 sme.sap.com/tenant-operation-type: provisioning diff --git a/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml index b08172d..ba1f4ee 100644 --- a/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-01.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml index ed00424..2930d9e 100644 --- a/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-02.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml index beae87e..fbb40b1 100644 --- a/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-02.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml index 8a95587..a4ab280 100644 --- a/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-03.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml index 87a5507..bba0880 100644 --- a/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-03.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml index 60c96d1..3d964fa 100644 --- a/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-04.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-04.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml index 0934e02..807c631 100644 --- a/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-05.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-06.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-06.expected.yaml index aaa016b..68e24b6 100644 --- a/internal/controller/testdata/captenantoperation/ctop-06.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-06.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml index 521e8f1..1264992 100644 --- a/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-06.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml index ecf49d7..cfcbb99 100644 --- a/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-07.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml index d95fb1e..ce7a09b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-07.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml index 8f7bfad..8fc9bac 100644 --- a/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-08.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml index d7cac20..36dc1e6 100644 --- a/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-08.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml index 2bf743c..aa54ccb 100644 --- a/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-09.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml index 7f28d6c..8d50270 100644 --- a/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-09.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml index 90eafdc..99f2370 100644 --- a/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-10.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml index 1092b5e..538d9a5 100644 --- a/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-10.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml index f3b29d2..86021d1 100644 --- a/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-11.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml index f55f9f2..a57db94 100644 --- a/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-11.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml index 716fa42..c683c5c 100644 --- a/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-12.expected.yaml @@ -13,6 +13,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml index a5e9d30..733f276 100644 --- a/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-12.initial.yaml @@ -13,6 +13,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml index f9e16e8..791fd8b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-13.expected.yaml @@ -13,6 +13,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml index 35a32a3..4ae61b1 100644 --- a/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-13.initial.yaml @@ -13,6 +13,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml index 2a1d054..f5ff84d 100644 --- a/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-14.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml index cf71c1a..0323b96 100644 --- a/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-14.initial.yaml @@ -13,6 +13,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml index fe23d96..13cfbc8 100644 --- a/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-16.expected.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml index afb672c..c7638cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-16.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml index 8a5fe00..89f9677 100644 --- a/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-17.expected.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml index f64b4d4..13ada67 100644 --- a/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-17.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml index b30d11c..59ce1cb 100644 --- a/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-18.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-18.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml index 0253daa..5413905 100644 --- a/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-19.expected.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml index afb672c..c7638cf 100644 --- a/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-19.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: deprovisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml index 3d21519..c2d64a6 100644 --- a/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-20.expected.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml index 5b23137..e9eade8 100644 --- a/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-20.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml index 4b5e003..f3e87ae 100644 --- a/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-21.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-21.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml index ecc4238..b5992b9 100644 --- a/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-22.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-22.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml index b7fd73f..415feae 100644 --- a/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-23.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml index d95fb1e..ce7a09b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-23.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml index fe8799f..90b5b19 100644 --- a/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-24.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-24.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml index 0d3078b..bd77f91 100644 --- a/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-25.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml index d95fb1e..ce7a09b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-25.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml index 5c96716..5fed173 100644 --- a/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-26.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml index 159fd11..21b2be5 100644 --- a/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-26.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml index 3a7fdb5..cdde5ef 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init-custom.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml index d95fb1e..ce7a09b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init-custom.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml index ad76f6a..59ea1c3 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-init.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml index 2ebdb69..01f9879 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml index d95fb1e..ce7a09b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling-custom.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml index f7c8cee..aee4ede 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-scheduling.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml index 2a2cb52..c010bdb 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol-custom.expected.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: 8.9.10 ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml index d95fb1e..ce7a09b 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol-custom.initial.yaml @@ -12,6 +12,7 @@ metadata: sme.sap.com/tenant-operation-type: upgrade sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 sme.sap.com/cav-version: "8.9.10" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 diff --git a/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml b/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml index be4665b..8d94ffa 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol.expected.yaml @@ -13,6 +13,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml b/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml index 8086d46..3c5eb35 100644 --- a/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml +++ b/internal/controller/testdata/captenantoperation/ctop-vol.initial.yaml @@ -12,6 +12,8 @@ metadata: sme.sap.com/tenant-operation-type: provisioning sme.sap.com/owner-generation: "0" sme.sap.com/owner-identifier-hash: db1f1fd7eaeb0e6407c741b7e4b2540044bcc4ec + sme.sap.com/btp-app-identifier-hash: f20cc8aeb2003b3abc33f749a16bd53544b6bab2 + sme.sap.com/cav-version: "5.6.7" ownerReferences: - apiVersion: sme.sap.com/v1alpha1 blockOwnerDeletion: true diff --git a/internal/util/log.go b/internal/util/log.go index 466c2de..451b421 100644 --- a/internal/util/log.go +++ b/internal/util/log.go @@ -16,8 +16,8 @@ const ( Name = "name" Namespace = "namespace" Kind = "kind" - DependantName = "dependantName" - DependantKind = "dependantKind" + DependentName = "dependentName" + DependentKind = "dependentKind" ) const LabelBTPApplicationIdentifierHash = "sme.sap.com/btp-app-identifier-hash" @@ -57,8 +57,8 @@ func extractEntityMeta(entity interface{}, isRoot bool, skipLabel bool) map[stri } } else { args = map[string]string{ - DependantName: objectMeta.GetName(), - DependantKind: kind, + DependentName: objectMeta.GetName(), + DependentKind: kind, } }