From 5782ed95815f939a8758fb7435a30742629dc2c9 Mon Sep 17 00:00:00 2001 From: Pavan <25031267+Pavan-SAP@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:10:30 +0200 Subject: [PATCH] [Misc] Quality: minor issues addressed misc Q fixes. --- cmd/server/internal/handler.go | 2 +- internal/controller/reconcile-captenant.go | 2 +- pkg/apis/sme.sap.com/v1alpha1/types.go | 12 ++++++------ .../sme.sap.com/v1alpha1/capapplicationspec.go | 2 +- .../sme.sap.com/v1alpha1/dnstemplate.go | 2 +- .../sme.sap.com/v1alpha1/jobdetails.go | 2 +- .../sme.sap.com/v1alpha1/metricrule.go | 4 ++-- website/includes/api-reference.html | 14 +++++++------- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/cmd/server/internal/handler.go b/cmd/server/internal/handler.go index af361760..8c018af6 100644 --- a/cmd/server/internal/handler.go +++ b/cmd/server/internal/handler.go @@ -510,7 +510,6 @@ func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result { } func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDetails, ca *v1alpha1.CAPApplication, subscription subscriptionType, step string) (saasData *util.SaasRegistryCredentials, smsData *util.SmsCredentials, err error) { - uaaData := &util.XSUAACredentials{} switch subscription { case SMS: // fetch SMS information @@ -523,6 +522,7 @@ func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDet err = s.checkCertIssuerAndSubject(headerDetails.xForwardedClientCert, smsData, step) default: + uaaData := &util.XSUAACredentials{} // fetch SaaS Registry and XSUAA information saasData, uaaData = s.getServiceDetails(ca, step) if saasData == nil || uaaData == nil { diff --git a/internal/controller/reconcile-captenant.go b/internal/controller/reconcile-captenant.go index cf5371c6..be677df8 100644 --- a/internal/controller/reconcile-captenant.go +++ b/internal/controller/reconcile-captenant.go @@ -580,7 +580,7 @@ func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context. 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 applicaion version", string(Deprovisioning), cat, nil, "tenantId", cat.Spec.TenantId) + util.LogError(err, "Cannot identify application version", string(Deprovisioning), cat, nil, "tenantId", cat.Spec.TenantId) return nil, err } cav, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions(cat.Namespace).Get(ctx, cat.Status.CurrentCAPApplicationVersionInstance, metav1.GetOptions{}) diff --git a/pkg/apis/sme.sap.com/v1alpha1/types.go b/pkg/apis/sme.sap.com/v1alpha1/types.go index 0e174bcc..2f0998e2 100644 --- a/pkg/apis/sme.sap.com/v1alpha1/types.go +++ b/pkg/apis/sme.sap.com/v1alpha1/types.go @@ -24,7 +24,7 @@ const ( CAPTenantOperationKind = "CAPTenantOperation" CAPTenantOperationResource = "captenantoperations" CAPTenantOutputKind = "CAPTenantOutput" - CAPTenantOutputResource = "captenantouputs" + CAPTenantOutputResource = "captenantoutputs" DomainKind = "Domain" DomainResource = "domains" ClusterDomainKind = "ClusterDomain" @@ -92,7 +92,7 @@ type CAPApplicationSpec struct { DomainRefs []DomainRef `json:"domainRefs,omitempty"` // [DEPRECATED] Domains used by the application // Will be removed in future versions Domains ApplicationDomains `json:"domains,omitempty"` - // SAP BTP Global Account Identifier where services are entitles for the current application + // SAP BTP Global Account Identifier where services are entitled for the current application // Will soon be deprecated, use ProviderSubaccountId instead GlobalAccountId string `json:"globalAccountId"` // The subaccount ID in which the application is provided (will soon replace GlobalAccountId) @@ -393,11 +393,11 @@ type DeletionRules struct { // // Rule evaluation for Gauge type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as an average over the specified period. // A sum of the calculated average from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -// Evaluation: `sum(avg_over_time({job=}[])) <= ` +// Evaluation: `sum(avg_over_time({job=}[])) <= ` // // Rule evaluation for Counter type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as rate of increase over the specified period. // The sum of the calculated rates from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -// Evaluation: `sum(rate({job=}[])) <= ` +// Evaluation: `sum(rate({job=}[])) <= ` type MetricRule struct { // Prometheus metric. For example `http_request_count` Name string `json:"name"` @@ -450,7 +450,7 @@ type JobDetails struct { BackoffLimit *int32 `json:"backoffLimit,omitempty"` // Specifies the time after which the job may be cleaned up. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` - // Specifies the duration in sections for which the job may be continuously active. + // Specifies the duration in seconds for which the job may be continuously active. ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` } @@ -798,7 +798,7 @@ type DomainSpec struct { type DNSTemplate struct { // Domain name for which a DNS record will be created Name string `json:"name"` - // Target of the DNS reord + // Target of the DNS record Target string `json:"target"` } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go index 1c5e22fb..b6426679 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go @@ -16,7 +16,7 @@ type CAPApplicationSpecApplyConfiguration struct { DomainRefs []DomainRefApplyConfiguration `json:"domainRefs,omitempty"` // [DEPRECATED] Domains used by the application // Will be removed in future versions Domains *ApplicationDomainsApplyConfiguration `json:"domains,omitempty"` - // SAP BTP Global Account Identifier where services are entitles for the current application + // SAP BTP Global Account Identifier where services are entitled for the current application // Will soon be deprecated, use ProviderSubaccountId instead GlobalAccountId *string `json:"globalAccountId,omitempty"` // The subaccount ID in which the application is provided (will soon replace GlobalAccountId) diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go index 758d8c99..8e283f9f 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go @@ -14,7 +14,7 @@ package v1alpha1 type DNSTemplateApplyConfiguration struct { // Domain name for which a DNS record will be created Name *string `json:"name,omitempty"` - // Target of the DNS reord + // Target of the DNS record Target *string `json:"target,omitempty"` } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go index cbc3d9e2..30f5913a 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go @@ -24,7 +24,7 @@ type JobDetailsApplyConfiguration struct { BackoffLimit *int32 `json:"backoffLimit,omitempty"` // Specifies the time after which the job may be cleaned up. TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"` - // Specifies the duration in sections for which the job may be continuously active. + // Specifies the duration in seconds for which the job may be continuously active. ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` } diff --git a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go index 8bb5b1e9..a64915ad 100644 --- a/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go +++ b/pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go @@ -18,11 +18,11 @@ import ( // // Rule evaluation for Gauge type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as an average over the specified period. // A sum of the calculated average from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -// Evaluation: `sum(avg_over_time({job=}[])) <= ` +// Evaluation: `sum(avg_over_time({job=}[])) <= ` // // Rule evaluation for Counter type metric: The time series data of the metric (restricted to the current workload by setting `job` label as workload service name) is calculated as rate of increase over the specified period. // The sum of the calculated rates from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -// Evaluation: `sum(rate({job=}[])) <= ` +// Evaluation: `sum(rate({job=}[])) <= ` type MetricRuleApplyConfiguration struct { // Prometheus metric. For example `http_request_count` Name *string `json:"name,omitempty"` diff --git a/website/includes/api-reference.html b/website/includes/api-reference.html index e140c27c..5a861544 100644 --- a/website/includes/api-reference.html +++ b/website/includes/api-reference.html @@ -113,7 +113,7 @@

CAPApplication -

SAP BTP Global Account Identifier where services are entitles for the current application +

SAP BTP Global Account Identifier where services are entitled for the current application Will soon be deprecated, use ProviderSubaccountId instead

@@ -1179,7 +1179,7 @@

CAPApplicationSpec -

SAP BTP Global Account Identifier where services are entitles for the current application +

SAP BTP Global Account Identifier where services are entitled for the current application Will soon be deprecated, use ProviderSubaccountId instead

@@ -2349,7 +2349,7 @@

DNSTemplate -

Target of the DNS reord

+

Target of the DNS record

@@ -3081,7 +3081,7 @@

JobDetails -

Specifies the duration in sections for which the job may be continuously active.

+

Specifies the duration in seconds for which the job may be continuously active.

@@ -3121,10 +3121,10 @@

MetricRule

MetricRule specifies a Prometheus metric and rule which represents a cleanup condition. Metrics of type Gauge and Counter are supported.

Rule evaluation for Gauge type metric: The time series data of the metric (restricted to the current workload by setting job label as workload service name) is calculated as an average over the specified period. A sum of the calculated average from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -Evaluation: sum(avg_over_time(<gauge-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower0threshold-value>

+Evaluation: sum(avg_over_time(<gauge-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower-threshold-value>

Rule evaluation for Counter type metric: The time series data of the metric (restricted to the current workload by setting job label as workload service name) is calculated as rate of increase over the specified period. The sum of the calculated rates from different time series is then compared to the provided threshold value to determine whether the rule has been satisfied. -Evaluation: sum(rate(<counter-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower0threshold-value>

+Evaluation: sum(rate(<counter-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower-threshold-value>

@@ -3942,5 +3942,5 @@

WorkloadMonitoring

Generated with gen-crd-api-reference-docs -on git commit 537363a. +on git commit ab07890.