Skip to content

Commit

Permalink
run as non root by default
Browse files Browse the repository at this point in the history
  • Loading branch information
KauzClay committed Sep 13, 2023
1 parent a072003 commit 58a7ebc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/apis/serving/v1/revision_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ func (rs *RevisionSpec) defaultSecurityContext(psc *corev1.PodSecurityContext, c
}
}

if psc.RunAsNonRoot == nil {
updatedSC.RunAsNonRoot = ptr.Bool(true)
}

if *updatedSC != (corev1.SecurityContext{}) {
container.SecurityContext = updatedSC
}
Expand Down

0 comments on commit 58a7ebc

Please sign in to comment.