diff --git a/apis/acl/v1alpha1/zz_generated.conversion_hubs.go b/apis/acl/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..c8168d1 --- /dev/null +++ b/apis/acl/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,10 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *Role) Hub() {} diff --git a/apis/acl/v1alpha1/zz_generated.deepcopy.go b/apis/acl/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..e74588f --- /dev/null +++ b/apis/acl/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,655 @@ +//go:build !ignore_autogenerated + +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeIdentitiesInitParameters) DeepCopyInto(out *NodeIdentitiesInitParameters) { + *out = *in + if in.Datacenter != nil { + in, out := &in.Datacenter, &out.Datacenter + *out = new(string) + **out = **in + } + if in.NodeName != nil { + in, out := &in.NodeName, &out.NodeName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIdentitiesInitParameters. +func (in *NodeIdentitiesInitParameters) DeepCopy() *NodeIdentitiesInitParameters { + if in == nil { + return nil + } + out := new(NodeIdentitiesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeIdentitiesObservation) DeepCopyInto(out *NodeIdentitiesObservation) { + *out = *in + if in.Datacenter != nil { + in, out := &in.Datacenter, &out.Datacenter + *out = new(string) + **out = **in + } + if in.NodeName != nil { + in, out := &in.NodeName, &out.NodeName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIdentitiesObservation. +func (in *NodeIdentitiesObservation) DeepCopy() *NodeIdentitiesObservation { + if in == nil { + return nil + } + out := new(NodeIdentitiesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeIdentitiesParameters) DeepCopyInto(out *NodeIdentitiesParameters) { + *out = *in + if in.Datacenter != nil { + in, out := &in.Datacenter, &out.Datacenter + *out = new(string) + **out = **in + } + if in.NodeName != nil { + in, out := &in.NodeName, &out.NodeName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeIdentitiesParameters. +func (in *NodeIdentitiesParameters) DeepCopy() *NodeIdentitiesParameters { + if in == nil { + return nil + } + out := new(NodeIdentitiesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Role) DeepCopyInto(out *Role) { + *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 Role. +func (in *Role) DeepCopy() *Role { + if in == nil { + return nil + } + out := new(Role) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Role) 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 *RoleInitParameters) DeepCopyInto(out *RoleInitParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(string) + **out = **in + } + if in.NodeIdentities != nil { + in, out := &in.NodeIdentities, &out.NodeIdentities + *out = make([]NodeIdentitiesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Partition != nil { + in, out := &in.Partition, &out.Partition + *out = new(string) + **out = **in + } + if in.Policies != nil { + in, out := &in.Policies, &out.Policies + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ServiceIdentities != nil { + in, out := &in.ServiceIdentities, &out.ServiceIdentities + *out = make([]ServiceIdentitiesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TemplatedPolicies != nil { + in, out := &in.TemplatedPolicies, &out.TemplatedPolicies + *out = make([]TemplatedPoliciesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleInitParameters. +func (in *RoleInitParameters) DeepCopy() *RoleInitParameters { + if in == nil { + return nil + } + out := new(RoleInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleList) DeepCopyInto(out *RoleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Role, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleList. +func (in *RoleList) DeepCopy() *RoleList { + if in == nil { + return nil + } + out := new(RoleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *RoleList) 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 *RoleObservation) DeepCopyInto(out *RoleObservation) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(string) + **out = **in + } + if in.NodeIdentities != nil { + in, out := &in.NodeIdentities, &out.NodeIdentities + *out = make([]NodeIdentitiesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Partition != nil { + in, out := &in.Partition, &out.Partition + *out = new(string) + **out = **in + } + if in.Policies != nil { + in, out := &in.Policies, &out.Policies + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ServiceIdentities != nil { + in, out := &in.ServiceIdentities, &out.ServiceIdentities + *out = make([]ServiceIdentitiesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TemplatedPolicies != nil { + in, out := &in.TemplatedPolicies, &out.TemplatedPolicies + *out = make([]TemplatedPoliciesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleObservation. +func (in *RoleObservation) DeepCopy() *RoleObservation { + if in == nil { + return nil + } + out := new(RoleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleParameters) DeepCopyInto(out *RoleParameters) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Namespace != nil { + in, out := &in.Namespace, &out.Namespace + *out = new(string) + **out = **in + } + if in.NodeIdentities != nil { + in, out := &in.NodeIdentities, &out.NodeIdentities + *out = make([]NodeIdentitiesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Partition != nil { + in, out := &in.Partition, &out.Partition + *out = new(string) + **out = **in + } + if in.Policies != nil { + in, out := &in.Policies, &out.Policies + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ServiceIdentities != nil { + in, out := &in.ServiceIdentities, &out.ServiceIdentities + *out = make([]ServiceIdentitiesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TemplatedPolicies != nil { + in, out := &in.TemplatedPolicies, &out.TemplatedPolicies + *out = make([]TemplatedPoliciesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleParameters. +func (in *RoleParameters) DeepCopy() *RoleParameters { + if in == nil { + return nil + } + out := new(RoleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleSpec) DeepCopyInto(out *RoleSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleSpec. +func (in *RoleSpec) DeepCopy() *RoleSpec { + if in == nil { + return nil + } + out := new(RoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleStatus) DeepCopyInto(out *RoleStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleStatus. +func (in *RoleStatus) DeepCopy() *RoleStatus { + if in == nil { + return nil + } + out := new(RoleStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceIdentitiesInitParameters) DeepCopyInto(out *ServiceIdentitiesInitParameters) { + *out = *in + if in.Datacenters != nil { + in, out := &in.Datacenters, &out.Datacenters + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceIdentitiesInitParameters. +func (in *ServiceIdentitiesInitParameters) DeepCopy() *ServiceIdentitiesInitParameters { + if in == nil { + return nil + } + out := new(ServiceIdentitiesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceIdentitiesObservation) DeepCopyInto(out *ServiceIdentitiesObservation) { + *out = *in + if in.Datacenters != nil { + in, out := &in.Datacenters, &out.Datacenters + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceIdentitiesObservation. +func (in *ServiceIdentitiesObservation) DeepCopy() *ServiceIdentitiesObservation { + if in == nil { + return nil + } + out := new(ServiceIdentitiesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceIdentitiesParameters) DeepCopyInto(out *ServiceIdentitiesParameters) { + *out = *in + if in.Datacenters != nil { + in, out := &in.Datacenters, &out.Datacenters + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.ServiceName != nil { + in, out := &in.ServiceName, &out.ServiceName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceIdentitiesParameters. +func (in *ServiceIdentitiesParameters) DeepCopy() *ServiceIdentitiesParameters { + if in == nil { + return nil + } + out := new(ServiceIdentitiesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateVariablesInitParameters) DeepCopyInto(out *TemplateVariablesInitParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVariablesInitParameters. +func (in *TemplateVariablesInitParameters) DeepCopy() *TemplateVariablesInitParameters { + if in == nil { + return nil + } + out := new(TemplateVariablesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateVariablesObservation) DeepCopyInto(out *TemplateVariablesObservation) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVariablesObservation. +func (in *TemplateVariablesObservation) DeepCopy() *TemplateVariablesObservation { + if in == nil { + return nil + } + out := new(TemplateVariablesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplateVariablesParameters) DeepCopyInto(out *TemplateVariablesParameters) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplateVariablesParameters. +func (in *TemplateVariablesParameters) DeepCopy() *TemplateVariablesParameters { + if in == nil { + return nil + } + out := new(TemplateVariablesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplatedPoliciesInitParameters) DeepCopyInto(out *TemplatedPoliciesInitParameters) { + *out = *in + if in.Datacenters != nil { + in, out := &in.Datacenters, &out.Datacenters + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.TemplateName != nil { + in, out := &in.TemplateName, &out.TemplateName + *out = new(string) + **out = **in + } + if in.TemplateVariables != nil { + in, out := &in.TemplateVariables, &out.TemplateVariables + *out = make([]TemplateVariablesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplatedPoliciesInitParameters. +func (in *TemplatedPoliciesInitParameters) DeepCopy() *TemplatedPoliciesInitParameters { + if in == nil { + return nil + } + out := new(TemplatedPoliciesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplatedPoliciesObservation) DeepCopyInto(out *TemplatedPoliciesObservation) { + *out = *in + if in.Datacenters != nil { + in, out := &in.Datacenters, &out.Datacenters + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.TemplateName != nil { + in, out := &in.TemplateName, &out.TemplateName + *out = new(string) + **out = **in + } + if in.TemplateVariables != nil { + in, out := &in.TemplateVariables, &out.TemplateVariables + *out = make([]TemplateVariablesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplatedPoliciesObservation. +func (in *TemplatedPoliciesObservation) DeepCopy() *TemplatedPoliciesObservation { + if in == nil { + return nil + } + out := new(TemplatedPoliciesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TemplatedPoliciesParameters) DeepCopyInto(out *TemplatedPoliciesParameters) { + *out = *in + if in.Datacenters != nil { + in, out := &in.Datacenters, &out.Datacenters + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.TemplateName != nil { + in, out := &in.TemplateName, &out.TemplateName + *out = new(string) + **out = **in + } + if in.TemplateVariables != nil { + in, out := &in.TemplateVariables, &out.TemplateVariables + *out = make([]TemplateVariablesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TemplatedPoliciesParameters. +func (in *TemplatedPoliciesParameters) DeepCopy() *TemplatedPoliciesParameters { + if in == nil { + return nil + } + out := new(TemplatedPoliciesParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/acl/v1alpha1/zz_generated.managed.go b/apis/acl/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..a253dff --- /dev/null +++ b/apis/acl/v1alpha1/zz_generated.managed.go @@ -0,0 +1,69 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this Role. +func (mg *Role) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Role. +func (mg *Role) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this Role. +func (mg *Role) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this Role. +func (mg *Role) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this Role. +func (mg *Role) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Role. +func (mg *Role) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Role. +func (mg *Role) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Role. +func (mg *Role) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this Role. +func (mg *Role) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this Role. +func (mg *Role) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this Role. +func (mg *Role) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Role. +func (mg *Role) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/acl/v1alpha1/zz_generated.managedlist.go b/apis/acl/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..5df5a36 --- /dev/null +++ b/apis/acl/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this RoleList. +func (l *RoleList) 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/acl/v1alpha1/zz_groupversion_info.go b/apis/acl/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..04b181d --- /dev/null +++ b/apis/acl/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=acl.daanvinken.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "acl.daanvinken.io" + CRDVersion = "v1alpha1" +) + +var ( + // CRDGroupVersion is the API Group Version used to register the objects + CRDGroupVersion = schema.GroupVersion{Group: CRDGroup, Version: CRDVersion} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: CRDGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/acl/v1alpha1/zz_role_terraformed.go b/apis/acl/v1alpha1/zz_role_terraformed.go new file mode 100755 index 0000000..589aa9c --- /dev/null +++ b/apis/acl/v1alpha1/zz_role_terraformed.go @@ -0,0 +1,129 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Role +func (mg *Role) GetTerraformResourceType() string { + return "consul_acl_role" +} + +// GetConnectionDetailsMapping for this Role +func (tr *Role) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Role +func (tr *Role) 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 Role +func (tr *Role) 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 Role +func (tr *Role) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Role +func (tr *Role) 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 Role +func (tr *Role) 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) +} + +// GetInitParameters of this Role +func (tr *Role) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this Role +func (tr *Role) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this Role using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Role) LateInitialize(attrs []byte) (bool, error) { + params := &RoleParameters{} + 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 *Role) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/acl/v1alpha1/zz_role_types.go b/apis/acl/v1alpha1/zz_role_types.go new file mode 100755 index 0000000..83133e2 --- /dev/null +++ b/apis/acl/v1alpha1/zz_role_types.go @@ -0,0 +1,338 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// 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 NodeIdentitiesInitParameters struct { + + // (String) Specifies the node's datacenter. + // Specifies the node's datacenter. + Datacenter *string `json:"datacenter,omitempty" tf:"datacenter,omitempty"` + + // (String) The name of the node. + // The name of the node. + NodeName *string `json:"nodeName,omitempty" tf:"node_name,omitempty"` +} + +type NodeIdentitiesObservation struct { + + // (String) Specifies the node's datacenter. + // Specifies the node's datacenter. + Datacenter *string `json:"datacenter,omitempty" tf:"datacenter,omitempty"` + + // (String) The name of the node. + // The name of the node. + NodeName *string `json:"nodeName,omitempty" tf:"node_name,omitempty"` +} + +type NodeIdentitiesParameters struct { + + // (String) Specifies the node's datacenter. + // Specifies the node's datacenter. + // +kubebuilder:validation:Optional + Datacenter *string `json:"datacenter" tf:"datacenter,omitempty"` + + // (String) The name of the node. + // The name of the node. + // +kubebuilder:validation:Optional + NodeName *string `json:"nodeName" tf:"node_name,omitempty"` +} + +type RoleInitParameters struct { + + // (String) A free form human readable description of the role. + // A free form human readable description of the role. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // (String) The name of the ACL role. + // The name of the ACL role. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // (String) The namespace to create the role within. + // The namespace to create the role within. + Namespace *string `json:"namespace,omitempty" tf:"namespace,omitempty"` + + // (Block List) The list of node identities that should be applied to the role. (see below for nested schema) + // The list of node identities that should be applied to the role. + NodeIdentities []NodeIdentitiesInitParameters `json:"nodeIdentities,omitempty" tf:"node_identities,omitempty"` + + // (String) The partition the ACL role is associated with. + // The partition the ACL role is associated with. + Partition *string `json:"partition,omitempty" tf:"partition,omitempty"` + + // (Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used. + // The list of policies that should be applied to the role. Both the policy ID or its name can be used. + // +listType=set + Policies []*string `json:"policies,omitempty" tf:"policies,omitempty"` + + // (Block Set) The list of service identities that should be applied to the role. (see below for nested schema) + // The list of service identities that should be applied to the role. + ServiceIdentities []ServiceIdentitiesInitParameters `json:"serviceIdentities,omitempty" tf:"service_identities,omitempty"` + + // (Block List) The list of templated policies that should be applied to the token. (see below for nested schema) + // The list of templated policies that should be applied to the token. + TemplatedPolicies []TemplatedPoliciesInitParameters `json:"templatedPolicies,omitempty" tf:"templated_policies,omitempty"` +} + +type RoleObservation struct { + + // (String) A free form human readable description of the role. + // A free form human readable description of the role. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // (String) The ID of this resource. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // (String) The name of the ACL role. + // The name of the ACL role. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // (String) The namespace to create the role within. + // The namespace to create the role within. + Namespace *string `json:"namespace,omitempty" tf:"namespace,omitempty"` + + // (Block List) The list of node identities that should be applied to the role. (see below for nested schema) + // The list of node identities that should be applied to the role. + NodeIdentities []NodeIdentitiesObservation `json:"nodeIdentities,omitempty" tf:"node_identities,omitempty"` + + // (String) The partition the ACL role is associated with. + // The partition the ACL role is associated with. + Partition *string `json:"partition,omitempty" tf:"partition,omitempty"` + + // (Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used. + // The list of policies that should be applied to the role. Both the policy ID or its name can be used. + // +listType=set + Policies []*string `json:"policies,omitempty" tf:"policies,omitempty"` + + // (Block Set) The list of service identities that should be applied to the role. (see below for nested schema) + // The list of service identities that should be applied to the role. + ServiceIdentities []ServiceIdentitiesObservation `json:"serviceIdentities,omitempty" tf:"service_identities,omitempty"` + + // (Block List) The list of templated policies that should be applied to the token. (see below for nested schema) + // The list of templated policies that should be applied to the token. + TemplatedPolicies []TemplatedPoliciesObservation `json:"templatedPolicies,omitempty" tf:"templated_policies,omitempty"` +} + +type RoleParameters struct { + + // (String) A free form human readable description of the role. + // A free form human readable description of the role. + // +kubebuilder:validation:Optional + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // (String) The name of the ACL role. + // The name of the ACL role. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // (String) The namespace to create the role within. + // The namespace to create the role within. + // +kubebuilder:validation:Optional + Namespace *string `json:"namespace,omitempty" tf:"namespace,omitempty"` + + // (Block List) The list of node identities that should be applied to the role. (see below for nested schema) + // The list of node identities that should be applied to the role. + // +kubebuilder:validation:Optional + NodeIdentities []NodeIdentitiesParameters `json:"nodeIdentities,omitempty" tf:"node_identities,omitempty"` + + // (String) The partition the ACL role is associated with. + // The partition the ACL role is associated with. + // +kubebuilder:validation:Optional + Partition *string `json:"partition,omitempty" tf:"partition,omitempty"` + + // (Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used. + // The list of policies that should be applied to the role. Both the policy ID or its name can be used. + // +kubebuilder:validation:Optional + // +listType=set + Policies []*string `json:"policies,omitempty" tf:"policies,omitempty"` + + // (Block Set) The list of service identities that should be applied to the role. (see below for nested schema) + // The list of service identities that should be applied to the role. + // +kubebuilder:validation:Optional + ServiceIdentities []ServiceIdentitiesParameters `json:"serviceIdentities,omitempty" tf:"service_identities,omitempty"` + + // (Block List) The list of templated policies that should be applied to the token. (see below for nested schema) + // The list of templated policies that should be applied to the token. + // +kubebuilder:validation:Optional + TemplatedPolicies []TemplatedPoliciesParameters `json:"templatedPolicies,omitempty" tf:"templated_policies,omitempty"` +} + +type ServiceIdentitiesInitParameters struct { + + // (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // +listType=set + Datacenters []*string `json:"datacenters,omitempty" tf:"datacenters,omitempty"` + + // (String) The name of the service. + // The name of the service. + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` +} + +type ServiceIdentitiesObservation struct { + + // (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // +listType=set + Datacenters []*string `json:"datacenters,omitempty" tf:"datacenters,omitempty"` + + // (String) The name of the service. + // The name of the service. + ServiceName *string `json:"serviceName,omitempty" tf:"service_name,omitempty"` +} + +type ServiceIdentitiesParameters struct { + + // (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // +kubebuilder:validation:Optional + // +listType=set + Datacenters []*string `json:"datacenters,omitempty" tf:"datacenters,omitempty"` + + // (String) The name of the service. + // The name of the service. + // +kubebuilder:validation:Optional + ServiceName *string `json:"serviceName" tf:"service_name,omitempty"` +} + +type TemplateVariablesInitParameters struct { + + // (String) The name of the ACL role. + // The name of node, workload identity or service. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type TemplateVariablesObservation struct { + + // (String) The name of the ACL role. + // The name of node, workload identity or service. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type TemplateVariablesParameters struct { + + // (String) The name of the ACL role. + // The name of node, workload identity or service. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type TemplatedPoliciesInitParameters struct { + + // (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // Specifies the datacenters the effective policy is valid within. + Datacenters []*string `json:"datacenters,omitempty" tf:"datacenters,omitempty"` + + // (String) The name of the templated policies. + // The name of the templated policies. + TemplateName *string `json:"templateName,omitempty" tf:"template_name,omitempty"` + + // (Block List, Max: 1) The templated policy variables. (see below for nested schema) + // The templated policy variables. + TemplateVariables []TemplateVariablesInitParameters `json:"templateVariables,omitempty" tf:"template_variables,omitempty"` +} + +type TemplatedPoliciesObservation struct { + + // (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // Specifies the datacenters the effective policy is valid within. + Datacenters []*string `json:"datacenters,omitempty" tf:"datacenters,omitempty"` + + // (String) The name of the templated policies. + // The name of the templated policies. + TemplateName *string `json:"templateName,omitempty" tf:"template_name,omitempty"` + + // (Block List, Max: 1) The templated policy variables. (see below for nested schema) + // The templated policy variables. + TemplateVariables []TemplateVariablesObservation `json:"templateVariables,omitempty" tf:"template_variables,omitempty"` +} + +type TemplatedPoliciesParameters struct { + + // (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + // Specifies the datacenters the effective policy is valid within. + // +kubebuilder:validation:Optional + Datacenters []*string `json:"datacenters,omitempty" tf:"datacenters,omitempty"` + + // (String) The name of the templated policies. + // The name of the templated policies. + // +kubebuilder:validation:Optional + TemplateName *string `json:"templateName" tf:"template_name,omitempty"` + + // (Block List, Max: 1) The templated policy variables. (see below for nested schema) + // The templated policy variables. + // +kubebuilder:validation:Optional + TemplateVariables []TemplateVariablesParameters `json:"templateVariables,omitempty" tf:"template_variables,omitempty"` +} + +// RoleSpec defines the desired state of Role +type RoleSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider RoleParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider RoleInitParameters `json:"initProvider,omitempty"` +} + +// RoleStatus defines the observed state of Role. +type RoleStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider RoleObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// Role is the Schema for the Roles API. The consul_acl_role can be used to manage Consul ACL roles https://developer.hashicorp.com/consul/docs/security/acl/acl-roles. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].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:resource:scope=Cluster,categories={crossplane,managed,consul} +type Role 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.name) || (has(self.initProvider) && has(self.initProvider.name))",message="spec.forProvider.name is a required parameter" + Spec RoleSpec `json:"spec"` + Status RoleStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// RoleList contains a list of Roles +type RoleList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Role `json:"items"` +} + +// Repository type metadata. +var ( + Role_Kind = "Role" + Role_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Role_Kind}.String() + Role_KindAPIVersion = Role_Kind + "." + CRDGroupVersion.String() + Role_GroupVersionKind = CRDGroupVersion.WithKind(Role_Kind) +) + +func init() { + SchemeBuilder.Register(&Role{}, &RoleList{}) +} diff --git a/apis/v1alpha1/zz_generated.deepcopy.go b/apis/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..d22189d --- /dev/null +++ b/apis/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,104 @@ +//go:build !ignore_autogenerated + +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StoreConfig) DeepCopyInto(out *StoreConfig) { + *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 StoreConfig. +func (in *StoreConfig) DeepCopy() *StoreConfig { + if in == nil { + return nil + } + out := new(StoreConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StoreConfig) 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 *StoreConfigList) DeepCopyInto(out *StoreConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]StoreConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreConfigList. +func (in *StoreConfigList) DeepCopy() *StoreConfigList { + if in == nil { + return nil + } + out := new(StoreConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StoreConfigList) 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 *StoreConfigSpec) DeepCopyInto(out *StoreConfigSpec) { + *out = *in + in.SecretStoreConfig.DeepCopyInto(&out.SecretStoreConfig) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreConfigSpec. +func (in *StoreConfigSpec) DeepCopy() *StoreConfigSpec { + if in == nil { + return nil + } + out := new(StoreConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StoreConfigStatus) DeepCopyInto(out *StoreConfigStatus) { + *out = *in + in.ConditionedStatus.DeepCopyInto(&out.ConditionedStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreConfigStatus. +func (in *StoreConfigStatus) DeepCopy() *StoreConfigStatus { + if in == nil { + return nil + } + out := new(StoreConfigStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/v1beta1/zz_generated.deepcopy.go b/apis/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000..40fe57c --- /dev/null +++ b/apis/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,178 @@ +//go:build !ignore_autogenerated + +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProviderConfig) DeepCopyInto(out *ProviderConfig) { + *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 ProviderConfig. +func (in *ProviderConfig) DeepCopy() *ProviderConfig { + if in == nil { + return nil + } + out := new(ProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProviderConfig) 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 *ProviderConfigList) DeepCopyInto(out *ProviderConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProviderConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigList. +func (in *ProviderConfigList) DeepCopy() *ProviderConfigList { + if in == nil { + return nil + } + out := new(ProviderConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProviderConfigList) 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 *ProviderConfigSpec) DeepCopyInto(out *ProviderConfigSpec) { + *out = *in + in.Credentials.DeepCopyInto(&out.Credentials) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigSpec. +func (in *ProviderConfigSpec) DeepCopy() *ProviderConfigSpec { + if in == nil { + return nil + } + out := new(ProviderConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProviderConfigStatus) DeepCopyInto(out *ProviderConfigStatus) { + *out = *in + in.ProviderConfigStatus.DeepCopyInto(&out.ProviderConfigStatus) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigStatus. +func (in *ProviderConfigStatus) DeepCopy() *ProviderConfigStatus { + if in == nil { + return nil + } + out := new(ProviderConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProviderConfigUsage) DeepCopyInto(out *ProviderConfigUsage) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.ProviderConfigUsage.DeepCopyInto(&out.ProviderConfigUsage) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigUsage. +func (in *ProviderConfigUsage) DeepCopy() *ProviderConfigUsage { + if in == nil { + return nil + } + out := new(ProviderConfigUsage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProviderConfigUsage) 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 *ProviderConfigUsageList) DeepCopyInto(out *ProviderConfigUsageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ProviderConfigUsage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderConfigUsageList. +func (in *ProviderConfigUsageList) DeepCopy() *ProviderConfigUsageList { + if in == nil { + return nil + } + out := new(ProviderConfigUsageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ProviderConfigUsageList) 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 *ProviderCredentials) DeepCopyInto(out *ProviderCredentials) { + *out = *in + in.CommonCredentialSelectors.DeepCopyInto(&out.CommonCredentialSelectors) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProviderCredentials. +func (in *ProviderCredentials) DeepCopy() *ProviderCredentials { + if in == nil { + return nil + } + out := new(ProviderCredentials) + in.DeepCopyInto(out) + return out +} diff --git a/apis/v1beta1/zz_generated.pc.go b/apis/v1beta1/zz_generated.pc.go new file mode 100644 index 0000000..216387b --- /dev/null +++ b/apis/v1beta1/zz_generated.pc.go @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1beta1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this ProviderConfig. +func (p *ProviderConfig) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return p.Status.GetCondition(ct) +} + +// GetUsers of this ProviderConfig. +func (p *ProviderConfig) GetUsers() int64 { + return p.Status.Users +} + +// SetConditions of this ProviderConfig. +func (p *ProviderConfig) SetConditions(c ...xpv1.Condition) { + p.Status.SetConditions(c...) +} + +// SetUsers of this ProviderConfig. +func (p *ProviderConfig) SetUsers(i int64) { + p.Status.Users = i +} diff --git a/apis/v1beta1/zz_generated.pcu.go b/apis/v1beta1/zz_generated.pcu.go new file mode 100644 index 0000000..b8a6d3d --- /dev/null +++ b/apis/v1beta1/zz_generated.pcu.go @@ -0,0 +1,29 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1beta1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetProviderConfigReference of this ProviderConfigUsage. +func (p *ProviderConfigUsage) GetProviderConfigReference() xpv1.Reference { + return p.ProviderConfigReference +} + +// GetResourceReference of this ProviderConfigUsage. +func (p *ProviderConfigUsage) GetResourceReference() xpv1.TypedReference { + return p.ResourceReference +} + +// SetProviderConfigReference of this ProviderConfigUsage. +func (p *ProviderConfigUsage) SetProviderConfigReference(r xpv1.Reference) { + p.ProviderConfigReference = r +} + +// SetResourceReference of this ProviderConfigUsage. +func (p *ProviderConfigUsage) SetResourceReference(r xpv1.TypedReference) { + p.ResourceReference = r +} diff --git a/apis/v1beta1/zz_generated.pculist.go b/apis/v1beta1/zz_generated.pculist.go new file mode 100644 index 0000000..87925c4 --- /dev/null +++ b/apis/v1beta1/zz_generated.pculist.go @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by angryjet. DO NOT EDIT. + +package v1beta1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this ProviderConfigUsageList. +func (p *ProviderConfigUsageList) GetItems() []resource.ProviderConfigUsage { + items := make([]resource.ProviderConfigUsage, len(p.Items)) + for i := range p.Items { + items[i] = &p.Items[i] + } + return items +} diff --git a/apis/zz_register.go b/apis/zz_register.go new file mode 100755 index 0000000..d238c12 --- /dev/null +++ b/apis/zz_register.go @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +// Package apis contains Kubernetes API for the provider. +package apis + +import ( + "k8s.io/apimachinery/pkg/runtime" + + v1alpha1 "github.com/daanvinken/provider-consul/apis/acl/v1alpha1" + v1alpha1apis "github.com/daanvinken/provider-consul/apis/v1alpha1" + v1beta1 "github.com/daanvinken/provider-consul/apis/v1beta1" +) + +func init() { + // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back + AddToSchemes = append(AddToSchemes, + v1alpha1.SchemeBuilder.AddToScheme, + v1alpha1apis.SchemeBuilder.AddToScheme, + v1beta1.SchemeBuilder.AddToScheme, + ) +} + +// AddToSchemes may be used to add all resources defined in the project to a Scheme +var AddToSchemes runtime.SchemeBuilder + +// AddToScheme adds all Resources to the Scheme +func AddToScheme(s *runtime.Scheme) error { + return AddToSchemes.AddToScheme(s) +} diff --git a/examples-generated/acl/v1alpha1/role.yaml b/examples-generated/acl/v1alpha1/role.yaml new file mode 100644 index 0000000..9ce13f6 --- /dev/null +++ b/examples-generated/acl/v1alpha1/role.yaml @@ -0,0 +1,16 @@ +apiVersion: acl.daanvinken.io/v1alpha1 +kind: Role +metadata: + annotations: + meta.upbound.io/example-id: acl/v1alpha1/role + labels: + testing.upbound.io/example-name: read + name: read +spec: + forProvider: + description: bar + name: foo + policies: + - ${consul_acl_policy.read-policy.id} + serviceIdentities: + - serviceName: foo diff --git a/examples-generated/null/v1alpha1/resource.yaml b/examples-generated/null/v1alpha1/resource.yaml deleted file mode 100644 index 2c0d175..0000000 --- a/examples-generated/null/v1alpha1/resource.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: null.template.upbound.io/v1alpha1 -kind: Resource -metadata: - annotations: - meta.upbound.io/example-id: null/v1alpha1/resource - labels: - testing.upbound.io/example-name: cluster - name: cluster -spec: - forProvider: - connection: - - host: ${element(aws_instance.cluster[*].public_ip, 0)} - provisioner: - remote-exec: - - inline: - - |- - bootstrap-cluster.sh ${join(" ", - aws_instance.cluster[*].private_ip)} - triggers: - cluster_instance_ids: ${join(",", aws_instance.cluster[*].id)} diff --git a/internal/controller/acl/role/zz_controller.go b/internal/controller/acl/role/zz_controller.go new file mode 100755 index 0000000..5e1c678 --- /dev/null +++ b/internal/controller/acl/role/zz_controller.go @@ -0,0 +1,87 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by upjet. DO NOT EDIT. + +package role + +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" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/terraform" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/daanvinken/provider-consul/apis/acl/v1alpha1" + features "github.com/daanvinken/provider-consul/internal/features" +) + +// Setup adds a controller that reconciles Role managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Role_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, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.Role_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Role_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["consul_acl_role"], tjcontroller.WithLogger(o.Logger), tjcontroller.WithConnectorEventHandler(eventHandler), + tjcontroller.WithCallbackProvider(ac), + )), + 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), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.Role + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.Role{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.Role") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.RoleList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.RoleList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Role_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.Role{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go new file mode 100755 index 0000000..0835c47 --- /dev/null +++ b/internal/controller/zz_setup.go @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: 2024 The Crossplane Authors +// +// SPDX-License-Identifier: Apache-2.0 + +package controller + +import ( + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/crossplane/upjet/pkg/controller" + + role "github.com/daanvinken/provider-consul/internal/controller/acl/role" + providerconfig "github.com/daanvinken/provider-consul/internal/controller/providerconfig" +) + +// Setup creates all controllers with the supplied logger and adds them to +// the supplied manager. +func Setup(mgr ctrl.Manager, o controller.Options) error { + for _, setup := range []func(ctrl.Manager, controller.Options) error{ + role.Setup, + providerconfig.Setup, + } { + if err := setup(mgr, o); err != nil { + return err + } + } + return nil +} diff --git a/package/crds/acl.daanvinken.io_roles.yaml b/package/crds/acl.daanvinken.io_roles.yaml new file mode 100644 index 0000000..dcbb96f --- /dev/null +++ b/package/crds/acl.daanvinken.io_roles.yaml @@ -0,0 +1,632 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: roles.acl.daanvinken.io +spec: + group: acl.daanvinken.io + names: + categories: + - crossplane + - managed + - consul + kind: Role + listKind: RoleList + plural: roles + singular: role + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + 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: Role is the Schema for the Roles API. The consul_acl_role can + be used to manage Consul ACL roles https://developer.hashicorp.com/consul/docs/security/acl/acl-roles. + 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: RoleSpec defines the desired state of Role + 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: + description: + description: |- + (String) A free form human readable description of the role. + A free form human readable description of the role. + type: string + name: + description: |- + (String) The name of the ACL role. + The name of the ACL role. + type: string + namespace: + description: |- + (String) The namespace to create the role within. + The namespace to create the role within. + type: string + nodeIdentities: + description: |- + (Block List) The list of node identities that should be applied to the role. (see below for nested schema) + The list of node identities that should be applied to the role. + items: + properties: + datacenter: + description: |- + (String) Specifies the node's datacenter. + Specifies the node's datacenter. + type: string + nodeName: + description: |- + (String) The name of the node. + The name of the node. + type: string + type: object + type: array + partition: + description: |- + (String) The partition the ACL role is associated with. + The partition the ACL role is associated with. + type: string + policies: + description: |- + (Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used. + The list of policies that should be applied to the role. Both the policy ID or its name can be used. + items: + type: string + type: array + x-kubernetes-list-type: set + serviceIdentities: + description: |- + (Block Set) The list of service identities that should be applied to the role. (see below for nested schema) + The list of service identities that should be applied to the role. + items: + properties: + datacenters: + description: |- + (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + items: + type: string + type: array + x-kubernetes-list-type: set + serviceName: + description: |- + (String) The name of the service. + The name of the service. + type: string + type: object + type: array + templatedPolicies: + description: |- + (Block List) The list of templated policies that should be applied to the token. (see below for nested schema) + The list of templated policies that should be applied to the token. + items: + properties: + datacenters: + description: |- + (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + Specifies the datacenters the effective policy is valid within. + items: + type: string + type: array + templateName: + description: |- + (String) The name of the templated policies. + The name of the templated policies. + type: string + templateVariables: + description: |- + (Block List, Max: 1) The templated policy variables. (see below for nested schema) + The templated policy variables. + items: + properties: + name: + description: |- + (String) The name of the ACL role. + The name of node, workload identity or service. + type: string + type: object + type: array + type: object + type: array + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + description: + description: |- + (String) A free form human readable description of the role. + A free form human readable description of the role. + type: string + name: + description: |- + (String) The name of the ACL role. + The name of the ACL role. + type: string + namespace: + description: |- + (String) The namespace to create the role within. + The namespace to create the role within. + type: string + nodeIdentities: + description: |- + (Block List) The list of node identities that should be applied to the role. (see below for nested schema) + The list of node identities that should be applied to the role. + items: + properties: + datacenter: + description: |- + (String) Specifies the node's datacenter. + Specifies the node's datacenter. + type: string + nodeName: + description: |- + (String) The name of the node. + The name of the node. + type: string + type: object + type: array + partition: + description: |- + (String) The partition the ACL role is associated with. + The partition the ACL role is associated with. + type: string + policies: + description: |- + (Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used. + The list of policies that should be applied to the role. Both the policy ID or its name can be used. + items: + type: string + type: array + x-kubernetes-list-type: set + serviceIdentities: + description: |- + (Block Set) The list of service identities that should be applied to the role. (see below for nested schema) + The list of service identities that should be applied to the role. + items: + properties: + datacenters: + description: |- + (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + items: + type: string + type: array + x-kubernetes-list-type: set + serviceName: + description: |- + (String) The name of the service. + The name of the service. + type: string + type: object + type: array + templatedPolicies: + description: |- + (Block List) The list of templated policies that should be applied to the token. (see below for nested schema) + The list of templated policies that should be applied to the token. + items: + properties: + datacenters: + description: |- + (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + Specifies the datacenters the effective policy is valid within. + items: + type: string + type: array + templateName: + description: |- + (String) The name of the templated policies. + The name of the templated policies. + type: string + templateVariables: + description: |- + (Block List, Max: 1) The templated policy variables. (see below for nested schema) + The templated policy variables. + items: + properties: + name: + description: |- + (String) The name of the ACL role. + The name of node, workload identity or service. + type: string + type: object + type: array + type: object + type: array + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + 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 + 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 + x-kubernetes-validations: + - message: spec.forProvider.name is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.name) + || (has(self.initProvider) && has(self.initProvider.name))' + status: + description: RoleStatus defines the observed state of Role. + properties: + atProvider: + properties: + description: + description: |- + (String) A free form human readable description of the role. + A free form human readable description of the role. + type: string + id: + description: (String) The ID of this resource. + type: string + name: + description: |- + (String) The name of the ACL role. + The name of the ACL role. + type: string + namespace: + description: |- + (String) The namespace to create the role within. + The namespace to create the role within. + type: string + nodeIdentities: + description: |- + (Block List) The list of node identities that should be applied to the role. (see below for nested schema) + The list of node identities that should be applied to the role. + items: + properties: + datacenter: + description: |- + (String) Specifies the node's datacenter. + Specifies the node's datacenter. + type: string + nodeName: + description: |- + (String) The name of the node. + The name of the node. + type: string + type: object + type: array + partition: + description: |- + (String) The partition the ACL role is associated with. + The partition the ACL role is associated with. + type: string + policies: + description: |- + (Set of String) The list of policies that should be applied to the role. Both the policy ID or its name can be used. + The list of policies that should be applied to the role. Both the policy ID or its name can be used. + items: + type: string + type: array + x-kubernetes-list-type: set + serviceIdentities: + description: |- + (Block Set) The list of service identities that should be applied to the role. (see below for nested schema) + The list of service identities that should be applied to the role. + items: + properties: + datacenters: + description: |- + (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + items: + type: string + type: array + x-kubernetes-list-type: set + serviceName: + description: |- + (String) The name of the service. + The name of the service. + type: string + type: object + type: array + templatedPolicies: + description: |- + (Block List) The list of templated policies that should be applied to the token. (see below for nested schema) + The list of templated policies that should be applied to the token. + items: + properties: + datacenters: + description: |- + (Set of String) The datacenters the effective policy is valid within. When no datacenters are provided the effective policy is valid in all datacenters including those which do not yet exist but may in the future. + Specifies the datacenters the effective policy is valid within. + items: + type: string + type: array + templateName: + description: |- + (String) The name of the templated policies. + The name of the templated policies. + type: string + templateVariables: + description: |- + (Block List, Max: 1) The templated policy variables. (see below for nested schema) + The templated policy variables. + items: + properties: + name: + description: |- + (String) The name of the ACL role. + The name of node, workload identity or service. + type: string + type: object + type: array + type: object + type: array + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/consul.daanvinken.io_providerconfigs.yaml b/package/crds/consul.daanvinken.io_providerconfigs.yaml new file mode 100644 index 0000000..3dcfc6c --- /dev/null +++ b/package/crds/consul.daanvinken.io_providerconfigs.yaml @@ -0,0 +1,173 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: providerconfigs.consul.daanvinken.io +spec: + group: consul.daanvinken.io + names: + categories: + - crossplane + - provider + - consul + kind: ProviderConfig + listKind: ProviderConfigList + plural: providerconfigs + singular: providerconfig + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .spec.credentials.secretRef.name + name: SECRET-NAME + priority: 1 + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: A ProviderConfig configures a Consul provider. + 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: A ProviderConfigSpec defines the desired state of a ProviderConfig. + properties: + credentials: + description: Credentials required to authenticate to this provider. + properties: + env: + description: |- + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + properties: + name: + description: Name is the name of an environment variable. + type: string + required: + - name + type: object + fs: + description: |- + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + properties: + path: + description: Path is a filesystem path. + type: string + required: + - path + type: object + secretRef: + description: |- + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object + source: + description: Source of the provider credentials. + enum: + - None + - Secret + - InjectedIdentity + - Environment + - Filesystem + type: string + required: + - source + type: object + required: + - credentials + type: object + status: + description: A ProviderConfigStatus reflects the observed state of a ProviderConfig. + properties: + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + users: + description: Users of this provider configuration. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/consul.daanvinken.io_providerconfigusages.yaml b/package/crds/consul.daanvinken.io_providerconfigusages.yaml new file mode 100644 index 0000000..f243fb6 --- /dev/null +++ b/package/crds/consul.daanvinken.io_providerconfigusages.yaml @@ -0,0 +1,117 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: providerconfigusages.consul.daanvinken.io +spec: + group: consul.daanvinken.io + names: + categories: + - crossplane + - provider + - consul + kind: ProviderConfigUsage + listKind: ProviderConfigUsageList + plural: providerconfigusages + singular: providerconfigusage + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .providerConfigRef.name + name: CONFIG-NAME + type: string + - jsonPath: .resourceRef.kind + name: RESOURCE-KIND + type: string + - jsonPath: .resourceRef.name + name: RESOURCE-NAME + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: A ProviderConfigUsage indicates that a resource is using a ProviderConfig. + 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 + providerConfigRef: + description: ProviderConfigReference to the provider config being used. + 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 + resourceRef: + description: ResourceReference to the managed resource using the provider + config. + properties: + apiVersion: + description: APIVersion of the referenced object. + type: string + kind: + description: Kind of the referenced object. + type: string + name: + description: Name of the referenced object. + type: string + uid: + description: UID of the referenced object. + type: string + required: + - apiVersion + - kind + - name + type: object + required: + - providerConfigRef + - resourceRef + type: object + served: true + storage: true + subresources: {} diff --git a/package/crds/consul.daanvinken.io_storeconfigs.yaml b/package/crds/consul.daanvinken.io_storeconfigs.yaml new file mode 100644 index 0000000..fd4b208 --- /dev/null +++ b/package/crds/consul.daanvinken.io_storeconfigs.yaml @@ -0,0 +1,223 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: storeconfigs.consul.daanvinken.io +spec: + group: consul.daanvinken.io + names: + categories: + - crossplane + - store + - consul + kind: StoreConfig + listKind: StoreConfigList + plural: storeconfigs + singular: storeconfig + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + - jsonPath: .spec.type + name: TYPE + type: string + - jsonPath: .spec.defaultScope + name: DEFAULT-SCOPE + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: A StoreConfig configures how consul controller should store connection + details. + 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: A StoreConfigSpec defines the desired state of a ProviderConfig. + properties: + defaultScope: + description: |- + DefaultScope used for scoping secrets for "cluster-scoped" resources. + If store type is "Kubernetes", this would mean the default namespace to + store connection secrets for cluster scoped resources. + In case of "Vault", this would be used as the default parent path. + Typically, should be set as Crossplane installation namespace. + type: string + kubernetes: + description: |- + Kubernetes configures a Kubernetes secret store. + If the "type" is "Kubernetes" but no config provided, in cluster config + will be used. + properties: + auth: + description: Credentials used to connect to the Kubernetes API. + properties: + env: + description: |- + Env is a reference to an environment variable that contains credentials + that must be used to connect to the provider. + properties: + name: + description: Name is the name of an environment variable. + type: string + required: + - name + type: object + fs: + description: |- + Fs is a reference to a filesystem location that contains credentials that + must be used to connect to the provider. + properties: + path: + description: Path is a filesystem path. + type: string + required: + - path + type: object + secretRef: + description: |- + A SecretRef is a reference to a secret key that contains the credentials + that must be used to connect to the provider. + properties: + key: + description: The key to select. + type: string + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - key + - name + - namespace + type: object + source: + description: Source of the credentials. + enum: + - None + - Secret + - Environment + - Filesystem + type: string + required: + - source + type: object + required: + - auth + type: object + plugin: + description: Plugin configures External secret store as a plugin. + properties: + configRef: + description: ConfigRef contains store config reference info. + properties: + apiVersion: + description: APIVersion of the referenced config. + type: string + kind: + description: Kind of the referenced config. + type: string + name: + description: Name of the referenced config. + type: string + required: + - apiVersion + - kind + - name + type: object + endpoint: + description: Endpoint is the endpoint of the gRPC server. + type: string + type: object + type: + default: Kubernetes + description: |- + Type configures which secret store to be used. Only the configuration + block for this store will be used and others will be ignored if provided. + Default is Kubernetes. + enum: + - Kubernetes + - Vault + - Plugin + type: string + required: + - defaultScope + type: object + status: + description: A StoreConfigStatus represents the status of a StoreConfig. + properties: + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + 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 + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}