Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of observability in minimal manifest for powermax #733

Merged
merged 9 commits into from
Oct 16, 2024
3 changes: 3 additions & 0 deletions operatorconfig/moduleconfig/common/version-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,17 @@ powermax:
v2.10.1:
csireverseproxy: "v2.9.1"
authorization: "v1.10.1"
observability: "v1.8.1"
replication: "v1.8.1"
v2.11.0:
csireverseproxy: "v2.11.0"
authorization: "v1.11.0"
replication: "v1.9.0"
observability: "v1.9.0"
resiliency: "v1.10.0"
v2.12.0:
csireverseproxy: "v2.11.0"
authorization: "v1.11.0"
replication: "v1.10.0"
observability: "v1.10.0"
resiliency: "v1.11.0"
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ spec:
serviceAccount: karavi-metrics-powerflex-controller
containers:
- name: karavi-metrics-powerflex
image: dellemc/csm-metrics-powerflex:v1.7.0
image: dellemc/csm-metrics-powerflex:v1.10.0
resources: {}
env:
- name: POWERFLEX_METRICS_ENDPOINT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
serviceAccountName: karavi-metrics-powermax-controller
containers:
- name: karavi-metrics-powermax
image: dellemc/csm-metrics-powermax:v1.2.0
image: dellemc/csm-metrics-powermax:v1.5.0
resources: {}
env:
- name: POWERMAX_METRICS_ENDPOINT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ spec:
serviceAccount: karavi-metrics-powerscale-controller
containers:
- name: karavi-metrics-powerscale
image: dellemc/csm-metrics-powerscale:v1.4.0
image: dellemc/csm-metrics-powerscale:v1.7.0
resources: {}
env:
- name: POWERSCALE_METRICS_ENDPOINT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ spec:
serviceAccount: karavi-observability-topology-controller
containers:
- name: karavi-topology
image: <TOPOLOGY_IMAGE>
image: dellemc/csm-topology:v1.10.0
resources: {}
env:
- name: PORT
Expand Down
5 changes: 4 additions & 1 deletion pkg/drivers/powermax.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func PrecheckPowerMax(ctx context.Context, cr *csmv1.ContainerStorageModule, ope
log := logger.GetLogger(ctx)
// Check for default secret only
// Array specific will be authenticated in csireverseproxy
cred := cr.Spec.Driver.AuthSecret
cred := cr.Name + "-creds"
if cr.Spec.Driver.AuthSecret != "" {
cred = cr.Spec.Driver.AuthSecret
}

// Check if driver version is supported by doing a stat on a config file
configFilePath := fmt.Sprintf("%s/driverconfig/powermax/%s/upgrade-path.yaml", operatorConfig.ConfigDirectory, cr.Spec.Driver.ConfigVersion)
Expand Down
25 changes: 0 additions & 25 deletions pkg/drivers/powermax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,6 @@ var (
}{
{"happy path", powerMaxCSM, powerMaxClient, powerMaxSecret, ""},
{"no proxy set defaults", powerMaxCSMNoProxy, powerMaxClient, powerMaxSecret, ""},
}

preCheckpowerMaxTest = []struct {
// every single unit test name
name string
// csm object
csm csmv1.ContainerStorageModule
// client
ct client.Client
// secret
sec *corev1.Secret
// expected error
expectedErr string
}{
{"missing secret", powerMaxCSM, powerMaxClient, pMaxfakeSecret, "failed to find secret"},
{"bad version", powerMaxCSMBadVersion, powerMaxClient, powerMaxSecret, "not supported"},
{"bad latest version", powermaxDefaultKubeletPath, powerMaxClient, powerMaxSecret, ""},
Expand All @@ -69,17 +55,6 @@ var (

func TestPrecheckPowerMax(t *testing.T) {
ctx := context.Background()
for _, tt := range preCheckpowerMaxTest {
t.Run(tt.name, func(t *testing.T) { // #nosec G601 - Run waits for the call to complete.
err := PrecheckPowerMax(ctx, &tt.csm, config, tt.ct)
if tt.expectedErr == "" {
assert.Nil(t, err)
} else {
assert.Containsf(t, err.Error(), tt.expectedErr, "expected error containing %q, got %s", tt.expectedErr, err)
}
})
}

for _, tt := range powerMaxTests {
err := tt.ct.Create(ctx, tt.sec)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/modules/observability.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ var defaultSecretsName = map[csmv1.DriverType]string{
csmv1.PowerScaleName: "<DriverDefaultReleaseName>-creds",
csmv1.PowerFlex: "<DriverDefaultReleaseName>-config",
csmv1.PowerFlexName: "<DriverDefaultReleaseName>-config",
csmv1.PowerMax: "<DriverDefaultReleaseName>-creds",
}

var defaultAuthSecretsName = []string{"karavi-authorization-config", "proxy-authz-tokens", "proxy-server-root-certificate"}
Expand Down
2 changes: 0 additions & 2 deletions pkg/modules/replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ const (
DefaultRetryMin = "<RETRY_INTERVAL_MIN>"
// DefaultRetryMax -
DefaultRetryMax = "<RETRY_INTERVAL_MAX>"
// DefaultReplicaImage -
DefaultReplicaImage = "<REPLICATION_CONTROLLER_IMAGE>"
// DefaultReplicaInitImage -
DefaultReplicaInitImage = "<REPLICATION_INIT_IMAGE>"
)
Expand Down
2 changes: 1 addition & 1 deletion samples/minimal-samples/powerflex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
# Default value: false
enabled: false
- name: replication
enabled: true
enabled: false
# observability: allows to configure observability
- name: observability
# enabled: Enable/Disable observability
Expand Down
17 changes: 17 additions & 0 deletions samples/minimal-samples/powermax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ spec:
enabled: false
- name: replication
enabled: false
- name: observability
# enabled: Enable/Disable observability
enabled: false
components:
- name: topology
enabled: true
- name: otel-collector
enabled: true
- name: cert-manager
# enabled: Enable/Disable cert-manager
# Allowed values:
# true: enable deployment of cert-manager
# false: disable deployment of cert-manager only if it's already deployed
# Default value: false
enabled: false
- name: metrics-powermax
enabled: true
2 changes: 1 addition & 1 deletion samples/minimal-samples/powerscale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
# Default value: false
enabled: false
- name: replication
enabled: true
enabled: false
- name: observability
# enabled: Enable/Disable observability
enabled: false
Expand Down
Loading