Skip to content

Commit

Permalink
Merge branch 'main' into use-csm-base-image
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-young authored Oct 23, 2024
2 parents 7786358 + a2aa65c commit 2ef0489
Showing 6 changed files with 59 additions and 41 deletions.
64 changes: 32 additions & 32 deletions pkg/modules/authorization.go
Original file line number Diff line number Diff line change
@@ -299,25 +299,24 @@ func getAuthApplyCR(cr csmv1.ContainerStorageModule, op utils.OperatorConfig) (*
return nil, nil, err
}

// If there are no components, create one
if len(authModule.Components) == 0 {
authModule.Components = []csmv1.ContainerTemplate{
{
Name: "karavi-authorization-proxy",
Envs: []corev1.EnvVar{
{
Name: "PROXY_HOST",
Value: "csm-authorization.com",
},
{
Name: "SKIP_CERTIFICATE_VALIDATION",
Value: "true",
},
},
},
for i, component := range authModule.Components {
if component.Name == "karavi-authorization-proxy" {
skipcertFound := false
for _, env := range authModule.Components[i].Envs {
if env.Name == "SKIP_CERTIFICATE_VALIDATION" {
skipcertFound = true
break
}
}
// If SKIP_CERTIFICATE_VALIDATION is not found, add it
if !skipcertFound {
authModule.Components[i].Envs = append(authModule.Components[i].Envs, corev1.EnvVar{
Name: "SKIP_CERTIFICATE_VALIDATION",
Value: "true",
})
}
}
}

container.Env = utils.ReplaceAllApplyCustomEnvs(container.Env, authModule.Components[0].Envs, authModule.Components[0].Envs)

skipCertValid := false
@@ -466,21 +465,22 @@ func AuthorizationPrecheck(ctx context.Context, op utils.OperatorConfig, auth cs
// Check for secrets
skipCertValid := false
// check if components are present or not
if len(auth.Components) == 0 {
auth.Components = []csmv1.ContainerTemplate{
{
Name: "karavi-authorization-proxy",
Envs: []corev1.EnvVar{
{
Name: "PROXY_HOST",
Value: "csm-authorization.com",
},
{
Name: "SKIP_CERTIFICATE_VALIDATION",
Value: "true",
},
},
},
for i, component := range auth.Components {
if component.Name == "karavi-authorization-proxy" {
skipcertFound := false
for _, env := range auth.Components[i].Envs {
if env.Name == "SKIP_CERTIFICATE_VALIDATION" {
skipcertFound = true
break
}
}
// If SKIP_CERTIFICATE_VALIDATION is not found, add it
if !skipcertFound {
auth.Components[i].Envs = append(auth.Components[i].Envs, corev1.EnvVar{
Name: "SKIP_CERTIFICATE_VALIDATION",
Value: "true",
})
}
}
}

8 changes: 7 additions & 1 deletion samples/minimal-samples/powerflex.yaml
Original file line number Diff line number Diff line change
@@ -14,7 +14,13 @@ spec:
# enable: Enable/Disable csm-authorization
enabled: false
# For Auth 2.0, use v2.0.0 as configVersion
configVersion: v1.11.0
configVersion: v1.12.0
components:
- name: karavi-authorization-proxy
envs:
# proxyHost: hostname of the csm-authorization server
- name: "PROXY_HOST"
value: "authorization-ingress-nginx-controller.authorization.svc.cluster.local"
- name: resiliency
# enabled: Enable/Disable Resiliency feature
# Allowed values:
8 changes: 7 additions & 1 deletion samples/minimal-samples/powermax.yaml
Original file line number Diff line number Diff line change
@@ -14,7 +14,13 @@ spec:
# enable: Enable/Disable csm-authorization
enabled: false
# For Auth 2.0, use v2.0.0 as configVersion
configVersion: v1.11.0
configVersion: v1.12.0
components:
- name: karavi-authorization-proxy
envs:
# proxyHost: hostname of the csm-authorization server
- name: "PROXY_HOST"
value: "authorization-ingress-nginx-controller.authorization.svc.cluster.local"
- name: resiliency
enabled: false
- name: replication
8 changes: 7 additions & 1 deletion samples/minimal-samples/powerscale.yaml
Original file line number Diff line number Diff line change
@@ -14,7 +14,13 @@ spec:
# enable: Enable/Disable csm-authorization
enabled: false
# For Auth 2.0, use v2.0.0 as configVersion
configVersion: v1.11.0
configVersion: v1.12.0
components:
- name: karavi-authorization-proxy
envs:
# proxyHost: hostname of the csm-authorization server
- name: "PROXY_HOST"
value: "authorization-ingress-nginx-controller.authorization.svc.cluster.local"
- name: resiliency
# enabled: Enable/Disable Resiliency feature
# Allowed values:
Original file line number Diff line number Diff line change
@@ -16,3 +16,8 @@ spec:
# enable: Enable/Disable csm-authorization
enabled: true
configVersion: v2.0.0
components:
- name: karavi-authorization-proxy
envs:
- name: "PROXY_HOST"
value: "authorization-ingress-nginx-controller.authorization.svc.cluster.local"
Original file line number Diff line number Diff line change
@@ -16,14 +16,9 @@ spec:
- name: authorization
# enable: Enable/Disable csm-authorization
enabled: true
configVersion: v1.11.0
configVersion: v1.12.0
components:
- name: karavi-authorization-proxy
image: dellemc/csm-authorization-sidecar:nightly
envs:
# proxyHost: hostname of the csm-authorization server
- name: "PROXY_HOST"
value: "authorization-ingress-nginx-controller.authorization.svc.cluster.local"
# skipCertificateValidation: Enable/Disable certificate validation of the csm-authorization server
- name: "SKIP_CERTIFICATE_VALIDATION"
value: "true"

0 comments on commit 2ef0489

Please sign in to comment.