Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions api/v1alpha1/capoperator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ type SubscriptionServer struct {
type Controller struct {
// Optionally enable detailed opertational metrics for the controller by setting this to true
DetailedOperationalMetrics bool `json:"detailedOperationalMetrics,omitempty"`
// Configuration of maximum number of concurrent reconciles for the resources managed by the controller
MaxConcurrentReconciles *MaxConcurrentReconciles `json:"maxConcurrentReconciles,omitempty"`
// Version monitoring configuration
VersionMonitoring *VersionMonitoring `json:"versionMonitoring,omitempty"`
// Optionally specify list of additional volumes for the controller pod(s)
Expand All @@ -90,6 +92,21 @@ type Controller struct {
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
}

type MaxConcurrentReconciles struct {
// Maximum number of concurrent reconciles for the cap application
CAPApplication string `json:"capApplication,omitempty"`
// Maximum number of concurrent reconciles for the cap application version
CAPApplicationVersion string `json:"capApplicationVersion,omitempty"`
// Maximum number of concurrent reconciles for the cap tenant
CAPTenant string `json:"capTenant,omitempty"`
// Maximum number of concurrent reconciles for the cap tenant operation
CAPTenantOperation string `json:"capTenantOperation,omitempty"`
// Maximum number of concurrent reconciles for the domain
Domain string `json:"domain,omitempty"`
// Maximum number of concurrent reconciles for the cluster domain
ClusterDomain string `json:"clusterDomain,omitempty"`
}

type VersionMonitoring struct {
// URL of the Prometheus server from which metrics related to managed application versions can be queried
PrometheusAddress string `json:"prometheusAddress,omitempty"`
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions config/crd/operator.sme.sap.com_capoperators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,35 @@ spec:
description: Optionally enable detailed opertational metrics for
the controller by setting this to true
type: boolean
maxConcurrentReconciles:
description: Configuration of maximum number of concurrent reconciles
for the resources managed by the controller
properties:
capApplication:
description: Maximum number of concurrent reconciles for the
cap application
type: string
capApplicationVersion:
description: Maximum number of concurrent reconciles for the
cap application version
type: string
capTenant:
description: Maximum number of concurrent reconciles for the
cap tenant
type: string
capTenantOperation:
description: Maximum number of concurrent reconciles for the
cap tenant operation
type: string
clusterDomain:
description: Maximum number of concurrent reconciles for the
cluster domain
type: string
domain:
description: Maximum number of concurrent reconciles for the
domain
type: string
type: object
versionMonitoring:
description: Version monitoring configuration
properties:
Expand Down
29 changes: 29 additions & 0 deletions internal/transformer/parameter_transformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestTransformer(t *testing.T) {
withControllerVolumes bool
withCertManager bool
withMonitoringGrafanaDashboard bool
withMaxConcurrentReconciles bool
}{
{
name: "With dnsTarget and without ingress gateway labels",
Expand Down Expand Up @@ -63,6 +64,12 @@ func TestTransformer(t *testing.T) {
longDomain: false,
withoutIngressGatewaySvcAnnotation: true,
},
{
name: "With max concurrent reconciles",
dnsTargetFilled: true,
withMaxConcurrentReconciles: true,
expectError: false,
},
{
name: "With version monitoring and dnsTarget filled",
dnsTargetFilled: true,
Expand Down Expand Up @@ -201,6 +208,16 @@ func TestTransformer(t *testing.T) {
}
}

if tt.withMaxConcurrentReconciles {
capOperatorSpec.Controller.MaxConcurrentReconciles = &v1alpha1.MaxConcurrentReconciles{
CAPApplication: "2",
CAPApplicationVersion: "5",
CAPTenant: "15",
CAPTenantOperation: "20",
Domain: "1",
}
}

if tt.withVersionMonitoring {
capOperatorSpec.Controller.VersionMonitoring = &v1alpha1.VersionMonitoring{
PrometheusAddress: mockPrometheusAddress,
Expand Down Expand Up @@ -315,6 +332,18 @@ func TestTransformer(t *testing.T) {
if transformedController["dnsTarget"].(string) != expectedDnsTarget {
t.Error("unexpected value returned for controller.dnsTarget")
}

if tt.withMaxConcurrentReconciles {
if transformedController["maxConcurrentReconciles"] == nil {
t.Error("expected controller.maxConcurrentReconciles to be filled")
} else {
mcr := transformedController["maxConcurrentReconciles"].(map[string]any)
if mcr["capApplication"] != "2" || mcr["capApplicationVersion"] != "5" || mcr["capTenant"] != "15" || mcr["capTenantOperation"] != "20" || mcr["domain"] != "1" {
t.Error("unexpected values returned for controller.maxConcurrentReconciles")
}
}
}

if tt.withVersionMonitoring {
if transformedController["versionMonitoring"] == nil {
t.Error("expected controller.versionMonitoring to be filled")
Expand Down