diff --git a/apis/realm/v1alpha1/zz_generated.deepcopy.go b/apis/realm/v1alpha1/zz_generated.deepcopy.go index 5b1792f..54e8401 100644 --- a/apis/realm/v1alpha1/zz_generated.deepcopy.go +++ b/apis/realm/v1alpha1/zz_generated.deepcopy.go @@ -10,6 +10,7 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -727,6 +728,174 @@ func (in *RealmStatus) DeepCopy() *RealmStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredAction) DeepCopyInto(out *RequiredAction) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredAction. +func (in *RequiredAction) DeepCopy() *RequiredAction { + if in == nil { + return nil + } + out := new(RequiredAction) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RequiredAction) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredActionList) DeepCopyInto(out *RequiredActionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]RequiredAction, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredActionList. +func (in *RequiredActionList) DeepCopy() *RequiredActionList { + if in == nil { + return nil + } + out := new(RequiredActionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RequiredActionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredActionObservation) DeepCopyInto(out *RequiredActionObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredActionObservation. +func (in *RequiredActionObservation) DeepCopy() *RequiredActionObservation { + if in == nil { + return nil + } + out := new(RequiredActionObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredActionParameters) DeepCopyInto(out *RequiredActionParameters) { + *out = *in + if in.Alias != nil { + in, out := &in.Alias, &out.Alias + *out = new(string) + **out = **in + } + if in.DefaultAction != nil { + in, out := &in.DefaultAction, &out.DefaultAction + *out = new(bool) + **out = **in + } + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(float64) + **out = **in + } + if in.RealmID != nil { + in, out := &in.RealmID, &out.RealmID + *out = new(string) + **out = **in + } + if in.RealmIDRef != nil { + in, out := &in.RealmIDRef, &out.RealmIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RealmIDSelector != nil { + in, out := &in.RealmIDSelector, &out.RealmIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredActionParameters. +func (in *RequiredActionParameters) DeepCopy() *RequiredActionParameters { + if in == nil { + return nil + } + out := new(RequiredActionParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredActionSpec) DeepCopyInto(out *RequiredActionSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredActionSpec. +func (in *RequiredActionSpec) DeepCopy() *RequiredActionSpec { + if in == nil { + return nil + } + out := new(RequiredActionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequiredActionStatus) DeepCopyInto(out *RequiredActionStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequiredActionStatus. +func (in *RequiredActionStatus) DeepCopy() *RequiredActionStatus { + if in == nil { + return nil + } + out := new(RequiredActionStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SMTPServerObservation) DeepCopyInto(out *SMTPServerObservation) { *out = *in diff --git a/apis/realm/v1alpha1/zz_generated.managed.go b/apis/realm/v1alpha1/zz_generated.managed.go index f6a13fa..1ae37f4 100644 --- a/apis/realm/v1alpha1/zz_generated.managed.go +++ b/apis/realm/v1alpha1/zz_generated.managed.go @@ -82,3 +82,79 @@ func (mg *Realm) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsT func (mg *Realm) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this RequiredAction. +func (mg *RequiredAction) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this RequiredAction. +func (mg *RequiredAction) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this RequiredAction. +func (mg *RequiredAction) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this RequiredAction. +func (mg *RequiredAction) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this RequiredAction. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *RequiredAction) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this RequiredAction. +func (mg *RequiredAction) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this RequiredAction. +func (mg *RequiredAction) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this RequiredAction. +func (mg *RequiredAction) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this RequiredAction. +func (mg *RequiredAction) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this RequiredAction. +func (mg *RequiredAction) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this RequiredAction. +func (mg *RequiredAction) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this RequiredAction. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *RequiredAction) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this RequiredAction. +func (mg *RequiredAction) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this RequiredAction. +func (mg *RequiredAction) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/realm/v1alpha1/zz_generated.managedlist.go b/apis/realm/v1alpha1/zz_generated.managedlist.go index 267fd32..5fa1732 100644 --- a/apis/realm/v1alpha1/zz_generated.managedlist.go +++ b/apis/realm/v1alpha1/zz_generated.managedlist.go @@ -15,3 +15,12 @@ func (l *RealmList) GetItems() []resource.Managed { } return items } + +// GetItems of this RequiredActionList. +func (l *RequiredActionList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} diff --git a/apis/realm/v1alpha1/zz_generated.resolvers.go b/apis/realm/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..4af84e6 --- /dev/null +++ b/apis/realm/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,39 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this RequiredAction. +func (mg *RequiredAction) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.RealmID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RealmIDRef, + Selector: mg.Spec.ForProvider.RealmIDSelector, + To: reference.To{ + List: &RealmList{}, + Managed: &Realm{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.RealmID") + } + mg.Spec.ForProvider.RealmID = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RealmIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/realm/v1alpha1/zz_generated_terraformed.go b/apis/realm/v1alpha1/zz_generated_terraformed.go index b89f9be..1f82708 100755 --- a/apis/realm/v1alpha1/zz_generated_terraformed.go +++ b/apis/realm/v1alpha1/zz_generated_terraformed.go @@ -86,3 +86,77 @@ func (tr *Realm) LateInitialize(attrs []byte) (bool, error) { func (tr *Realm) GetTerraformSchemaVersion() int { return 0 } + +// GetTerraformResourceType returns Terraform resource type for this RequiredAction +func (mg *RequiredAction) GetTerraformResourceType() string { + return "keycloak_required_action" +} + +// GetConnectionDetailsMapping for this RequiredAction +func (tr *RequiredAction) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this RequiredAction +func (tr *RequiredAction) GetObservation() (map[string]any, error) { + o, err := json.TFParser.Marshal(tr.Status.AtProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(o, &base) +} + +// SetObservation for this RequiredAction +func (tr *RequiredAction) SetObservation(obs map[string]any) error { + p, err := json.TFParser.Marshal(obs) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Status.AtProvider) +} + +// GetID returns ID of underlying Terraform resource of this RequiredAction +func (tr *RequiredAction) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this RequiredAction +func (tr *RequiredAction) GetParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.ForProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// SetParameters for this RequiredAction +func (tr *RequiredAction) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this RequiredAction using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *RequiredAction) LateInitialize(attrs []byte) (bool, error) { + params := &RequiredActionParameters{} + if err := json.TFParser.Unmarshal(attrs, params); err != nil { + return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") + } + opts := []resource.GenericLateInitializerOption{resource.WithZeroValueJSONOmitEmptyFilter(resource.CNameWildcard)} + + li := resource.NewGenericLateInitializer(opts...) + return li.LateInitialize(&tr.Spec.ForProvider, params) +} + +// GetTerraformSchemaVersion returns the associated Terraform schema version +func (tr *RequiredAction) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/realm/v1alpha1/zz_requiredaction_types.go b/apis/realm/v1alpha1/zz_requiredaction_types.go new file mode 100755 index 0000000..0617f63 --- /dev/null +++ b/apis/realm/v1alpha1/zz_requiredaction_types.go @@ -0,0 +1,97 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type RequiredActionObservation struct { + ID *string `json:"id,omitempty" tf:"id,omitempty"` +} + +type RequiredActionParameters struct { + + // +kubebuilder:validation:Required + Alias *string `json:"alias" tf:"alias,omitempty"` + + // +kubebuilder:validation:Optional + DefaultAction *bool `json:"defaultAction,omitempty" tf:"default_action,omitempty"` + + // +kubebuilder:validation:Optional + Enabled *bool `json:"enabled,omitempty" tf:"enabled,omitempty"` + + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // +kubebuilder:validation:Optional + Priority *float64 `json:"priority,omitempty" tf:"priority,omitempty"` + + // +crossplane:generate:reference:type=github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1.Realm + // +kubebuilder:validation:Optional + RealmID *string `json:"realmId,omitempty" tf:"realm_id,omitempty"` + + // Reference to a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDRef *v1.Reference `json:"realmIdRef,omitempty" tf:"-"` + + // Selector for a Realm in realm to populate realmId. + // +kubebuilder:validation:Optional + RealmIDSelector *v1.Selector `json:"realmIdSelector,omitempty" tf:"-"` +} + +// RequiredActionSpec defines the desired state of RequiredAction +type RequiredActionSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider RequiredActionParameters `json:"forProvider"` +} + +// RequiredActionStatus defines the observed state of RequiredAction. +type RequiredActionStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider RequiredActionObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// RequiredAction is the Schema for the RequiredActions API. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,keycloak} +type RequiredAction struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec RequiredActionSpec `json:"spec"` + Status RequiredActionStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// RequiredActionList contains a list of RequiredActions +type RequiredActionList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []RequiredAction `json:"items"` +} + +// Repository type metadata. +var ( + RequiredAction_Kind = "RequiredAction" + RequiredAction_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: RequiredAction_Kind}.String() + RequiredAction_KindAPIVersion = RequiredAction_Kind + "." + CRDGroupVersion.String() + RequiredAction_GroupVersionKind = CRDGroupVersion.WithKind(RequiredAction_Kind) +) + +func init() { + SchemeBuilder.Register(&RequiredAction{}, &RequiredActionList{}) +} diff --git a/config/external_name.go b/config/external_name.go index bb557e5..ec3cd35 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -20,6 +20,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "keycloak_openid_client": config.IdentifierFromProvider, "keycloak_openid_group_membership_protocol_mapper": config.IdentifierFromProvider, "keycloak_realm": config.IdentifierFromProvider, + "keycloak_required_action": config.IdentifierFromProvider, "keycloak_role": config.IdentifierFromProvider, "keycloak_user_groups": config.IdentifierFromProvider, "keycloak_user": config.IdentifierFromProvider, diff --git a/config/realm/config.go b/config/realm/config.go index b1d7d12..483eb03 100644 --- a/config/realm/config.go +++ b/config/realm/config.go @@ -9,4 +9,9 @@ func Configure(p *config.Provider) { // this resource, which would be "github" r.ShortGroup = "realm" }) + + p.AddResourceConfigurator("keycloak_required_action", func(r *config.Resource) { + r.ShortGroup = "realm" + r.Kind = "RequiredAction" + }) } diff --git a/internal/controller/realm/requiredaction/zz_controller.go b/internal/controller/realm/requiredaction/zz_controller.go new file mode 100755 index 0000000..45cd1f0 --- /dev/null +++ b/internal/controller/realm/requiredaction/zz_controller.go @@ -0,0 +1,51 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package requiredaction + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-keycloak/apis/realm/v1alpha1" +) + +// Setup adds a controller that reconciles RequiredAction managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.RequiredAction_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + r := managed.NewReconciler(mgr, + xpresource.ManagedKind(v1alpha1.RequiredAction_GroupVersionKind), + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["keycloak_required_action"], + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.RequiredAction_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3*time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + ) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.RequiredAction{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 5b228fb..1d0b34e 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -20,6 +20,7 @@ import ( groupmembershipprotocolmapper "github.com/crossplane-contrib/provider-keycloak/internal/controller/openidgroup/groupmembershipprotocolmapper" providerconfig "github.com/crossplane-contrib/provider-keycloak/internal/controller/providerconfig" realm "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/realm" + requiredaction "github.com/crossplane-contrib/provider-keycloak/internal/controller/realm/requiredaction" role "github.com/crossplane-contrib/provider-keycloak/internal/controller/role/role" groups "github.com/crossplane-contrib/provider-keycloak/internal/controller/user/groups" user "github.com/crossplane-contrib/provider-keycloak/internal/controller/user/user" @@ -40,6 +41,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { groupmembershipprotocolmapper.Setup, providerconfig.Setup, realm.Setup, + requiredaction.Setup, role.Setup, groups.Setup, user.Setup, diff --git a/package/crds/realm.keycloak.crossplane.io_requiredactions.yaml b/package/crds/realm.keycloak.crossplane.io_requiredactions.yaml new file mode 100644 index 0000000..465d8a5 --- /dev/null +++ b/package/crds/realm.keycloak.crossplane.io_requiredactions.yaml @@ -0,0 +1,403 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.12.1 + name: requiredactions.realm.keycloak.crossplane.io +spec: + group: realm.keycloak.crossplane.io + names: + categories: + - crossplane + - managed + - keycloak + kind: RequiredAction + listKind: RequiredActionList + plural: requiredactions + singular: requiredaction + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: RequiredAction is the Schema for the RequiredActions API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: RequiredActionSpec defines the desired state of RequiredAction + properties: + deletionPolicy: + default: Delete + description: 'DeletionPolicy specifies what will happen to the underlying + external when this managed resource is deleted - either "Delete" + or "Orphan" the external resource. This field is planned to be deprecated + in favor of the ManagementPolicies field in a future release. Currently, + both could be set independently and non-default values would be + honored if the feature flag is enabled. See the design doc for more + information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223' + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + alias: + type: string + defaultAction: + type: boolean + enabled: + type: boolean + name: + type: string + priority: + type: number + realmId: + type: string + realmIdRef: + description: Reference to a Realm in realm to populate realmId. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + realmIdSelector: + description: Selector for a Realm in realm to populate realmId. + properties: + matchControllerRef: + description: MatchControllerRef ensures an object with the + same controller reference as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + required: + - alias + type: object + managementPolicies: + default: + - '*' + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicies + specify the array of actions Crossplane is allowed to take on the + managed and external resources. This field is planned to replace + the DeletionPolicy field in a future release. Currently, both could + be set independently and non-default values would be honored if + the feature flag is enabled. If both are custom, the DeletionPolicy + field will be ignored. See the design doc for more information: + https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md' + items: + description: A ManagementAction represents an action that the Crossplane + controllers can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: RequiredActionStatus defines the observed state of RequiredAction. + properties: + atProvider: + properties: + id: + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}