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
Copy file name to clipboardExpand all lines: api/v1alpha1/backendsecurity_policy.go
+18-4Lines changed: 18 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -229,14 +229,18 @@ type BackendSecurityPolicyGCPCredentials struct {
229
229
}
230
230
231
231
// BackendSecurityPolicyAzureCredentials contains the supported authentication mechanisms to access Azure.
232
-
// Only one of ClientSecretRef or OIDCExchangeToken must be specified. Credentials will not be generated if
233
-
// neither are set.
232
+
// One of ClientSecretRef, OIDCExchangeToken, or UseManagedIdentity must be specified.
233
+
// When UseManagedIdentity is true, neither ClientSecretRef nor OIDCExchangeToken should be set.
234
+
// Otherwise, exactly one of ClientSecretRef or OIDCExchangeToken must be specified.
234
235
//
235
-
// +kubebuilder:validation:XValidation:rule="(has(self.clientSecretRef) && !has(self.oidcExchangeToken)) || (!has(self.clientSecretRef) && has(self.oidcExchangeToken))",message="Exactly one of clientSecretRef or oidcExchangeToken must be specified"
236
+
// +kubebuilder:validation:XValidation:rule="has(self.useManagedIdentity) && self.useManagedIdentity ? (!has(self.clientSecretRef) && !has(self.oidcExchangeToken)) : ((has(self.clientSecretRef) && !has(self.oidcExchangeToken)) || (!has(self.clientSecretRef) && has(self.oidcExchangeToken)))",message="When useManagedIdentity is true, clientSecretRef and oidcExchangeToken must not be specified. Otherwise, exactly one of clientSecretRef or oidcExchangeToken must be specified"
237
+
// +kubebuilder:validation:XValidation:rule="has(self.useManagedIdentity) && self.useManagedIdentity && !has(self.clientID) ? true : has(self.clientID)",message="clientID is optional for system-assigned managed identity but required otherwise"
236
238
typeBackendSecurityPolicyAzureCredentialsstruct {
237
239
// ClientID is a unique identifier for an application in Azure.
240
+
// This field is optional when using system-assigned managed identity,
241
+
// but required for user-assigned managed identity and other authentication methods.
238
242
//
239
-
// +kubebuilder:validation:Required
243
+
// +optional
240
244
// +kubebuilder:validation:MinLength=1
241
245
ClientIDstring`json:"clientID"`
242
246
@@ -258,6 +262,16 @@ type BackendSecurityPolicyAzureCredentials struct {
0 commit comments