diff --git a/apis/openidclient/v1alpha1/zz_clientclientpolicy_types.go b/apis/openidclient/v1alpha1/zz_clientclientpolicy_types.go index c51ffbf..e56d38e 100755 --- a/apis/openidclient/v1alpha1/zz_clientclientpolicy_types.go +++ b/apis/openidclient/v1alpha1/zz_clientclientpolicy_types.go @@ -172,6 +172,7 @@ type ClientClientPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.clients) || (has(self.initProvider) && has(self.initProvider.clients))",message="spec.forProvider.clients is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.logic) || (has(self.initProvider) && has(self.initProvider.logic))",message="spec.forProvider.logic is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" Spec ClientClientPolicySpec `json:"spec"` Status ClientClientPolicyStatus `json:"status,omitempty"` diff --git a/apis/openidclient/v1alpha1/zz_clientgrouppolicy_types.go b/apis/openidclient/v1alpha1/zz_clientgrouppolicy_types.go index c7be7a8..8de1d0a 100755 --- a/apis/openidclient/v1alpha1/zz_clientgrouppolicy_types.go +++ b/apis/openidclient/v1alpha1/zz_clientgrouppolicy_types.go @@ -182,6 +182,7 @@ type ClientGroupPolicy struct { metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.decisionStrategy) || (has(self.initProvider) && has(self.initProvider.decisionStrategy))",message="spec.forProvider.decisionStrategy is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.groups) || (has(self.initProvider) && has(self.initProvider.groups))",message="spec.forProvider.groups is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.logic) || (has(self.initProvider) && has(self.initProvider.logic))",message="spec.forProvider.logic is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" Spec ClientGroupPolicySpec `json:"spec"` Status ClientGroupPolicyStatus `json:"status,omitempty"` diff --git a/apis/openidclient/v1alpha1/zz_clientrolepolicy_types.go b/apis/openidclient/v1alpha1/zz_clientrolepolicy_types.go index f0764c9..5225315 100755 --- a/apis/openidclient/v1alpha1/zz_clientrolepolicy_types.go +++ b/apis/openidclient/v1alpha1/zz_clientrolepolicy_types.go @@ -173,6 +173,7 @@ type ClientRolePolicyStatus struct { type ClientRolePolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.logic) || (has(self.initProvider) && has(self.initProvider.logic))",message="spec.forProvider.logic is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.role) || (has(self.initProvider) && has(self.initProvider.role))",message="spec.forProvider.role is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" diff --git a/apis/openidclient/v1alpha1/zz_clientuserpolicy_types.go b/apis/openidclient/v1alpha1/zz_clientuserpolicy_types.go index c2dab8c..2427111 100755 --- a/apis/openidclient/v1alpha1/zz_clientuserpolicy_types.go +++ b/apis/openidclient/v1alpha1/zz_clientuserpolicy_types.go @@ -149,6 +149,7 @@ type ClientUserPolicy struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.decisionStrategy) || (has(self.initProvider) && has(self.initProvider.decisionStrategy))",message="spec.forProvider.decisionStrategy is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.logic) || (has(self.initProvider) && has(self.initProvider.logic))",message="spec.forProvider.logic is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.users) || (has(self.initProvider) && has(self.initProvider.users))",message="spec.forProvider.users is a required parameter" Spec ClientUserPolicySpec `json:"spec"` diff --git a/config/openidclient/config.go b/config/openidclient/config.go index 35362a1..d416c60 100644 --- a/config/openidclient/config.go +++ b/config/openidclient/config.go @@ -67,18 +67,55 @@ func Configure(p *config.Provider) { p.AddResourceConfigurator("keycloak_openid_client_client_policy", func(r *config.Resource) { r.ShortGroup = Group + + if s, ok := r.TerraformResource.Schema["decisionStrategy"]; ok { + s.Optional = false + s.Computed = false + } + + if s, ok := r.TerraformResource.Schema["logic"]; ok { + s.Optional = false + s.Computed = false + } }) p.AddResourceConfigurator("keycloak_openid_client_group_policy", func(r *config.Resource) { r.ShortGroup = Group + if s, ok := r.TerraformResource.Schema["decisionStrategy"]; ok { + s.Optional = false + s.Computed = false + } + + if s, ok := r.TerraformResource.Schema["logic"]; ok { + s.Optional = false + s.Computed = false + } }) p.AddResourceConfigurator("keycloak_openid_client_role_policy", func(r *config.Resource) { r.ShortGroup = Group + if s, ok := r.TerraformResource.Schema["decisionStrategy"]; ok { + s.Optional = false + s.Computed = false + } + + if s, ok := r.TerraformResource.Schema["logic"]; ok { + s.Optional = false + s.Computed = false + } }) p.AddResourceConfigurator("keycloak_openid_client_user_policy", func(r *config.Resource) { r.ShortGroup = Group + if s, ok := r.TerraformResource.Schema["decisionStrategy"]; ok { + s.Optional = false + s.Computed = false + } + + if s, ok := r.TerraformResource.Schema["logic"]; ok { + s.Optional = false + s.Computed = false + } }) p.AddResourceConfigurator("keycloak_openid_client_permissions", func(r *config.Resource) { diff --git a/package/crds/openidclient.keycloak.crossplane.io_clientclientpolicies.yaml b/package/crds/openidclient.keycloak.crossplane.io_clientclientpolicies.yaml index 6baa9bd..8b4b332 100644 --- a/package/crds/openidclient.keycloak.crossplane.io_clientclientpolicies.yaml +++ b/package/crds/openidclient.keycloak.crossplane.io_clientclientpolicies.yaml @@ -618,6 +618,10 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.clients) || (has(self.initProvider) && has(self.initProvider.clients))' + - message: spec.forProvider.logic is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.logic) + || (has(self.initProvider) && has(self.initProvider.logic))' - message: spec.forProvider.name is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.name) diff --git a/package/crds/openidclient.keycloak.crossplane.io_clientgrouppolicies.yaml b/package/crds/openidclient.keycloak.crossplane.io_clientgrouppolicies.yaml index 33cbf13..a145805 100644 --- a/package/crds/openidclient.keycloak.crossplane.io_clientgrouppolicies.yaml +++ b/package/crds/openidclient.keycloak.crossplane.io_clientgrouppolicies.yaml @@ -614,6 +614,10 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.groups) || (has(self.initProvider) && has(self.initProvider.groups))' + - message: spec.forProvider.logic is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.logic) + || (has(self.initProvider) && has(self.initProvider.logic))' - message: spec.forProvider.name is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.name) diff --git a/package/crds/openidclient.keycloak.crossplane.io_clientrolepolicies.yaml b/package/crds/openidclient.keycloak.crossplane.io_clientrolepolicies.yaml index 181180d..ba0b298 100644 --- a/package/crds/openidclient.keycloak.crossplane.io_clientrolepolicies.yaml +++ b/package/crds/openidclient.keycloak.crossplane.io_clientrolepolicies.yaml @@ -602,6 +602,10 @@ spec: - forProvider type: object x-kubernetes-validations: + - message: spec.forProvider.logic is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.logic) + || (has(self.initProvider) && has(self.initProvider.logic))' - message: spec.forProvider.name is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.name) diff --git a/package/crds/openidclient.keycloak.crossplane.io_clientuserpolicies.yaml b/package/crds/openidclient.keycloak.crossplane.io_clientuserpolicies.yaml index b6a92ed..691b453 100644 --- a/package/crds/openidclient.keycloak.crossplane.io_clientuserpolicies.yaml +++ b/package/crds/openidclient.keycloak.crossplane.io_clientuserpolicies.yaml @@ -594,6 +594,10 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.decisionStrategy) || (has(self.initProvider) && has(self.initProvider.decisionStrategy))' + - message: spec.forProvider.logic is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.logic) + || (has(self.initProvider) && has(self.initProvider.logic))' - message: spec.forProvider.name is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.name)