Skip to content

Commit

Permalink
update pod extension securityContext annotation value
Browse files Browse the repository at this point in the history
  • Loading branch information
davidqhr committed Aug 26, 2020
1 parent 0988e87 commit 84c861b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions controller/controllers/component_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ func GetPodSecurityContextFromAnnotation(annotations map[string]string) *coreV1.
annotationFound := false

for k, v := range annotations {
if !strings.HasPrefix(k, "core.kalm.dev/podExt/securityContext") {
if !strings.HasPrefix(k, "core.kalm.dev/podExt-securityContext-") {
continue
}

annotationFound = true

rest := strings.TrimPrefix(k, "core.kalm.dev/podExt/securityContext")
rest := strings.TrimPrefix(k, "core.kalm.dev/podExt-securityContext-")

switch rest {
case "runAsGroup":
Expand Down
4 changes: 2 additions & 2 deletions controller/controllers/logsystem_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ func (r *LogSystemReconcilerTask) ReconcilePLGMonolithicLoki() error {
Spec: corev1alpha1.ComponentSpec{
Annotations: map[string]string{
"sidecar.istio.io/inject": "false",
"core.kalm.dev/podExt/securityContext/runAsGroup": "0",
"core.kalm.dev/podExt/securityContext/runAsUser": "0",
"core.kalm.dev/podExt-securityContext-runAsGroup": "0",
"core.kalm.dev/podExt-securityContext-runAsUser": "0",
},
Image: lokiImage,
WorkloadType: corev1alpha1.WorkloadTypeStatefulSet,
Expand Down

0 comments on commit 84c861b

Please sign in to comment.