Skip to content

Commit e4ca057

Browse files
authored
[Misc] Quality: minor issues addressed (#377)
misc Q fixes.
1 parent 44fbe30 commit e4ca057

8 files changed

Lines changed: 20 additions & 20 deletions

File tree

cmd/server/internal/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,6 @@ func (s *SubscriptionHandler) DeleteTenant(reqInfo *RequestInfo) *Result {
510510
}
511511

512512
func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDetails, ca *v1alpha1.CAPApplication, subscription subscriptionType, step string) (saasData *util.SaasRegistryCredentials, smsData *util.SmsCredentials, err error) {
513-
uaaData := &util.XSUAACredentials{}
514513
switch subscription {
515514
case SMS:
516515
// fetch SMS information
@@ -523,6 +522,7 @@ func (s *SubscriptionHandler) authorizationCheck(headerDetails *requestHeaderDet
523522
err = s.checkCertIssuerAndSubject(headerDetails.xForwardedClientCert, smsData, step)
524523

525524
default:
525+
uaaData := &util.XSUAACredentials{}
526526
// fetch SaaS Registry and XSUAA information
527527
saasData, uaaData = s.getServiceDetails(ca, step)
528528
if saasData == nil || uaaData == nil {

internal/controller/reconcile-captenant.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ func (c *Controller) getCAPApplicationVersionForTenantOperationType(ctx context.
580580
case v1alpha1.CAPTenantOperationTypeDeprovisioning: // for deletion - use the current CAPApplicationVersion (from status)
581581
if cat.Status.CurrentCAPApplicationVersionInstance == "" {
582582
err := fmt.Errorf("cannot identify %s for %s %s.%s", v1alpha1.CAPApplicationVersionKind, v1alpha1.CAPTenantKind, cat.Namespace, cat.Name)
583-
util.LogError(err, "Cannot identify applicaion version", string(Deprovisioning), cat, nil, "tenantId", cat.Spec.TenantId)
583+
util.LogError(err, "Cannot identify application version", string(Deprovisioning), cat, nil, "tenantId", cat.Spec.TenantId)
584584
return nil, err
585585
}
586586
cav, err := c.crdClient.SmeV1alpha1().CAPApplicationVersions(cat.Namespace).Get(ctx, cat.Status.CurrentCAPApplicationVersionInstance, metav1.GetOptions{})

pkg/apis/sme.sap.com/v1alpha1/types.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
CAPTenantOperationKind = "CAPTenantOperation"
2525
CAPTenantOperationResource = "captenantoperations"
2626
CAPTenantOutputKind = "CAPTenantOutput"
27-
CAPTenantOutputResource = "captenantouputs"
27+
CAPTenantOutputResource = "captenantoutputs"
2828
DomainKind = "Domain"
2929
DomainResource = "domains"
3030
ClusterDomainKind = "ClusterDomain"
@@ -92,7 +92,7 @@ type CAPApplicationSpec struct {
9292
DomainRefs []DomainRef `json:"domainRefs,omitempty"`
9393
// [DEPRECATED] Domains used by the application // Will be removed in future versions
9494
Domains ApplicationDomains `json:"domains,omitempty"`
95-
// SAP BTP Global Account Identifier where services are entitles for the current application
95+
// SAP BTP Global Account Identifier where services are entitled for the current application
9696
// Will soon be deprecated, use ProviderSubaccountId instead
9797
GlobalAccountId string `json:"globalAccountId"`
9898
// The subaccount ID in which the application is provided (will soon replace GlobalAccountId)
@@ -393,11 +393,11 @@ type DeletionRules struct {
393393
//
394394
// 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.
395395
// 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.
396-
// Evaluation: `sum(avg_over_time(<gauge-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower0threshold-value>`
396+
// Evaluation: `sum(avg_over_time(<gauge-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower-threshold-value>`
397397
//
398398
// 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.
399399
// 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.
400-
// Evaluation: `sum(rate(<counter-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower0threshold-value>`
400+
// Evaluation: `sum(rate(<counter-metric>{job=<workload-service-name>}[<lookback-duration>])) <= <lower-threshold-value>`
401401
type MetricRule struct {
402402
// Prometheus metric. For example `http_request_count`
403403
Name string `json:"name"`
@@ -450,7 +450,7 @@ type JobDetails struct {
450450
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
451451
// Specifies the time after which the job may be cleaned up.
452452
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`
453-
// Specifies the duration in sections for which the job may be continuously active.
453+
// Specifies the duration in seconds for which the job may be continuously active.
454454
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
455455
}
456456

@@ -798,7 +798,7 @@ type DomainSpec struct {
798798
type DNSTemplate struct {
799799
// Domain name for which a DNS record will be created
800800
Name string `json:"name"`
801-
// Target of the DNS reord
801+
// Target of the DNS record
802802
Target string `json:"target"`
803803
}
804804

pkg/client/applyconfiguration/sme.sap.com/v1alpha1/capapplicationspec.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/applyconfiguration/sme.sap.com/v1alpha1/dnstemplate.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/applyconfiguration/sme.sap.com/v1alpha1/jobdetails.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/applyconfiguration/sme.sap.com/v1alpha1/metricrule.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

website/includes/api-reference.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ <h3 id="sme.sap.com/v1alpha1.CAPApplication">CAPApplication
113113
</em>
114114
</td>
115115
<td>
116-
<p>SAP BTP Global Account Identifier where services are entitles for the current application
116+
<p>SAP BTP Global Account Identifier where services are entitled for the current application
117117
Will soon be deprecated, use ProviderSubaccountId instead</p>
118118
</td>
119119
</tr>
@@ -1179,7 +1179,7 @@ <h3 id="sme.sap.com/v1alpha1.CAPApplicationSpec">CAPApplicationSpec
11791179
</em>
11801180
</td>
11811181
<td>
1182-
<p>SAP BTP Global Account Identifier where services are entitles for the current application
1182+
<p>SAP BTP Global Account Identifier where services are entitled for the current application
11831183
Will soon be deprecated, use ProviderSubaccountId instead</p>
11841184
</td>
11851185
</tr>
@@ -2349,7 +2349,7 @@ <h3 id="sme.sap.com/v1alpha1.DNSTemplate">DNSTemplate
23492349
</em>
23502350
</td>
23512351
<td>
2352-
<p>Target of the DNS reord</p>
2352+
<p>Target of the DNS record</p>
23532353
</td>
23542354
</tr>
23552355
</tbody>
@@ -3081,7 +3081,7 @@ <h3 id="sme.sap.com/v1alpha1.JobDetails">JobDetails
30813081
</em>
30823082
</td>
30833083
<td>
3084-
<p>Specifies the duration in sections for which the job may be continuously active.</p>
3084+
<p>Specifies the duration in seconds for which the job may be continuously active.</p>
30853085
</td>
30863086
</tr>
30873087
</tbody>
@@ -3121,10 +3121,10 @@ <h3 id="sme.sap.com/v1alpha1.MetricRule">MetricRule
31213121
<p>MetricRule specifies a Prometheus metric and rule which represents a cleanup condition. Metrics of type Gauge and Counter are supported.</p>
31223122
<p>Rule evaluation for Gauge type metric: The time series data of the metric (restricted to the current workload by setting <code>job</code> label as workload service name) is calculated as an average over the specified period.
31233123
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.
3124-
Evaluation: <code>sum(avg_over_time(&lt;gauge-metric&gt;{job=&lt;workload-service-name&gt;}[&lt;lookback-duration&gt;])) &lt;= &lt;lower0threshold-value&gt;</code></p>
3124+
Evaluation: <code>sum(avg_over_time(&lt;gauge-metric&gt;{job=&lt;workload-service-name&gt;}[&lt;lookback-duration&gt;])) &lt;= &lt;lower-threshold-value&gt;</code></p>
31253125
<p>Rule evaluation for Counter type metric: The time series data of the metric (restricted to the current workload by setting <code>job</code> label as workload service name) is calculated as rate of increase over the specified period.
31263126
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.
3127-
Evaluation: <code>sum(rate(&lt;counter-metric&gt;{job=&lt;workload-service-name&gt;}[&lt;lookback-duration&gt;])) &lt;= &lt;lower0threshold-value&gt;</code></p>
3127+
Evaluation: <code>sum(rate(&lt;counter-metric&gt;{job=&lt;workload-service-name&gt;}[&lt;lookback-duration&gt;])) &lt;= &lt;lower-threshold-value&gt;</code></p>
31283128
</div>
31293129
<table>
31303130
<thead>
@@ -3942,5 +3942,5 @@ <h3 id="sme.sap.com/v1alpha1.WorkloadMonitoring">WorkloadMonitoring
39423942
<hr/>
39433943
<p><em>
39443944
Generated with <code>gen-crd-api-reference-docs</code>
3945-
on git commit <code>537363a</code>.
3945+
on git commit <code>ab07890</code>.
39463946
</em></p>

0 commit comments

Comments
 (0)