You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.
164
+
// If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.
165
+
// The ConfigMap must exist in the external-secrets operand namespace.
166
+
// When omitted, external providers fall back to standard system certificates, while proxy connections use the OpenShift trusted CA bundle by default.
// overrideEnv specifies custom environment variables for this component's container. These are merged with operator-managed environment variables, with user-defined values taking precedence.
178
-
// Keys starting with 'HOSTNAME', 'KUBERNETES_', or 'EXTERNAL_SECRETS_' are reserved and will be rejected.
185
+
// Names starting with 'KUBERNETES_' or 'EXTERNAL_SECRETS_' are reserved prefixes and will be rejected.
186
+
// The exact names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are also reserved.
179
187
// +kubebuilder:validation:MaxItems:=50
180
-
// +kubebuilder:validation:XValidation:rule="self.all(e, !['HOSTNAME', 'KUBERNETES_', 'EXTERNAL_SECRETS_'].exists(p, e.name.startsWith(p)))",message="Environment variable names with reserved prefixes 'HOSTNAME', 'KUBERNETES_', 'EXTERNAL_SECRETS_' are not allowed"
188
+
// +kubebuilder:validation:XValidation:rule="self.all(e, !['KUBERNETES_', 'EXTERNAL_SECRETS_'].exists(p, e.name.startsWith(p)) && e.name != 'HOSTNAME' && e.name != 'SSL_CERT_DIR' && e.name != 'SSL_CERT_FILE')",message="Environment variable names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are reserved, along with any names that start with 'KUBERNETES_' or 'EXTERNAL_SECRETS_'."
Copy file name to clipboardExpand all lines: api/v1alpha1/tests/externalsecretsconfig.operator.openshift.io/externalsecretsconfig.testsuite.yaml
+187-4Lines changed: 187 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -987,7 +987,7 @@ tests:
987
987
- componentName: Webhook
988
988
deploymentConfigs:
989
989
revisionHistoryLimit: 50
990
-
- name: Should fail with overrideEnv starting with HOSTNAME
990
+
- name: Should fail with overrideEnv using reserved name HOSTNAME
991
991
resourceName: cluster
992
992
initial: |
993
993
apiVersion: operator.openshift.io/v1alpha1
@@ -999,7 +999,7 @@ tests:
999
999
overrideEnv:
1000
1000
- name: HOSTNAME
1001
1001
value: "test"
1002
-
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names with reserved prefixes 'HOSTNAME', 'KUBERNETES_', 'EXTERNAL_SECRETS_' are not allowed"
1002
+
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are reserved, along with any names that start with 'KUBERNETES_' or 'EXTERNAL_SECRETS_'."
1003
1003
- name: Should fail with overrideEnv starting with KUBERNETES_
1004
1004
resourceName: cluster
1005
1005
initial: |
@@ -1012,7 +1012,7 @@ tests:
1012
1012
overrideEnv:
1013
1013
- name: KUBERNETES_SERVICE_HOST
1014
1014
value: "test"
1015
-
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names with reserved prefixes 'HOSTNAME', 'KUBERNETES_', 'EXTERNAL_SECRETS_' are not allowed"
1015
+
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are reserved, along with any names that start with 'KUBERNETES_' or 'EXTERNAL_SECRETS_'."
1016
1016
- name: Should fail with overrideEnv starting with EXTERNAL_SECRETS_
1017
1017
resourceName: cluster
1018
1018
initial: |
@@ -1025,7 +1025,190 @@ tests:
1025
1025
overrideEnv:
1026
1026
- name: EXTERNAL_SECRETS_CONFIG
1027
1027
value: "test"
1028
-
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names with reserved prefixes 'HOSTNAME', 'KUBERNETES_', 'EXTERNAL_SECRETS_' are not allowed"
1028
+
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are reserved, along with any names that start with 'KUBERNETES_' or 'EXTERNAL_SECRETS_'."
1029
+
- name: Should fail with overrideEnv using reserved name SSL_CERT_DIR
1030
+
resourceName: cluster
1031
+
initial: |
1032
+
apiVersion: operator.openshift.io/v1alpha1
1033
+
kind: ExternalSecretsConfig
1034
+
spec:
1035
+
controllerConfig:
1036
+
componentConfigs:
1037
+
- componentName: ExternalSecretsCoreController
1038
+
overrideEnv:
1039
+
- name: SSL_CERT_DIR
1040
+
value: "/custom/certs"
1041
+
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are reserved, along with any names that start with 'KUBERNETES_' or 'EXTERNAL_SECRETS_'."
1042
+
- name: Should fail with overrideEnv using reserved name SSL_CERT_FILE
1043
+
resourceName: cluster
1044
+
initial: |
1045
+
apiVersion: operator.openshift.io/v1alpha1
1046
+
kind: ExternalSecretsConfig
1047
+
spec:
1048
+
controllerConfig:
1049
+
componentConfigs:
1050
+
- componentName: ExternalSecretsCoreController
1051
+
overrideEnv:
1052
+
- name: SSL_CERT_FILE
1053
+
value: "/custom/ca.crt"
1054
+
expectedError: "ExternalSecretsConfig.operator.openshift.io \"cluster\" is invalid: spec.controllerConfig.componentConfigs[0].overrideEnv: Invalid value: \"array\": Environment variable names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are reserved, along with any names that start with 'KUBERNETES_' or 'EXTERNAL_SECRETS_'."
1055
+
- name: Should allow overrideEnv starting with HOSTNAME as prefix (only exact HOSTNAME is reserved)
1056
+
resourceName: cluster
1057
+
initial: |
1058
+
apiVersion: operator.openshift.io/v1alpha1
1059
+
kind: ExternalSecretsConfig
1060
+
spec:
1061
+
controllerConfig:
1062
+
componentConfigs:
1063
+
- componentName: ExternalSecretsCoreController
1064
+
overrideEnv:
1065
+
- name: HOSTNAME_SUFFIX
1066
+
value: "allowed"
1067
+
expected: |
1068
+
apiVersion: operator.openshift.io/v1alpha1
1069
+
kind: ExternalSecretsConfig
1070
+
spec:
1071
+
controllerConfig:
1072
+
componentConfigs:
1073
+
- componentName: ExternalSecretsCoreController
1074
+
overrideEnv:
1075
+
- name: HOSTNAME_SUFFIX
1076
+
value: "allowed"
1077
+
- name: Should allow overrideEnv with SSL_CERT_DIR as substring (not exact name)
1078
+
resourceName: cluster
1079
+
initial: |
1080
+
apiVersion: operator.openshift.io/v1alpha1
1081
+
kind: ExternalSecretsConfig
1082
+
spec:
1083
+
controllerConfig:
1084
+
componentConfigs:
1085
+
- componentName: ExternalSecretsCoreController
1086
+
overrideEnv:
1087
+
- name: MY_SSL_CERT_DIR
1088
+
value: "/custom/certs"
1089
+
expected: |
1090
+
apiVersion: operator.openshift.io/v1alpha1
1091
+
kind: ExternalSecretsConfig
1092
+
spec:
1093
+
controllerConfig:
1094
+
componentConfigs:
1095
+
- componentName: ExternalSecretsCoreController
1096
+
overrideEnv:
1097
+
- name: MY_SSL_CERT_DIR
1098
+
value: "/custom/certs"
1099
+
- name: Should allow trustedCABundle with required name field only (defaults applied)
1100
+
resourceName: cluster
1101
+
initial: |
1102
+
apiVersion: operator.openshift.io/v1alpha1
1103
+
kind: ExternalSecretsConfig
1104
+
spec:
1105
+
controllerConfig:
1106
+
trustedCABundle:
1107
+
name: trusted-ca-bundle
1108
+
expected: |
1109
+
apiVersion: operator.openshift.io/v1alpha1
1110
+
kind: ExternalSecretsConfig
1111
+
spec:
1112
+
controllerConfig:
1113
+
trustedCABundle:
1114
+
name: trusted-ca-bundle
1115
+
key: ca-bundle.crt
1116
+
- name: Should allow trustedCABundle with explicit key
1117
+
resourceName: cluster
1118
+
initial: |
1119
+
apiVersion: operator.openshift.io/v1alpha1
1120
+
kind: ExternalSecretsConfig
1121
+
spec:
1122
+
controllerConfig:
1123
+
trustedCABundle:
1124
+
name: my-ca-bundle
1125
+
key: ca-chain.crt
1126
+
expected: |
1127
+
apiVersion: operator.openshift.io/v1alpha1
1128
+
kind: ExternalSecretsConfig
1129
+
spec:
1130
+
controllerConfig:
1131
+
trustedCABundle:
1132
+
name: my-ca-bundle
1133
+
key: ca-chain.crt
1134
+
- name: Should fail with trustedCABundle name empty
1135
+
resourceName: cluster
1136
+
initial: |
1137
+
apiVersion: operator.openshift.io/v1alpha1
1138
+
kind: ExternalSecretsConfig
1139
+
spec:
1140
+
controllerConfig:
1141
+
trustedCABundle:
1142
+
name: ""
1143
+
expectedError: "spec.controllerConfig.trustedCABundle.name: Invalid value: \"\": spec.controllerConfig.trustedCABundle.name in body should be at least 1 chars long"
1144
+
- name: Should fail with trustedCABundle name too long
expectedError: "spec.controllerConfig.trustedCABundle.name: Too long: may not be more than 253 bytes"
1154
+
- name: Should fail with trustedCABundle key empty
1155
+
resourceName: cluster
1156
+
initial: |
1157
+
apiVersion: operator.openshift.io/v1alpha1
1158
+
kind: ExternalSecretsConfig
1159
+
spec:
1160
+
controllerConfig:
1161
+
trustedCABundle:
1162
+
name: trusted-ca-bundle
1163
+
key: ""
1164
+
expectedError: "spec.controllerConfig.trustedCABundle.key: Invalid value: \"\": spec.controllerConfig.trustedCABundle.key in body should be at least 1 chars long"
1165
+
- name: Should fail with trustedCABundle key containing invalid characters
1166
+
resourceName: cluster
1167
+
initial: |
1168
+
apiVersion: operator.openshift.io/v1alpha1
1169
+
kind: ExternalSecretsConfig
1170
+
spec:
1171
+
controllerConfig:
1172
+
trustedCABundle:
1173
+
name: trusted-ca-bundle
1174
+
key: "invalid key with spaces"
1175
+
expectedError: "spec.controllerConfig.trustedCABundle.key: Invalid value: \"invalid key with spaces\": spec.controllerConfig.trustedCABundle.key in body should match"
1176
+
- name: Should allow trustedCABundle combined with componentConfigs and annotations
1177
+
resourceName: cluster
1178
+
initial: |
1179
+
apiVersion: operator.openshift.io/v1alpha1
1180
+
kind: ExternalSecretsConfig
1181
+
spec:
1182
+
controllerConfig:
1183
+
annotations:
1184
+
example.com/team: "platform"
1185
+
componentConfigs:
1186
+
- componentName: ExternalSecretsCoreController
1187
+
deploymentConfigs:
1188
+
revisionHistoryLimit: 5
1189
+
overrideEnv:
1190
+
- name: GOMAXPROCS
1191
+
value: "4"
1192
+
trustedCABundle:
1193
+
name: trusted-ca-bundle
1194
+
key: ca-bundle.crt
1195
+
expected: |
1196
+
apiVersion: operator.openshift.io/v1alpha1
1197
+
kind: ExternalSecretsConfig
1198
+
spec:
1199
+
controllerConfig:
1200
+
annotations:
1201
+
example.com/team: "platform"
1202
+
componentConfigs:
1203
+
- componentName: ExternalSecretsCoreController
1204
+
deploymentConfigs:
1205
+
revisionHistoryLimit: 5
1206
+
overrideEnv:
1207
+
- name: GOMAXPROCS
1208
+
value: "4"
1209
+
trustedCABundle:
1210
+
name: trusted-ca-bundle
1211
+
key: ca-bundle.crt
1029
1212
- name: Should allow componentConfigs with revisionHistoryLimit
Copy file name to clipboardExpand all lines: bundle/manifests/operator.openshift.io_externalsecretsconfigs.yaml
+33-6Lines changed: 33 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1334,7 +1334,8 @@ spec:
1334
1334
overrideEnv:
1335
1335
description: |-
1336
1336
overrideEnv specifies custom environment variables for this component's container. These are merged with operator-managed environment variables, with user-defined values taking precedence.
1337
-
Keys starting with 'HOSTNAME', 'KUBERNETES_', or 'EXTERNAL_SECRETS_' are reserved and will be rejected.
1337
+
Names starting with 'KUBERNETES_' or 'EXTERNAL_SECRETS_' are reserved prefixes and will be rejected.
1338
+
The exact names 'HOSTNAME', 'SSL_CERT_DIR', and 'SSL_CERT_FILE' are also reserved.
1338
1339
items:
1339
1340
description: EnvVar represents an environment variable
1340
1341
present in a Container.
@@ -1496,11 +1497,12 @@ spec:
1496
1497
- name
1497
1498
x-kubernetes-list-type: map
1498
1499
x-kubernetes-validations:
1499
-
- message: Environment variable names with reserved prefixes
1500
-
'HOSTNAME', 'KUBERNETES_', 'EXTERNAL_SECRETS_' are not
trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.
1774
+
If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.
1775
+
The ConfigMap must exist in the external-secrets operand namespace.
1776
+
When omitted, external providers fall back to standard system certificates, while proxy connections use the OpenShift trusted CA bundle by default.
1777
+
properties:
1778
+
key:
1779
+
default: ca-bundle.crt
1780
+
description: |-
1781
+
key is the specific key in the ConfigMap to be utilized.
1782
+
When omitted, defaults to "ca-bundle.crt".
1783
+
maxLength: 253
1784
+
minLength: 1
1785
+
pattern: ^[-._a-zA-Z0-9]+$
1786
+
type: string
1787
+
name:
1788
+
description: name of the ConfigMap resource being referred
1789
+
to.
1790
+
maxLength: 253
1791
+
minLength: 1
1792
+
type: string
1793
+
required:
1794
+
- name
1795
+
type: object
1769
1796
type: object
1770
1797
plugins:
1771
1798
description: plugins is for configuring the optional provider plugins.
0 commit comments