File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
kubernetes/charts/weblogic-operator/templates Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -457,4 +457,19 @@ Verify that a list of strings can not be defined if another string is already de
457
457
*/} }
458
458
{ {- define " utils.mutexString" -} }
459
459
{ {- include " utils.mutexValue" (append . " string" ) -} }
460
- { {- end -} }
460
+ { {- end -} }
461
+
462
+ { {/*
463
+ Verify that a Kubernetes resource exists in a given namespace
464
+ */} }
465
+ { {- define " utils.verifyK8SResource" -} }
466
+ { {- $scope := index . 0 -} }
467
+ { {- $name := index . 1 -} }
468
+ { {- $type := index . 2 -} }
469
+ { {- $namespace := index . 3 -} }
470
+ { {- $found := (lookup " v1" $type $namespace $name ) } }
471
+ { {- if not $found } }
472
+ { {- $errorMsg := cat $type $name " does not exist in namespace " $namespace -} }
473
+ { {- include " utils.recordValidationError" (list $scope $errorMsg ) -} }
474
+ { {- end -} }
475
+ { {- end -} }
Original file line number Diff line number Diff line change 8
8
{ {- $ignore := include " utils.verifyResourceName" (list $scope " Namespace" ) -} }
9
9
{ {- $ignore := include " utils.popValidationContext" $scope -} }
10
10
{ {- $ignore := include " utils.verifyString" (list $scope " serviceAccount" ) -} }
11
+ { {- $ignore := include " utils.verifyK8SResource" (list $scope .serviceAccount " ServiceAccount" .Release.Namespace) -} }
11
12
{ {- $ignore := include " utils.verifyString" (list $scope " image" ) -} }
12
13
{ {- $ignore := include " utils.verifyEnum" (list $scope " imagePullPolicy" (list " Always" " IfNotPresent" " Never" )) -} }
13
14
{ {- $ignore := include " utils.verifyOptionalDictionaryList" (list $scope " imagePullSecrets" ) -} }
You can’t perform that action at this time.
0 commit comments