From 4aa5eab332541556eb1b85d00a7bf19cefbf96e3 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Thu, 13 Jul 2023 17:28:45 -0400 Subject: [PATCH 01/13] generate instance resource --- Makefile | 10 +- apis/vultr/v1alpha1/zz_generated.deepcopy.go | 566 ++++++++++++++++ apis/vultr/v1alpha1/zz_generated.managed.go | 76 +++ .../v1alpha1/zz_generated.managedlist.go | 9 + .../v1alpha1/zz_generated_terraformed.go | 74 +++ apis/vultr/v1alpha1/zz_instance_types.go | 318 +++++++++ config/external_name.go | 1 + config/instance/config.go | 8 + config/provider-metadata.yaml | 171 +++++ config/provider.go | 2 + examples-generated/vultr/instance.yaml | 16 + examples/providerconfig/providerconfig.yaml | 2 +- examples/providerconfig/secret.yaml.tmpl | 5 +- .../vultr/instance/zz_controller.go | 56 ++ internal/controller/zz_setup.go | 2 + .../vultr.vultr.upbound.io_instances.yaml | 614 ++++++++++++++++++ 16 files changed, 1921 insertions(+), 9 deletions(-) create mode 100755 apis/vultr/v1alpha1/zz_instance_types.go create mode 100644 config/instance/config.go create mode 100644 examples-generated/vultr/instance.yaml create mode 100755 internal/controller/vultr/instance/zz_controller.go create mode 100644 package/crds/vultr.vultr.upbound.io_instances.yaml diff --git a/Makefile b/Makefile index df9cd23..7a33c50 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,9 @@ export TERRAFORM_VERSION ?= 1.3.3 export TERRAFORM_PROVIDER_SOURCE ?= vultr/vultr export TERRAFORM_PROVIDER_REPO ?= https://github.com/vultr/terraform-provider-vultr -export TERRAFORM_PROVIDER_VERSION ?= 2.15.0 +export TERRAFORM_PROVIDER_VERSION ?= 2.15.1 export TERRAFORM_PROVIDER_DOWNLOAD_NAME ?= terraform-provider-vultr -export TERRAFORM_NATIVE_PROVIDER_BINARY ?= terraform-provider-vultr_2.15.0 +export TERRAFORM_NATIVE_PROVIDER_BINARY ?= terraform-provider-vultr_2.15.1 export TERRAFORM_DOCS_PATH ?= website/docs/r PLATFORMS ?= linux_amd64 linux_arm64 @@ -49,9 +49,9 @@ GO_SUBDIRS += cmd internal apis # Setup Kubernetes tools KIND_VERSION = v0.15.0 -UP_VERSION = v0.14.0 +UP_VERSION = v0.18.0 UP_CHANNEL = stable -UPTEST_VERSION = v0.2.1 +UPTEST_VERSION = v0.5.0 -include build/makelib/k8s_tools.mk # ==================================================================================== @@ -198,4 +198,4 @@ crossplane.help: help-special: crossplane.help -.PHONY: crossplane.help help-special +.PHONY: crossplane.help help-special \ No newline at end of file diff --git a/apis/vultr/v1alpha1/zz_generated.deepcopy.go b/apis/vultr/v1alpha1/zz_generated.deepcopy.go index f66f1d4..68e902e 100644 --- a/apis/vultr/v1alpha1/zz_generated.deepcopy.go +++ b/apis/vultr/v1alpha1/zz_generated.deepcopy.go @@ -13,6 +13,572 @@ 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 *BackupsScheduleObservation) DeepCopyInto(out *BackupsScheduleObservation) { + *out = *in + if in.Dom != nil { + in, out := &in.Dom, &out.Dom + *out = new(float64) + **out = **in + } + if in.Dow != nil { + in, out := &in.Dow, &out.Dow + *out = new(float64) + **out = **in + } + if in.Hour != nil { + in, out := &in.Hour, &out.Hour + *out = new(float64) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupsScheduleObservation. +func (in *BackupsScheduleObservation) DeepCopy() *BackupsScheduleObservation { + if in == nil { + return nil + } + out := new(BackupsScheduleObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BackupsScheduleParameters) DeepCopyInto(out *BackupsScheduleParameters) { + *out = *in + if in.Dom != nil { + in, out := &in.Dom, &out.Dom + *out = new(float64) + **out = **in + } + if in.Dow != nil { + in, out := &in.Dow, &out.Dow + *out = new(float64) + **out = **in + } + if in.Hour != nil { + in, out := &in.Hour, &out.Hour + *out = new(float64) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackupsScheduleParameters. +func (in *BackupsScheduleParameters) DeepCopy() *BackupsScheduleParameters { + if in == nil { + return nil + } + out := new(BackupsScheduleParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Instance) DeepCopyInto(out *Instance) { + *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 Instance. +func (in *Instance) DeepCopy() *Instance { + if in == nil { + return nil + } + out := new(Instance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Instance) 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 *InstanceList) DeepCopyInto(out *InstanceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Instance, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceList. +func (in *InstanceList) DeepCopy() *InstanceList { + if in == nil { + return nil + } + out := new(InstanceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InstanceList) 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 *InstanceObservation) DeepCopyInto(out *InstanceObservation) { + *out = *in + if in.ActivationEmail != nil { + in, out := &in.ActivationEmail, &out.ActivationEmail + *out = new(bool) + **out = **in + } + if in.AllowedBandwidth != nil { + in, out := &in.AllowedBandwidth, &out.AllowedBandwidth + *out = new(float64) + **out = **in + } + if in.AppID != nil { + in, out := &in.AppID, &out.AppID + *out = new(float64) + **out = **in + } + if in.Backups != nil { + in, out := &in.Backups, &out.Backups + *out = new(string) + **out = **in + } + if in.BackupsSchedule != nil { + in, out := &in.BackupsSchedule, &out.BackupsSchedule + *out = make([]BackupsScheduleObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.DdosProtection != nil { + in, out := &in.DdosProtection, &out.DdosProtection + *out = new(bool) + **out = **in + } + if in.Disk != nil { + in, out := &in.Disk, &out.Disk + *out = new(float64) + **out = **in + } + if in.EnableIPv6 != nil { + in, out := &in.EnableIPv6, &out.EnableIPv6 + *out = new(bool) + **out = **in + } + if in.Features != nil { + in, out := &in.Features, &out.Features + *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.FirewallGroupID != nil { + in, out := &in.FirewallGroupID, &out.FirewallGroupID + *out = new(string) + **out = **in + } + if in.GatewayV4 != nil { + in, out := &in.GatewayV4, &out.GatewayV4 + *out = new(string) + **out = **in + } + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.ImageID != nil { + in, out := &in.ImageID, &out.ImageID + *out = new(string) + **out = **in + } + if in.InternalIP != nil { + in, out := &in.InternalIP, &out.InternalIP + *out = new(string) + **out = **in + } + if in.IsoID != nil { + in, out := &in.IsoID, &out.IsoID + *out = new(string) + **out = **in + } + if in.Kvm != nil { + in, out := &in.Kvm, &out.Kvm + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MainIP != nil { + in, out := &in.MainIP, &out.MainIP + *out = new(string) + **out = **in + } + if in.NetmaskV4 != nil { + in, out := &in.NetmaskV4, &out.NetmaskV4 + *out = new(string) + **out = **in + } + if in.Os != nil { + in, out := &in.Os, &out.Os + *out = new(string) + **out = **in + } + if in.OsID != nil { + in, out := &in.OsID, &out.OsID + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PowerStatus != nil { + in, out := &in.PowerStatus, &out.PowerStatus + *out = new(string) + **out = **in + } + if in.PrivateNetworkIds != nil { + in, out := &in.PrivateNetworkIds, &out.PrivateNetworkIds + *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.RAM != nil { + in, out := &in.RAM, &out.RAM + *out = new(float64) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReservedIPID != nil { + in, out := &in.ReservedIPID, &out.ReservedIPID + *out = new(string) + **out = **in + } + if in.SSHKeyIds != nil { + in, out := &in.SSHKeyIds, &out.SSHKeyIds + *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.ScriptID != nil { + in, out := &in.ScriptID, &out.ScriptID + *out = new(string) + **out = **in + } + if in.ServerStatus != nil { + in, out := &in.ServerStatus, &out.ServerStatus + *out = new(string) + **out = **in + } + if in.SnapshotID != nil { + in, out := &in.SnapshotID, &out.SnapshotID + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } + if in.V6MainIP != nil { + in, out := &in.V6MainIP, &out.V6MainIP + *out = new(string) + **out = **in + } + if in.V6Network != nil { + in, out := &in.V6Network, &out.V6Network + *out = new(string) + **out = **in + } + if in.V6NetworkSize != nil { + in, out := &in.V6NetworkSize, &out.V6NetworkSize + *out = new(float64) + **out = **in + } + if in.VPCIds != nil { + in, out := &in.VPCIds, &out.VPCIds + *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.VcpuCount != nil { + in, out := &in.VcpuCount, &out.VcpuCount + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceObservation. +func (in *InstanceObservation) DeepCopy() *InstanceObservation { + if in == nil { + return nil + } + out := new(InstanceObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceParameters) DeepCopyInto(out *InstanceParameters) { + *out = *in + if in.ActivationEmail != nil { + in, out := &in.ActivationEmail, &out.ActivationEmail + *out = new(bool) + **out = **in + } + if in.AppID != nil { + in, out := &in.AppID, &out.AppID + *out = new(float64) + **out = **in + } + if in.Backups != nil { + in, out := &in.Backups, &out.Backups + *out = new(string) + **out = **in + } + if in.BackupsSchedule != nil { + in, out := &in.BackupsSchedule, &out.BackupsSchedule + *out = make([]BackupsScheduleParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DdosProtection != nil { + in, out := &in.DdosProtection, &out.DdosProtection + *out = new(bool) + **out = **in + } + if in.EnableIPv6 != nil { + in, out := &in.EnableIPv6, &out.EnableIPv6 + *out = new(bool) + **out = **in + } + if in.FirewallGroupID != nil { + in, out := &in.FirewallGroupID, &out.FirewallGroupID + *out = new(string) + **out = **in + } + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.ImageID != nil { + in, out := &in.ImageID, &out.ImageID + *out = new(string) + **out = **in + } + if in.IsoID != nil { + in, out := &in.IsoID, &out.IsoID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.OsID != nil { + in, out := &in.OsID, &out.OsID + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PrivateNetworkIds != nil { + in, out := &in.PrivateNetworkIds, &out.PrivateNetworkIds + *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.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReservedIPID != nil { + in, out := &in.ReservedIPID, &out.ReservedIPID + *out = new(string) + **out = **in + } + if in.SSHKeyIds != nil { + in, out := &in.SSHKeyIds, &out.SSHKeyIds + *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.ScriptID != nil { + in, out := &in.ScriptID, &out.ScriptID + *out = new(string) + **out = **in + } + if in.SnapshotID != nil { + in, out := &in.SnapshotID, &out.SnapshotID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } + if in.VPCIds != nil { + in, out := &in.VPCIds, &out.VPCIds + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceParameters. +func (in *InstanceParameters) DeepCopy() *InstanceParameters { + if in == nil { + return nil + } + out := new(InstanceParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. +func (in *InstanceSpec) DeepCopy() *InstanceSpec { + if in == nil { + return nil + } + out := new(InstanceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus. +func (in *InstanceStatus) DeepCopy() *InstanceStatus { + if in == nil { + return nil + } + out := new(InstanceStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Kubernetes) DeepCopyInto(out *Kubernetes) { *out = *in diff --git a/apis/vultr/v1alpha1/zz_generated.managed.go b/apis/vultr/v1alpha1/zz_generated.managed.go index 7416932..0c07ad6 100644 --- a/apis/vultr/v1alpha1/zz_generated.managed.go +++ b/apis/vultr/v1alpha1/zz_generated.managed.go @@ -7,6 +7,82 @@ package v1alpha1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this Instance. +func (mg *Instance) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Instance. +func (mg *Instance) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Instance. +func (mg *Instance) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Instance. +func (mg *Instance) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Instance. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Instance) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Instance. +func (mg *Instance) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Instance. +func (mg *Instance) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Instance. +func (mg *Instance) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Instance. +func (mg *Instance) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Instance. +func (mg *Instance) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Instance. +func (mg *Instance) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Instance. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Instance) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Instance. +func (mg *Instance) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Instance. +func (mg *Instance) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Kubernetes. func (mg *Kubernetes) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/vultr/v1alpha1/zz_generated.managedlist.go b/apis/vultr/v1alpha1/zz_generated.managedlist.go index d739cac..c5b81ae 100644 --- a/apis/vultr/v1alpha1/zz_generated.managedlist.go +++ b/apis/vultr/v1alpha1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this InstanceList. +func (l *InstanceList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this KubernetesList. func (l *KubernetesList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/vultr/v1alpha1/zz_generated_terraformed.go b/apis/vultr/v1alpha1/zz_generated_terraformed.go index 2429adb..a75b626 100755 --- a/apis/vultr/v1alpha1/zz_generated_terraformed.go +++ b/apis/vultr/v1alpha1/zz_generated_terraformed.go @@ -13,6 +13,80 @@ import ( "github.com/upbound/upjet/pkg/resource/json" ) +// GetTerraformResourceType returns Terraform resource type for this Instance +func (mg *Instance) GetTerraformResourceType() string { + return "vultr_instance" +} + +// GetConnectionDetailsMapping for this Instance +func (tr *Instance) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"default_password": "status.atProvider.defaultPassword"} +} + +// GetObservation of this Instance +func (tr *Instance) 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 Instance +func (tr *Instance) 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 Instance +func (tr *Instance) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Instance +func (tr *Instance) 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 Instance +func (tr *Instance) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Instance using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Instance) LateInitialize(attrs []byte) (bool, error) { + params := &InstanceParameters{} + 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 *Instance) GetTerraformSchemaVersion() int { + return 0 +} + // GetTerraformResourceType returns Terraform resource type for this Kubernetes func (mg *Kubernetes) GetTerraformResourceType() string { return "vultr_kubernetes" diff --git a/apis/vultr/v1alpha1/zz_instance_types.go b/apis/vultr/v1alpha1/zz_instance_types.go new file mode 100755 index 0000000..b44ef8b --- /dev/null +++ b/apis/vultr/v1alpha1/zz_instance_types.go @@ -0,0 +1,318 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type BackupsScheduleObservation struct { + + // Day of month to run. Use values between 1 and 28. + Dom *float64 `json:"dom,omitempty" tf:"dom,omitempty"` + + // Day of week to run. 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday + Dow *float64 `json:"dow,omitempty" tf:"dow,omitempty"` + + // Hour of day to run in UTC. + Hour *float64 `json:"hour,omitempty" tf:"hour,omitempty"` + + // Type of backup schedule Possible values are daily, weekly, monthly, daily_alt_even, or daily_alt_odd. + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +type BackupsScheduleParameters struct { + + // Day of month to run. Use values between 1 and 28. + // +kubebuilder:validation:Optional + Dom *float64 `json:"dom,omitempty" tf:"dom,omitempty"` + + // Day of week to run. 1 = Sunday, 2 = Monday, 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, 7 = Saturday + // +kubebuilder:validation:Optional + Dow *float64 `json:"dow,omitempty" tf:"dow,omitempty"` + + // Hour of day to run in UTC. + // +kubebuilder:validation:Optional + Hour *float64 `json:"hour,omitempty" tf:"hour,omitempty"` + + // Type of backup schedule Possible values are daily, weekly, monthly, daily_alt_even, or daily_alt_odd. + // +kubebuilder:validation:Required + Type *string `json:"type" tf:"type,omitempty"` +} + +type InstanceObservation struct { + + // Whether an activation email will be sent when the server is ready. + ActivationEmail *bool `json:"activationEmail,omitempty" tf:"activation_email,omitempty"` + + // The server's allowed bandwidth usage in GB. + AllowedBandwidth *float64 `json:"allowedBandwidth,omitempty" tf:"allowed_bandwidth,omitempty"` + + // The ID of the Vultr application to be installed on the server. See List Applications + AppID *float64 `json:"appId,omitempty" tf:"app_id,omitempty"` + + // Whether automatic backups will be enabled for this server (these have an extra charge associated with them). Values can be enabled or disabled. + Backups *string `json:"backups,omitempty" tf:"backups,omitempty"` + + // A block that defines the way backups should be scheduled. While this is an optional field if backups are enabled this field is mandatory. The configuration of a backups_schedule is listed below. + BackupsSchedule []BackupsScheduleObservation `json:"backupsSchedule,omitempty" tf:"backups_schedule,omitempty"` + + // The date the server was added to your Vultr account. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // Whether DDOS protection will be enabled on the server (there is an additional charge for this). + DdosProtection *bool `json:"ddosProtection,omitempty" tf:"ddos_protection,omitempty"` + + // The description of the disk(s) on the server. + Disk *float64 `json:"disk,omitempty" tf:"disk,omitempty"` + + // Whether the server has IPv6 networking activated. + EnableIPv6 *bool `json:"enableIpv6,omitempty" tf:"enable_ipv6,omitempty"` + + // Array of which features are enabled. + Features []*string `json:"features,omitempty" tf:"features,omitempty"` + + // The ID of the firewall group to assign to the server. + FirewallGroupID *string `json:"firewallGroupId,omitempty" tf:"firewall_group_id,omitempty"` + + // The server's IPv4 gateway. + GatewayV4 *string `json:"gatewayV4,omitempty" tf:"gateway_v4,omitempty"` + + // The hostname to assign to the server. + // The hostname of the instance. Updating the hostname will cause a force new. This behavior is in place to prevent accidental reinstalls. Issuing an update to the hostname on UI or API issues a reinstall of the OS. + Hostname *string `json:"hostname,omitempty" tf:"hostname,omitempty"` + + // ID of the server. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The ID of the Vultr marketplace application to be installed on the server. See List Applications Note marketplace applications are denoted by type: marketplace and you must use the image_id not the id. + ImageID *string `json:"imageId,omitempty" tf:"image_id,omitempty"` + + // The server's internal IP address. + InternalIP *string `json:"internalIp,omitempty" tf:"internal_ip,omitempty"` + + // The ID of the ISO file to be installed on the server. See List ISO + IsoID *string `json:"isoId,omitempty" tf:"iso_id,omitempty"` + + // The server's current KVM URL. This URL will change periodically. It is not advised to cache this value. + Kvm *string `json:"kvm,omitempty" tf:"kvm,omitempty"` + + // A label for the server. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The server's main IP address. + MainIP *string `json:"mainIp,omitempty" tf:"main_ip,omitempty"` + + // The server's IPv4 netmask. + NetmaskV4 *string `json:"netmaskV4,omitempty" tf:"netmask_v4,omitempty"` + + // The string description of the operating system installed on the server. + Os *string `json:"os,omitempty" tf:"os,omitempty"` + + // The ID of the operating system to be installed on the server. See List OS + OsID *float64 `json:"osId,omitempty" tf:"os_id,omitempty"` + + // The ID of the plan that you want the instance to subscribe to. See List Plans + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // Whether the server is powered on or not. + PowerStatus *string `json:"powerStatus,omitempty" tf:"power_status,omitempty"` + + // (Deprecated: use vpc_ids instead) A list of private network IDs to be attached to the server. + PrivateNetworkIds []*string `json:"privateNetworkIds,omitempty" tf:"private_network_ids,omitempty"` + + // The amount of memory available on the server in MB. + RAM *float64 `json:"ram,omitempty" tf:"ram,omitempty"` + + // The ID of the region that the instance is to be created in. See List Regions + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // ID of the floating IP to use as the main IP of this server. + ReservedIPID *string `json:"reservedIpId,omitempty" tf:"reserved_ip_id,omitempty"` + + // A list of SSH key IDs to apply to the server on install (only valid for Linux/FreeBSD). + SSHKeyIds []*string `json:"sshKeyIds,omitempty" tf:"ssh_key_ids,omitempty"` + + // The ID of the startup script you want added to the server. + ScriptID *string `json:"scriptId,omitempty" tf:"script_id,omitempty"` + + // A more detailed server status (none, locked, installingbooting, isomounting, ok). + ServerStatus *string `json:"serverStatus,omitempty" tf:"server_status,omitempty"` + + // The ID of the Vultr snapshot that the server will restore for the initial installation. See List Snapshots + SnapshotID *string `json:"snapshotId,omitempty" tf:"snapshot_id,omitempty"` + + // The status of the server's subscription. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // A list of tags to apply to the instance. + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Generic data store, which some provisioning tools and cloud operating systems use as a configuration file. It is generally consumed only once after an instance has been launched, but individual needs may vary. + UserData *string `json:"userData,omitempty" tf:"user_data,omitempty"` + + // The main IPv6 network address. + V6MainIP *string `json:"v6MainIp,omitempty" tf:"v6_main_ip,omitempty"` + + // The IPv6 subnet. + V6Network *string `json:"v6Network,omitempty" tf:"v6_network,omitempty"` + + // The IPv6 network size in bits. + V6NetworkSize *float64 `json:"v6NetworkSize,omitempty" tf:"v6_network_size,omitempty"` + + // A list of VPC IDs to be attached to the server. + VPCIds []*string `json:"vpcIds,omitempty" tf:"vpc_ids,omitempty"` + + // The number of virtual CPUs available on the server. + VcpuCount *float64 `json:"vcpuCount,omitempty" tf:"vcpu_count,omitempty"` +} + +type InstanceParameters struct { + + // Whether an activation email will be sent when the server is ready. + // +kubebuilder:validation:Optional + ActivationEmail *bool `json:"activationEmail,omitempty" tf:"activation_email,omitempty"` + + // The ID of the Vultr application to be installed on the server. See List Applications + // +kubebuilder:validation:Optional + AppID *float64 `json:"appId,omitempty" tf:"app_id,omitempty"` + + // Whether automatic backups will be enabled for this server (these have an extra charge associated with them). Values can be enabled or disabled. + // +kubebuilder:validation:Optional + Backups *string `json:"backups,omitempty" tf:"backups,omitempty"` + + // A block that defines the way backups should be scheduled. While this is an optional field if backups are enabled this field is mandatory. The configuration of a backups_schedule is listed below. + // +kubebuilder:validation:Optional + BackupsSchedule []BackupsScheduleParameters `json:"backupsSchedule,omitempty" tf:"backups_schedule,omitempty"` + + // Whether DDOS protection will be enabled on the server (there is an additional charge for this). + // +kubebuilder:validation:Optional + DdosProtection *bool `json:"ddosProtection,omitempty" tf:"ddos_protection,omitempty"` + + // Whether the server has IPv6 networking activated. + // +kubebuilder:validation:Optional + EnableIPv6 *bool `json:"enableIpv6,omitempty" tf:"enable_ipv6,omitempty"` + + // The ID of the firewall group to assign to the server. + // +kubebuilder:validation:Optional + FirewallGroupID *string `json:"firewallGroupId,omitempty" tf:"firewall_group_id,omitempty"` + + // The hostname to assign to the server. + // The hostname of the instance. Updating the hostname will cause a force new. This behavior is in place to prevent accidental reinstalls. Issuing an update to the hostname on UI or API issues a reinstall of the OS. + // +kubebuilder:validation:Optional + Hostname *string `json:"hostname,omitempty" tf:"hostname,omitempty"` + + // The ID of the Vultr marketplace application to be installed on the server. See List Applications Note marketplace applications are denoted by type: marketplace and you must use the image_id not the id. + // +kubebuilder:validation:Optional + ImageID *string `json:"imageId,omitempty" tf:"image_id,omitempty"` + + // The ID of the ISO file to be installed on the server. See List ISO + // +kubebuilder:validation:Optional + IsoID *string `json:"isoId,omitempty" tf:"iso_id,omitempty"` + + // A label for the server. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The ID of the operating system to be installed on the server. See List OS + // +kubebuilder:validation:Optional + OsID *float64 `json:"osId,omitempty" tf:"os_id,omitempty"` + + // The ID of the plan that you want the instance to subscribe to. See List Plans + // +kubebuilder:validation:Optional + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // (Deprecated: use vpc_ids instead) A list of private network IDs to be attached to the server. + // +kubebuilder:validation:Optional + PrivateNetworkIds []*string `json:"privateNetworkIds,omitempty" tf:"private_network_ids,omitempty"` + + // The ID of the region that the instance is to be created in. See List Regions + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // ID of the floating IP to use as the main IP of this server. + // +kubebuilder:validation:Optional + ReservedIPID *string `json:"reservedIpId,omitempty" tf:"reserved_ip_id,omitempty"` + + // A list of SSH key IDs to apply to the server on install (only valid for Linux/FreeBSD). + // +kubebuilder:validation:Optional + SSHKeyIds []*string `json:"sshKeyIds,omitempty" tf:"ssh_key_ids,omitempty"` + + // The ID of the startup script you want added to the server. + // +kubebuilder:validation:Optional + ScriptID *string `json:"scriptId,omitempty" tf:"script_id,omitempty"` + + // The ID of the Vultr snapshot that the server will restore for the initial installation. See List Snapshots + // +kubebuilder:validation:Optional + SnapshotID *string `json:"snapshotId,omitempty" tf:"snapshot_id,omitempty"` + + // A list of tags to apply to the instance. + // +kubebuilder:validation:Optional + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Generic data store, which some provisioning tools and cloud operating systems use as a configuration file. It is generally consumed only once after an instance has been launched, but individual needs may vary. + // +kubebuilder:validation:Optional + UserData *string `json:"userData,omitempty" tf:"user_data,omitempty"` + + // A list of VPC IDs to be attached to the server. + // +kubebuilder:validation:Optional + VPCIds []*string `json:"vpcIds,omitempty" tf:"vpc_ids,omitempty"` +} + +// InstanceSpec defines the desired state of Instance +type InstanceSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider InstanceParameters `json:"forProvider"` +} + +// InstanceStatus defines the observed state of Instance. +type InstanceStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider InstanceObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Instance is the Schema for the Instances API. Provides a Vultr instance resource. This can be used to create, read, modify, and delete instances on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type Instance struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.plan)",message="plan is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + Spec InstanceSpec `json:"spec"` + Status InstanceStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// InstanceList contains a list of Instances +type InstanceList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Instance `json:"items"` +} + +// Repository type metadata. +var ( + Instance_Kind = "Instance" + Instance_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Instance_Kind}.String() + Instance_KindAPIVersion = Instance_Kind + "." + CRDGroupVersion.String() + Instance_GroupVersionKind = CRDGroupVersion.WithKind(Instance_Kind) +) + +func init() { + SchemeBuilder.Register(&Instance{}, &InstanceList{}) +} diff --git a/config/external_name.go b/config/external_name.go index 4d25b57..ed8d36b 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -14,6 +14,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "vultr_kubernetes": config.IdentifierFromProvider, "vultr_kubernetes_node_pools": config.IdentifierFromProvider, "vultr_object_storage": config.NameAsIdentifier, + "vultr_instance": config.NameAsIdentifier, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/instance/config.go b/config/instance/config.go new file mode 100644 index 0000000..2db55df --- /dev/null +++ b/config/instance/config.go @@ -0,0 +1,8 @@ +package instance + +import "github.com/upbound/upjet/pkg/config" + +func Configure(p *config.Provider) { + p.AddResourceConfigurator("vultr_instance", func(r *config.Resource) { + }) +} diff --git a/config/provider-metadata.yaml b/config/provider-metadata.yaml index c23960c..45287ad 100644 --- a/config/provider-metadata.yaml +++ b/config/provider-metadata.yaml @@ -92,6 +92,177 @@ resources: size_gb: '- The size of the given block storage.' status: '- Current status of your block storage.' importStatements: [] + vultr_database: + subCategory: "" + description: Provides a Vultr database resource. This can be used to create, read, modify, and delete managed databases on your Vultr account. + name: vultr_database + title: vultr_database + examples: + - name: my_database + manifest: |- + { + "database_engine": "pg", + "database_engine_version": "15", + "label": "my_database_label", + "plan": "vultr-dbaas-startup-cc-1-55-2", + "region": "ewr" + } + - name: my_database + manifest: |- + { + "cluster_time_zone": "America/New_York", + "database_engine": "pg", + "database_engine_version": "15", + "label": "my_database_label", + "maintenance_dow": "sunday", + "maintenance_time": "01:00", + "plan": "vultr-dbaas-startup-cc-1-55-2", + "region": "ewr", + "tag": "some tag" + } + argumentDocs: + cluster_time_zone: '- (Optional) The configured time zone for the Managed Database in TZ database format (e.g. UTC, America/New_York, Europe/London).' + database_engine: '- (Required) The database engine of the new managed database.' + database_engine_version: '- (Required) The database engine version of the new managed database.' + date_created: '- The date the managed database was added to your Vultr account.' + dbname: '- The managed database''s default logical database.' + host: '- The hostname assigned to the managed database.' + id: '- The ID of the managed database.' + label: '- (Required) A label for the managed database.' + latest_backup: '- The date of the latest backup available on the managed database.' + maintenance_dow: '- (Optional) The preferred maintenance day of week for the managed database.' + maintenance_time: '- (Optional) The preferred maintenance time for the managed database.' + mysql_long_query_time: '- (Optional) The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only).' + mysql_require_primary_key: '- (Optional) The configuration value for whether primary keys are required on the managed database (MySQL engine types only).' + mysql_slow_query_log: '- (Optional) The configuration value for slow query logging on the managed database (MySQL engine types only).' + mysql_sql_modes: '- (Optional) A list of SQL modes to configure for the managed database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, TIME_TRUNCATE_FRACTIONAL, TRADITIONAL).' + password: '- The password for the managed database''s primary admin user.' + plan: '- (Required) The ID of the plan that you want the managed database to subscribe to. See List Managed Database Plans' + plan_disk: '- The description of the disk(s) on the managed database.' + plan_ram: '- The amount of memory available on the managed database in MB.' + plan_replicas: '- The number of standby nodes available on the managed database.' + plan_vcpus: '- The number of virtual CPUs available on the managed database.' + port: '- The connection port for the managed database.' + read_replicas: '- A list of read replicas attached to the managed database.' + redis_eviction_policy: '- (Optional) The configuration value for the data eviction policy on the managed database (Redis engine types only - noeviction, allkeys-lru, volatile-lru, allkeys-random, volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu).' + region: '- (Required) The ID of the region that the managed database is to be created in. See List Regions' + status: '- The current status of the managed database (poweroff, rebuilding, rebalancing, running).' + tag: '- (Optional) The tag to assign to the managed database.' + trusted_ips: '- (Optional) A list of allowed IP addresses for the managed database.' + user: '- The primary admin user for the managed database.' + importStatements: [] + vultr_database_connection_pool: + subCategory: "" + description: Provides a Vultr database connection pool resource. This can be used to create, read, modify, and delete connection pools for a PostgreSQL managed database on your Vultr account. + name: vultr_database_connection_pool + title: vultr_database_connection_pool + examples: + - name: my_database_connection_pool + manifest: |- + { + "database": "defaultdb", + "database_id": "${vultr_database.my_database.id}", + "mode": "transaction", + "name": "my_database_connection_pool_name", + "size": "3", + "username": "vultradmin" + } + references: + database_id: vultr_database.my_database.id + argumentDocs: + database: '- (Required) The logical database to use for the new managed database connection pool.' + database_id: '- (Required) The managed database ID you want to attach this connection pool to.' + mode: '- (Required) The mode to configure for the new managed database connection pool (session, transaction, statement).' + name: '- (Required) The name of the new managed database connection pool.' + size: '- (Required) The size of the new managed database connection pool.' + username: '- (Required) The database user to use for the new managed database connection pool.' + importStatements: [] + vultr_database_db: + subCategory: "" + description: Provides a Vultr database DB resource. This can be used to create, read, and delete logical DBs for a managed database on your Vultr account. + name: vultr_database_db + title: vultr_database_db + examples: + - name: my_database_db + manifest: |- + { + "database_id": "${vultr_database.my_database.id}", + "name": "my_database_db" + } + references: + database_id: vultr_database.my_database.id + argumentDocs: + database_id: '- (Required) The managed database ID you want to attach this logical DB to.' + name: '- (Required) The name of the new managed database logical DB.' + importStatements: [] + vultr_database_replica: + subCategory: "" + description: Provides a Vultr database replica resource. This can be used to create, read, modify, and delete managed database read replicas on your Vultr account. + name: vultr_database_replica + title: vultr_database_replica + examples: + - name: my_database_replica + manifest: |- + { + "database_id": "${vultr_database.my_database.id}", + "label": "my_database_replica_label", + "region": "sea", + "tag": "test tag" + } + references: + database_id: vultr_database.my_database.id + argumentDocs: + cluster_time_zone: '- The configured time zone for the managed database read replica in TZ database format.' + database_engine: '- The database engine of the managed database read replica.' + database_engine_version: '- The database engine version of the managed database read replica.' + database_id: '- (Required) The managed database ID you want to attach this replica to.' + date_created: '- The date the managed database read replica was added to your Vultr account.' + dbname: '- The managed database read replica''s default logical database.' + host: '- The hostname assigned to the managed database read replica.' + id: '- The ID of the managed database read replica.' + label: '- (Required) A label for the managed database read replica.' + latest_backup: '- The date of the latest backup available on the managed database read replica.' + maintenance_dow: '- The preferred maintenance day of week for the managed database read replica.' + maintenance_time: '- The preferred maintenance time for the managed database read replica.' + mysql_long_query_time: '- The configuration value for the long query time (in seconds) on the managed database read replica (MySQL engine types only).' + mysql_require_primary_key: '- The configuration value for whether primary keys are required on the managed database read replica (MySQL engine types only).' + mysql_slow_query_log: '- The configuration value for slow query logging on the managed database read replica (MySQL engine types only).' + mysql_sql_modes: '- A list of SQL modes currently configured for the managed database read replica (MySQL engine types only).' + password: '- The password for the managed database read replica''s primary admin user.' + plan: '- The managed database read replica''s plan ID.' + plan_disk: '- The description of the disk(s) on the managed database read replica.' + plan_ram: '- The amount of memory available on the managed database read replica in MB.' + plan_replicas: '- The number of standby nodes available on the managed database read replica.' + plan_vcpus: '- The number of virtual CPUs available on the managed database read replica.' + port: '- The connection port for the managed database read replica.' + redis_eviction_policy: '- The configuration value for the data eviction policy on the managed database read replica (Redis engine types only).' + region: '- (Required) The ID of the region that the managed database read replica is to be created in. See List Regions' + status: '- The current status of the managed database read replica (poweroff, rebuilding, rebalancing, running).' + tag: '- (Optional) The tag to assign to the managed database read replica.' + trusted_ips: '- A list of allowed IP addresses for the managed database read replica.' + user: '- The primary admin user for the managed database read replica.' + importStatements: [] + vultr_database_user: + subCategory: "" + description: Provides a Vultr database user resource. This can be used to create, read, modify, and delete users for a managed database on your Vultr account. + name: vultr_database_user + title: vultr_database_user + examples: + - name: my_database_user + manifest: |- + { + "database_id": "${vultr_database.my_database.id}", + "password": "randomTestPW40298", + "username": "my_database_user" + } + references: + database_id: vultr_database.my_database.id + argumentDocs: + database_id: '- (Required) The managed database ID you want to attach this user to.' + encryption: '- (Optional) The encryption type of the new managed database user''s password (MySQL engine types only - caching_sha2_password, mysql_native_password).' + password: '- (Required) The password of the new managed database user.' + username: '- (Required) The username of the new managed database user.' + importStatements: [] vultr_dns_domain: subCategory: "" description: Provides a Vultr DNS Domain resource. This can be used to create, read, modify, and delete DNS Domains. diff --git a/config/provider.go b/config/provider.go index 97ca618..b052acd 100644 --- a/config/provider.go +++ b/config/provider.go @@ -13,6 +13,7 @@ import ( "github.com/crossplane-contrib/provider-vultr/config/kubernetes" "github.com/crossplane-contrib/provider-vultr/config/nodepools" "github.com/crossplane-contrib/provider-vultr/config/object" + "github.com/crossplane-contrib/provider-vultr/config/instance" ) const ( @@ -39,6 +40,7 @@ func GetProvider() *ujconfig.Provider { kubernetes.Configure, nodepools.Configure, object.Configure, + instance.Configure, } { configure(pc) } diff --git a/examples-generated/vultr/instance.yaml b/examples-generated/vultr/instance.yaml new file mode 100644 index 0000000..3ba8de0 --- /dev/null +++ b/examples-generated/vultr/instance.yaml @@ -0,0 +1,16 @@ +apiVersion: vultr.vultr.upbound.io/v1alpha1 +kind: Instance +metadata: + annotations: + meta.upbound.io/example-id: vultr/v1alpha1/instance + labels: + testing.upbound.io/example-name: my_instance + name: my-instance +spec: + forProvider: + osId: 167 + plan: vc2-1c-1gb + region: sea + +--- + diff --git a/examples/providerconfig/providerconfig.yaml b/examples/providerconfig/providerconfig.yaml index 1ef8fc2..1342a06 100644 --- a/examples/providerconfig/providerconfig.yaml +++ b/examples/providerconfig/providerconfig.yaml @@ -6,6 +6,6 @@ spec: credentials: source: Secret secretRef: - name: example-creds + name: vultr-creds namespace: crossplane-system key: credentials diff --git a/examples/providerconfig/secret.yaml.tmpl b/examples/providerconfig/secret.yaml.tmpl index 6dfa5c8..cb0523f 100644 --- a/examples/providerconfig/secret.yaml.tmpl +++ b/examples/providerconfig/secret.yaml.tmpl @@ -1,12 +1,11 @@ apiVersion: v1 kind: Secret metadata: - name: example-creds + name: vultr-creds namespace: crossplane-system type: Opaque stringData: credentials: | { - "username": "admin", - "password": "t0ps3cr3t11" + "api_key": "putyourapikeyhere" } diff --git a/internal/controller/vultr/instance/zz_controller.go b/internal/controller/vultr/instance/zz_controller.go new file mode 100755 index 0000000..0e7f24a --- /dev/null +++ b/internal/controller/vultr/instance/zz_controller.go @@ -0,0 +1,56 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package instance + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles Instance managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Instance_GroupVersionKind.String()) + var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_instance"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Instance_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Instance_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Instance{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index bdb5938..f858854 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -12,6 +12,7 @@ import ( nodepools "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/nodepools" storage "github.com/crossplane-contrib/provider-vultr/internal/controller/object/storage" providerconfig "github.com/crossplane-contrib/provider-vultr/internal/controller/providerconfig" + instance "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/instance" kubernetes "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/kubernetes" ) @@ -22,6 +23,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { nodepools.Setup, storage.Setup, providerconfig.Setup, + instance.Setup, kubernetes.Setup, } { if err := setup(mgr, o); err != nil { diff --git a/package/crds/vultr.vultr.upbound.io_instances.yaml b/package/crds/vultr.vultr.upbound.io_instances.yaml new file mode 100644 index 0000000..41c0274 --- /dev/null +++ b/package/crds/vultr.vultr.upbound.io_instances.yaml @@ -0,0 +1,614 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: instances.vultr.vultr.upbound.io +spec: + group: vultr.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: Instance + listKind: InstanceList + plural: instances + singular: instance + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Instance is the Schema for the Instances API. Provides a Vultr + instance resource. This can be used to create, read, modify, and delete + instances on your Vultr account. + 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: InstanceSpec defines the desired state of Instance + 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 ManagementPolicy 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: + activationEmail: + description: Whether an activation email will be sent when the + server is ready. + type: boolean + appId: + description: The ID of the Vultr application to be installed on + the server. See List Applications + type: number + backups: + description: Whether automatic backups will be enabled for this + server (these have an extra charge associated with them). Values + can be enabled or disabled. + type: string + backupsSchedule: + description: A block that defines the way backups should be scheduled. + While this is an optional field if backups are enabled this + field is mandatory. The configuration of a backups_schedule + is listed below. + items: + properties: + dom: + description: Day of month to run. Use values between 1 and + 28. + type: number + dow: + description: Day of week to run. 1 = Sunday, 2 = Monday, + 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, + 7 = Saturday + type: number + hour: + description: Hour of day to run in UTC. + type: number + type: + description: Type of backup schedule Possible values are + daily, weekly, monthly, daily_alt_even, or daily_alt_odd. + type: string + required: + - type + type: object + type: array + ddosProtection: + description: Whether DDOS protection will be enabled on the server + (there is an additional charge for this). + type: boolean + enableIpv6: + description: Whether the server has IPv6 networking activated. + type: boolean + firewallGroupId: + description: The ID of the firewall group to assign to the server. + type: string + hostname: + description: The hostname to assign to the server. The hostname + of the instance. Updating the hostname will cause a force new. + This behavior is in place to prevent accidental reinstalls. + Issuing an update to the hostname on UI or API issues a reinstall + of the OS. + type: string + imageId: + description: 'The ID of the Vultr marketplace application to be + installed on the server. See List Applications Note marketplace + applications are denoted by type: marketplace and you must use + the image_id not the id.' + type: string + isoId: + description: The ID of the ISO file to be installed on the server. + See List ISO + type: string + label: + description: A label for the server. + type: string + osId: + description: The ID of the operating system to be installed on + the server. See List OS + type: number + plan: + description: The ID of the plan that you want the instance to + subscribe to. See List Plans + type: string + privateNetworkIds: + description: '(Deprecated: use vpc_ids instead) A list of private + network IDs to be attached to the server.' + items: + type: string + type: array + region: + description: The ID of the region that the instance is to be created + in. See List Regions + type: string + reservedIpId: + description: ID of the floating IP to use as the main IP of this + server. + type: string + scriptId: + description: The ID of the startup script you want added to the + server. + type: string + snapshotId: + description: The ID of the Vultr snapshot that the server will + restore for the initial installation. See List Snapshots + type: string + sshKeyIds: + description: A list of SSH key IDs to apply to the server on install + (only valid for Linux/FreeBSD). + items: + type: string + type: array + tags: + description: A list of tags to apply to the instance. + items: + type: string + type: array + userData: + description: Generic data store, which some provisioning tools + and cloud operating systems use as a configuration file. It + is generally consumed only once after an instance has been launched, + but individual needs may vary. + type: string + vpcIds: + description: A list of VPC IDs to be attached to the server. + items: + type: string + type: array + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: plan is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.plan) + - message: region is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + status: + description: InstanceStatus defines the observed state of Instance. + properties: + atProvider: + properties: + activationEmail: + description: Whether an activation email will be sent when the + server is ready. + type: boolean + allowedBandwidth: + description: The server's allowed bandwidth usage in GB. + type: number + appId: + description: The ID of the Vultr application to be installed on + the server. See List Applications + type: number + backups: + description: Whether automatic backups will be enabled for this + server (these have an extra charge associated with them). Values + can be enabled or disabled. + type: string + backupsSchedule: + description: A block that defines the way backups should be scheduled. + While this is an optional field if backups are enabled this + field is mandatory. The configuration of a backups_schedule + is listed below. + items: + properties: + dom: + description: Day of month to run. Use values between 1 and + 28. + type: number + dow: + description: Day of week to run. 1 = Sunday, 2 = Monday, + 3 = Tuesday, 4 = Wednesday, 5 = Thursday, 6 = Friday, + 7 = Saturday + type: number + hour: + description: Hour of day to run in UTC. + type: number + type: + description: Type of backup schedule Possible values are + daily, weekly, monthly, daily_alt_even, or daily_alt_odd. + type: string + type: object + type: array + dateCreated: + description: The date the server was added to your Vultr account. + type: string + ddosProtection: + description: Whether DDOS protection will be enabled on the server + (there is an additional charge for this). + type: boolean + disk: + description: The description of the disk(s) on the server. + type: number + enableIpv6: + description: Whether the server has IPv6 networking activated. + type: boolean + features: + description: Array of which features are enabled. + items: + type: string + type: array + firewallGroupId: + description: The ID of the firewall group to assign to the server. + type: string + gatewayV4: + description: The server's IPv4 gateway. + type: string + hostname: + description: The hostname to assign to the server. The hostname + of the instance. Updating the hostname will cause a force new. + This behavior is in place to prevent accidental reinstalls. + Issuing an update to the hostname on UI or API issues a reinstall + of the OS. + type: string + id: + description: ID of the server. + type: string + imageId: + description: 'The ID of the Vultr marketplace application to be + installed on the server. See List Applications Note marketplace + applications are denoted by type: marketplace and you must use + the image_id not the id.' + type: string + internalIp: + description: The server's internal IP address. + type: string + isoId: + description: The ID of the ISO file to be installed on the server. + See List ISO + type: string + kvm: + description: The server's current KVM URL. This URL will change + periodically. It is not advised to cache this value. + type: string + label: + description: A label for the server. + type: string + mainIp: + description: The server's main IP address. + type: string + netmaskV4: + description: The server's IPv4 netmask. + type: string + os: + description: The string description of the operating system installed + on the server. + type: string + osId: + description: The ID of the operating system to be installed on + the server. See List OS + type: number + plan: + description: The ID of the plan that you want the instance to + subscribe to. See List Plans + type: string + powerStatus: + description: Whether the server is powered on or not. + type: string + privateNetworkIds: + description: '(Deprecated: use vpc_ids instead) A list of private + network IDs to be attached to the server.' + items: + type: string + type: array + ram: + description: The amount of memory available on the server in MB. + type: number + region: + description: The ID of the region that the instance is to be created + in. See List Regions + type: string + reservedIpId: + description: ID of the floating IP to use as the main IP of this + server. + type: string + scriptId: + description: The ID of the startup script you want added to the + server. + type: string + serverStatus: + description: A more detailed server status (none, locked, installingbooting, + isomounting, ok). + type: string + snapshotId: + description: The ID of the Vultr snapshot that the server will + restore for the initial installation. See List Snapshots + type: string + sshKeyIds: + description: A list of SSH key IDs to apply to the server on install + (only valid for Linux/FreeBSD). + items: + type: string + type: array + status: + description: The status of the server's subscription. + type: string + tags: + description: A list of tags to apply to the instance. + items: + type: string + type: array + userData: + description: Generic data store, which some provisioning tools + and cloud operating systems use as a configuration file. It + is generally consumed only once after an instance has been launched, + but individual needs may vary. + type: string + v6MainIp: + description: The main IPv6 network address. + type: string + v6Network: + description: The IPv6 subnet. + type: string + v6NetworkSize: + description: The IPv6 network size in bits. + type: number + vcpuCount: + description: The number of virtual CPUs available on the server. + type: number + vpcIds: + description: A list of VPC IDs to be attached to the server. + items: + type: string + 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 + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From 76b69c1b0cad9e18c4286cc834f3be0b8ab09f6a Mon Sep 17 00:00:00 2001 From: cmondragon Date: Fri, 14 Jul 2023 10:29:16 -0400 Subject: [PATCH 02/13] generate database resources --- .../v1alpha1/zz_connectionpool_types.go | 119 +++ apis/database/v1alpha1/zz_db_types.go | 87 ++ .../v1alpha1/zz_generated.deepcopy.go | 865 ++++++++++++++++++ .../database/v1alpha1/zz_generated.managed.go | 312 +++++++ .../v1alpha1/zz_generated.managedlist.go | 44 + .../v1alpha1/zz_generated_terraformed.go | 310 +++++++ .../database/v1alpha1/zz_groupversion_info.go | 32 + apis/database/v1alpha1/zz_replica_types.go | 203 ++++ apis/database/v1alpha1/zz_user_types.go | 101 ++ apis/vultr/v1alpha1/zz_database_types.go | 363 ++++++++ apis/vultr/v1alpha1/zz_generated.deepcopy.go | 630 +++++++++++++ apis/vultr/v1alpha1/zz_generated.managed.go | 76 ++ .../v1alpha1/zz_generated.managedlist.go | 9 + .../v1alpha1/zz_generated_terraformed.go | 74 ++ apis/zz_register.go | 4 +- config/{instance => compute}/config.go | 2 +- config/database/config.go | 16 + config/external_name.go | 15 +- config/provider.go | 6 +- .../database/connectionpool.yaml | 19 + examples-generated/database/db.yaml | 15 + examples-generated/database/replica.yaml | 17 + examples-generated/database/user.yaml | 16 + examples-generated/vultr/database.yaml | 18 + .../database/connectionpool/zz_controller.go | 55 ++ .../controller/database/db/zz_controller.go | 55 ++ .../database/replica/zz_controller.go | 55 ++ .../controller/database/user/zz_controller.go | 55 ++ .../vultr/database/zz_controller.go | 55 ++ internal/controller/zz_setup.go | 10 + ...base.vultr.upbound.io_connectionpools.yaml | 365 ++++++++ .../crds/database.vultr.upbound.io_dbs.yaml | 326 +++++++ .../database.vultr.upbound.io_replicas.yaml | 478 ++++++++++ .../crds/database.vultr.upbound.io_users.yaml | 340 +++++++ .../vultr.vultr.upbound.io_databases.yaml | 684 ++++++++++++++ 35 files changed, 5822 insertions(+), 9 deletions(-) create mode 100755 apis/database/v1alpha1/zz_connectionpool_types.go create mode 100755 apis/database/v1alpha1/zz_db_types.go create mode 100644 apis/database/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/database/v1alpha1/zz_generated.managed.go create mode 100644 apis/database/v1alpha1/zz_generated.managedlist.go create mode 100755 apis/database/v1alpha1/zz_generated_terraformed.go create mode 100755 apis/database/v1alpha1/zz_groupversion_info.go create mode 100755 apis/database/v1alpha1/zz_replica_types.go create mode 100755 apis/database/v1alpha1/zz_user_types.go create mode 100755 apis/vultr/v1alpha1/zz_database_types.go rename config/{instance => compute}/config.go (90%) create mode 100644 config/database/config.go create mode 100644 examples-generated/database/connectionpool.yaml create mode 100644 examples-generated/database/db.yaml create mode 100644 examples-generated/database/replica.yaml create mode 100644 examples-generated/database/user.yaml create mode 100644 examples-generated/vultr/database.yaml create mode 100755 internal/controller/database/connectionpool/zz_controller.go create mode 100755 internal/controller/database/db/zz_controller.go create mode 100755 internal/controller/database/replica/zz_controller.go create mode 100755 internal/controller/database/user/zz_controller.go create mode 100755 internal/controller/vultr/database/zz_controller.go create mode 100644 package/crds/database.vultr.upbound.io_connectionpools.yaml create mode 100644 package/crds/database.vultr.upbound.io_dbs.yaml create mode 100644 package/crds/database.vultr.upbound.io_replicas.yaml create mode 100644 package/crds/database.vultr.upbound.io_users.yaml create mode 100644 package/crds/vultr.vultr.upbound.io_databases.yaml diff --git a/apis/database/v1alpha1/zz_connectionpool_types.go b/apis/database/v1alpha1/zz_connectionpool_types.go new file mode 100755 index 0000000..d6a6de4 --- /dev/null +++ b/apis/database/v1alpha1/zz_connectionpool_types.go @@ -0,0 +1,119 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ConnectionPoolObservation struct { + + // The logical database to use for the new managed database connection pool. + Database *string `json:"database,omitempty" tf:"database,omitempty"` + + // The managed database ID you want to attach this connection pool to. + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The mode to configure for the new managed database connection pool (session, transaction, statement). + Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + + // The name of the new managed database connection pool. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The size of the new managed database connection pool. + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` + + // The database user to use for the new managed database connection pool. + Username *string `json:"username,omitempty" tf:"username,omitempty"` +} + +type ConnectionPoolParameters struct { + + // The logical database to use for the new managed database connection pool. + // +kubebuilder:validation:Optional + Database *string `json:"database,omitempty" tf:"database,omitempty"` + + // The managed database ID you want to attach this connection pool to. + // +kubebuilder:validation:Optional + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The mode to configure for the new managed database connection pool (session, transaction, statement). + // +kubebuilder:validation:Optional + Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + + // The name of the new managed database connection pool. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + + // The size of the new managed database connection pool. + // +kubebuilder:validation:Optional + Size *float64 `json:"size,omitempty" tf:"size,omitempty"` + + // The database user to use for the new managed database connection pool. + // +kubebuilder:validation:Optional + Username *string `json:"username,omitempty" tf:"username,omitempty"` +} + +// ConnectionPoolSpec defines the desired state of ConnectionPool +type ConnectionPoolSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ConnectionPoolParameters `json:"forProvider"` +} + +// ConnectionPoolStatus defines the observed state of ConnectionPool. +type ConnectionPoolStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ConnectionPoolObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// ConnectionPool is the Schema for the ConnectionPools API. Provides a Vultr database connection pool resource. This can be used to create, read, modify, and delete connection pools for a PostgreSQL managed database on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type ConnectionPool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.database)",message="database is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.mode)",message="mode is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size)",message="size is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username)",message="username is a required parameter" + Spec ConnectionPoolSpec `json:"spec"` + Status ConnectionPoolStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ConnectionPoolList contains a list of ConnectionPools +type ConnectionPoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ConnectionPool `json:"items"` +} + +// Repository type metadata. +var ( + ConnectionPool_Kind = "ConnectionPool" + ConnectionPool_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ConnectionPool_Kind}.String() + ConnectionPool_KindAPIVersion = ConnectionPool_Kind + "." + CRDGroupVersion.String() + ConnectionPool_GroupVersionKind = CRDGroupVersion.WithKind(ConnectionPool_Kind) +) + +func init() { + SchemeBuilder.Register(&ConnectionPool{}, &ConnectionPoolList{}) +} diff --git a/apis/database/v1alpha1/zz_db_types.go b/apis/database/v1alpha1/zz_db_types.go new file mode 100755 index 0000000..aae31d7 --- /dev/null +++ b/apis/database/v1alpha1/zz_db_types.go @@ -0,0 +1,87 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type DBObservation struct { + + // The managed database ID you want to attach this logical DB to. + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The name of the new managed database logical DB. + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +type DBParameters struct { + + // The managed database ID you want to attach this logical DB to. + // +kubebuilder:validation:Optional + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The name of the new managed database logical DB. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` +} + +// DBSpec defines the desired state of DB +type DBSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider DBParameters `json:"forProvider"` +} + +// DBStatus defines the observed state of DB. +type DBStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider DBObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// DB is the Schema for the DBs API. Provides a Vultr database DB resource. This can be used to create, read, and delete logical DBs for a managed database on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type DB struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter" + Spec DBSpec `json:"spec"` + Status DBStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// DBList contains a list of DBs +type DBList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []DB `json:"items"` +} + +// Repository type metadata. +var ( + DB_Kind = "DB" + DB_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: DB_Kind}.String() + DB_KindAPIVersion = DB_Kind + "." + CRDGroupVersion.String() + DB_GroupVersionKind = CRDGroupVersion.WithKind(DB_Kind) +) + +func init() { + SchemeBuilder.Register(&DB{}, &DBList{}) +} diff --git a/apis/database/v1alpha1/zz_generated.deepcopy.go b/apis/database/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..96280de --- /dev/null +++ b/apis/database/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,865 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// 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 *ConnectionPool) DeepCopyInto(out *ConnectionPool) { + *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 ConnectionPool. +func (in *ConnectionPool) DeepCopy() *ConnectionPool { + if in == nil { + return nil + } + out := new(ConnectionPool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConnectionPool) 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 *ConnectionPoolList) DeepCopyInto(out *ConnectionPoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ConnectionPool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolList. +func (in *ConnectionPoolList) DeepCopy() *ConnectionPoolList { + if in == nil { + return nil + } + out := new(ConnectionPoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ConnectionPoolList) 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 *ConnectionPoolObservation) DeepCopyInto(out *ConnectionPoolObservation) { + *out = *in + if in.Database != nil { + in, out := &in.Database, &out.Database + *out = new(string) + **out = **in + } + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolObservation. +func (in *ConnectionPoolObservation) DeepCopy() *ConnectionPoolObservation { + if in == nil { + return nil + } + out := new(ConnectionPoolObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionPoolParameters) DeepCopyInto(out *ConnectionPoolParameters) { + *out = *in + if in.Database != nil { + in, out := &in.Database, &out.Database + *out = new(string) + **out = **in + } + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **out = **in + } + if in.Mode != nil { + in, out := &in.Mode, &out.Mode + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Size != nil { + in, out := &in.Size, &out.Size + *out = new(float64) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolParameters. +func (in *ConnectionPoolParameters) DeepCopy() *ConnectionPoolParameters { + if in == nil { + return nil + } + out := new(ConnectionPoolParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionPoolSpec) DeepCopyInto(out *ConnectionPoolSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolSpec. +func (in *ConnectionPoolSpec) DeepCopy() *ConnectionPoolSpec { + if in == nil { + return nil + } + out := new(ConnectionPoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConnectionPoolStatus) DeepCopyInto(out *ConnectionPoolStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolStatus. +func (in *ConnectionPoolStatus) DeepCopy() *ConnectionPoolStatus { + if in == nil { + return nil + } + out := new(ConnectionPoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DB) DeepCopyInto(out *DB) { + *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 DB. +func (in *DB) DeepCopy() *DB { + if in == nil { + return nil + } + out := new(DB) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DB) 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 *DBList) DeepCopyInto(out *DBList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]DB, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DBList. +func (in *DBList) DeepCopy() *DBList { + if in == nil { + return nil + } + out := new(DBList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DBList) 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 *DBObservation) DeepCopyInto(out *DBObservation) { + *out = *in + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DBObservation. +func (in *DBObservation) DeepCopy() *DBObservation { + if in == nil { + return nil + } + out := new(DBObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DBParameters) DeepCopyInto(out *DBParameters) { + *out = *in + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **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 DBParameters. +func (in *DBParameters) DeepCopy() *DBParameters { + if in == nil { + return nil + } + out := new(DBParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DBSpec) DeepCopyInto(out *DBSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DBSpec. +func (in *DBSpec) DeepCopy() *DBSpec { + if in == nil { + return nil + } + out := new(DBSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DBStatus) DeepCopyInto(out *DBStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DBStatus. +func (in *DBStatus) DeepCopy() *DBStatus { + if in == nil { + return nil + } + out := new(DBStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Replica) DeepCopyInto(out *Replica) { + *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 Replica. +func (in *Replica) DeepCopy() *Replica { + if in == nil { + return nil + } + out := new(Replica) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Replica) 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 *ReplicaList) DeepCopyInto(out *ReplicaList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Replica, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaList. +func (in *ReplicaList) DeepCopy() *ReplicaList { + if in == nil { + return nil + } + out := new(ReplicaList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ReplicaList) 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 *ReplicaObservation) DeepCopyInto(out *ReplicaObservation) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Dbname != nil { + in, out := &in.Dbname, &out.Dbname + *out = new(string) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LatestBackup != nil { + in, out := &in.LatestBackup, &out.LatestBackup + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.PlanRAM != nil { + in, out := &in.PlanRAM, &out.PlanRAM + *out = new(float64) + **out = **in + } + if in.PlanReplicas != nil { + in, out := &in.PlanReplicas, &out.PlanReplicas + *out = new(float64) + **out = **in + } + if in.PlanVcpus != nil { + in, out := &in.PlanVcpus, &out.PlanVcpus + *out = new(float64) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *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.User != nil { + in, out := &in.User, &out.User + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaObservation. +func (in *ReplicaObservation) DeepCopy() *ReplicaObservation { + if in == nil { + return nil + } + out := new(ReplicaObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaParameters) DeepCopyInto(out *ReplicaParameters) { + *out = *in + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaParameters. +func (in *ReplicaParameters) DeepCopy() *ReplicaParameters { + if in == nil { + return nil + } + out := new(ReplicaParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaSpec) DeepCopyInto(out *ReplicaSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaSpec. +func (in *ReplicaSpec) DeepCopy() *ReplicaSpec { + if in == nil { + return nil + } + out := new(ReplicaSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReplicaStatus) DeepCopyInto(out *ReplicaStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReplicaStatus. +func (in *ReplicaStatus) DeepCopy() *ReplicaStatus { + if in == nil { + return nil + } + out := new(ReplicaStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *User) DeepCopyInto(out *User) { + *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 User. +func (in *User) DeepCopy() *User { + if in == nil { + return nil + } + out := new(User) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *User) 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 *UserList) DeepCopyInto(out *UserList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]User, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserList. +func (in *UserList) DeepCopy() *UserList { + if in == nil { + return nil + } + out := new(UserList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *UserList) 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 *UserObservation) DeepCopyInto(out *UserObservation) { + *out = *in + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserObservation. +func (in *UserObservation) DeepCopy() *UserObservation { + if in == nil { + return nil + } + out := new(UserObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserParameters) DeepCopyInto(out *UserParameters) { + *out = *in + if in.DatabaseID != nil { + in, out := &in.DatabaseID, &out.DatabaseID + *out = new(string) + **out = **in + } + if in.Encryption != nil { + in, out := &in.Encryption, &out.Encryption + *out = new(string) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Username != nil { + in, out := &in.Username, &out.Username + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserParameters. +func (in *UserParameters) DeepCopy() *UserParameters { + if in == nil { + return nil + } + out := new(UserParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserSpec) DeepCopyInto(out *UserSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserSpec. +func (in *UserSpec) DeepCopy() *UserSpec { + if in == nil { + return nil + } + out := new(UserSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserStatus) DeepCopyInto(out *UserStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserStatus. +func (in *UserStatus) DeepCopy() *UserStatus { + if in == nil { + return nil + } + out := new(UserStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/database/v1alpha1/zz_generated.managed.go b/apis/database/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..7fc2717 --- /dev/null +++ b/apis/database/v1alpha1/zz_generated.managed.go @@ -0,0 +1,312 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this ConnectionPool. +func (mg *ConnectionPool) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ConnectionPool. +func (mg *ConnectionPool) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this ConnectionPool. +func (mg *ConnectionPool) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this ConnectionPool. +func (mg *ConnectionPool) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this ConnectionPool. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *ConnectionPool) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this ConnectionPool. +func (mg *ConnectionPool) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ConnectionPool. +func (mg *ConnectionPool) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ConnectionPool. +func (mg *ConnectionPool) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ConnectionPool. +func (mg *ConnectionPool) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this ConnectionPool. +func (mg *ConnectionPool) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this ConnectionPool. +func (mg *ConnectionPool) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this ConnectionPool. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *ConnectionPool) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this ConnectionPool. +func (mg *ConnectionPool) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ConnectionPool. +func (mg *ConnectionPool) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this DB. +func (mg *DB) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this DB. +func (mg *DB) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this DB. +func (mg *DB) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this DB. +func (mg *DB) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this DB. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *DB) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this DB. +func (mg *DB) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this DB. +func (mg *DB) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this DB. +func (mg *DB) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this DB. +func (mg *DB) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this DB. +func (mg *DB) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this DB. +func (mg *DB) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this DB. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *DB) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this DB. +func (mg *DB) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this DB. +func (mg *DB) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this Replica. +func (mg *Replica) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Replica. +func (mg *Replica) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Replica. +func (mg *Replica) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Replica. +func (mg *Replica) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Replica. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Replica) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Replica. +func (mg *Replica) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Replica. +func (mg *Replica) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Replica. +func (mg *Replica) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Replica. +func (mg *Replica) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Replica. +func (mg *Replica) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Replica. +func (mg *Replica) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Replica. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Replica) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Replica. +func (mg *Replica) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Replica. +func (mg *Replica) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + +// GetCondition of this User. +func (mg *User) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this User. +func (mg *User) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this User. +func (mg *User) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this User. +func (mg *User) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this User. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *User) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this User. +func (mg *User) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this User. +func (mg *User) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this User. +func (mg *User) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this User. +func (mg *User) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this User. +func (mg *User) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this User. +func (mg *User) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this User. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *User) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this User. +func (mg *User) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this User. +func (mg *User) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/database/v1alpha1/zz_generated.managedlist.go b/apis/database/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..15533bd --- /dev/null +++ b/apis/database/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,44 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this ConnectionPoolList. +func (l *ConnectionPoolList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this DBList. +func (l *DBList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this ReplicaList. +func (l *ReplicaList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + +// GetItems of this UserList. +func (l *UserList) 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/database/v1alpha1/zz_generated_terraformed.go b/apis/database/v1alpha1/zz_generated_terraformed.go new file mode 100755 index 0000000..6d97d90 --- /dev/null +++ b/apis/database/v1alpha1/zz_generated_terraformed.go @@ -0,0 +1,310 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/pkg/errors" + + "github.com/upbound/upjet/pkg/resource" + "github.com/upbound/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this ConnectionPool +func (mg *ConnectionPool) GetTerraformResourceType() string { + return "vultr_database_connection_pool" +} + +// GetConnectionDetailsMapping for this ConnectionPool +func (tr *ConnectionPool) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this ConnectionPool +func (tr *ConnectionPool) 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 ConnectionPool +func (tr *ConnectionPool) 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 ConnectionPool +func (tr *ConnectionPool) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ConnectionPool +func (tr *ConnectionPool) 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 ConnectionPool +func (tr *ConnectionPool) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this ConnectionPool using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ConnectionPool) LateInitialize(attrs []byte) (bool, error) { + params := &ConnectionPoolParameters{} + 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 *ConnectionPool) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this DB +func (mg *DB) GetTerraformResourceType() string { + return "vultr_database_db" +} + +// GetConnectionDetailsMapping for this DB +func (tr *DB) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this DB +func (tr *DB) 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 DB +func (tr *DB) 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 DB +func (tr *DB) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this DB +func (tr *DB) 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 DB +func (tr *DB) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this DB using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *DB) LateInitialize(attrs []byte) (bool, error) { + params := &DBParameters{} + 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 *DB) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this Replica +func (mg *Replica) GetTerraformResourceType() string { + return "vultr_database_replica" +} + +// GetConnectionDetailsMapping for this Replica +func (tr *Replica) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Replica +func (tr *Replica) 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 Replica +func (tr *Replica) 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 Replica +func (tr *Replica) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Replica +func (tr *Replica) 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 Replica +func (tr *Replica) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Replica using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Replica) LateInitialize(attrs []byte) (bool, error) { + params := &ReplicaParameters{} + 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 *Replica) GetTerraformSchemaVersion() int { + return 0 +} + +// GetTerraformResourceType returns Terraform resource type for this User +func (mg *User) GetTerraformResourceType() string { + return "vultr_database_user" +} + +// GetConnectionDetailsMapping for this User +func (tr *User) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this User +func (tr *User) 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 User +func (tr *User) 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 User +func (tr *User) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this User +func (tr *User) 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 User +func (tr *User) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this User using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *User) LateInitialize(attrs []byte) (bool, error) { + params := &UserParameters{} + 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 *User) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/database/v1alpha1/zz_groupversion_info.go b/apis/database/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..790cfad --- /dev/null +++ b/apis/database/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=database.vultr.upbound.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "database.vultr.upbound.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/database/v1alpha1/zz_replica_types.go b/apis/database/v1alpha1/zz_replica_types.go new file mode 100755 index 0000000..ea67a03 --- /dev/null +++ b/apis/database/v1alpha1/zz_replica_types.go @@ -0,0 +1,203 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type ReplicaObservation struct { + + // The configured time zone for the managed database read replica in TZ database format. + ClusterTimeZone *string `json:"clusterTimeZone,omitempty" tf:"cluster_time_zone,omitempty"` + + // The database engine of the managed database read replica. + DatabaseEngine *string `json:"databaseEngine,omitempty" tf:"database_engine,omitempty"` + + // The database engine version of the managed database read replica. + DatabaseEngineVersion *string `json:"databaseEngineVersion,omitempty" tf:"database_engine_version,omitempty"` + + // The managed database ID you want to attach this replica to. + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The date the managed database read replica was added to your Vultr account. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // The managed database read replica's default logical database. + Dbname *string `json:"dbname,omitempty" tf:"dbname,omitempty"` + + // The hostname assigned to the managed database read replica. + Host *string `json:"host,omitempty" tf:"host,omitempty"` + + // The ID of the managed database read replica. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // A label for the managed database read replica. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The date of the latest backup available on the managed database read replica. + LatestBackup *string `json:"latestBackup,omitempty" tf:"latest_backup,omitempty"` + + // The preferred maintenance day of week for the managed database read replica. + MaintenanceDow *string `json:"maintenanceDow,omitempty" tf:"maintenance_dow,omitempty"` + + // The preferred maintenance time for the managed database read replica. + MaintenanceTime *string `json:"maintenanceTime,omitempty" tf:"maintenance_time,omitempty"` + + // The configuration value for the long query time (in seconds) on the managed database read replica (MySQL engine types only). + MySQLLongQueryTime *float64 `json:"mysqlLongQueryTime,omitempty" tf:"mysql_long_query_time,omitempty"` + + // The configuration value for whether primary keys are required on the managed database read replica (MySQL engine types only). + MySQLRequirePrimaryKey *bool `json:"mysqlRequirePrimaryKey,omitempty" tf:"mysql_require_primary_key,omitempty"` + + // A list of SQL modes currently configured for the managed database read replica (MySQL engine types only). + MySQLSQLModes []*string `json:"mysqlSqlModes,omitempty" tf:"mysql_sql_modes,omitempty"` + + // The configuration value for slow query logging on the managed database read replica (MySQL engine types only). + MySQLSlowQueryLog *bool `json:"mysqlSlowQueryLog,omitempty" tf:"mysql_slow_query_log,omitempty"` + + // The password for the managed database read replica's primary admin user. + Password *string `json:"password,omitempty" tf:"password,omitempty"` + + // The managed database read replica's plan ID. + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // The description of the disk(s) on the managed database read replica. + PlanDisk *float64 `json:"planDisk,omitempty" tf:"plan_disk,omitempty"` + + // The amount of memory available on the managed database read replica in MB. + PlanRAM *float64 `json:"planRam,omitempty" tf:"plan_ram,omitempty"` + + // The number of standby nodes available on the managed database read replica. + PlanReplicas *float64 `json:"planReplicas,omitempty" tf:"plan_replicas,omitempty"` + + // The number of virtual CPUs available on the managed database read replica. + PlanVcpus *float64 `json:"planVcpus,omitempty" tf:"plan_vcpus,omitempty"` + + // The connection port for the managed database read replica. + Port *string `json:"port,omitempty" tf:"port,omitempty"` + + // The configuration value for the data eviction policy on the managed database read replica (Redis engine types only). + RedisEvictionPolicy *string `json:"redisEvictionPolicy,omitempty" tf:"redis_eviction_policy,omitempty"` + + // The ID of the region that the managed database read replica is to be created in. See List Regions + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The current status of the managed database read replica (poweroff, rebuilding, rebalancing, running). + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // The tag to assign to the managed database read replica. + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // A list of allowed IP addresses for the managed database read replica. + TrustedIps []*string `json:"trustedIps,omitempty" tf:"trusted_ips,omitempty"` + + // The primary admin user for the managed database read replica. + User *string `json:"user,omitempty" tf:"user,omitempty"` +} + +type ReplicaParameters struct { + + // The managed database ID you want to attach this replica to. + // +kubebuilder:validation:Optional + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // A label for the managed database read replica. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The configuration value for the long query time (in seconds) on the managed database read replica (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLLongQueryTime *float64 `json:"mysqlLongQueryTime,omitempty" tf:"mysql_long_query_time,omitempty"` + + // The configuration value for whether primary keys are required on the managed database read replica (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLRequirePrimaryKey *bool `json:"mysqlRequirePrimaryKey,omitempty" tf:"mysql_require_primary_key,omitempty"` + + // A list of SQL modes currently configured for the managed database read replica (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLSQLModes []*string `json:"mysqlSqlModes,omitempty" tf:"mysql_sql_modes,omitempty"` + + // The configuration value for slow query logging on the managed database read replica (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLSlowQueryLog *bool `json:"mysqlSlowQueryLog,omitempty" tf:"mysql_slow_query_log,omitempty"` + + // The description of the disk(s) on the managed database read replica. + // +kubebuilder:validation:Optional + PlanDisk *float64 `json:"planDisk,omitempty" tf:"plan_disk,omitempty"` + + // The configuration value for the data eviction policy on the managed database read replica (Redis engine types only). + // +kubebuilder:validation:Optional + RedisEvictionPolicy *string `json:"redisEvictionPolicy,omitempty" tf:"redis_eviction_policy,omitempty"` + + // The ID of the region that the managed database read replica is to be created in. See List Regions + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The tag to assign to the managed database read replica. + // +kubebuilder:validation:Optional + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // A list of allowed IP addresses for the managed database read replica. + // +kubebuilder:validation:Optional + TrustedIps []*string `json:"trustedIps,omitempty" tf:"trusted_ips,omitempty"` +} + +// ReplicaSpec defines the desired state of Replica +type ReplicaSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider ReplicaParameters `json:"forProvider"` +} + +// ReplicaStatus defines the observed state of Replica. +type ReplicaStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider ReplicaObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Replica is the Schema for the Replicas API. Provides a Vultr database replica resource. This can be used to create, read, modify, and delete managed database read replicas on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type Replica struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + Spec ReplicaSpec `json:"spec"` + Status ReplicaStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ReplicaList contains a list of Replicas +type ReplicaList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Replica `json:"items"` +} + +// Repository type metadata. +var ( + Replica_Kind = "Replica" + Replica_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Replica_Kind}.String() + Replica_KindAPIVersion = Replica_Kind + "." + CRDGroupVersion.String() + Replica_GroupVersionKind = CRDGroupVersion.WithKind(Replica_Kind) +) + +func init() { + SchemeBuilder.Register(&Replica{}, &ReplicaList{}) +} diff --git a/apis/database/v1alpha1/zz_user_types.go b/apis/database/v1alpha1/zz_user_types.go new file mode 100755 index 0000000..bdb16fd --- /dev/null +++ b/apis/database/v1alpha1/zz_user_types.go @@ -0,0 +1,101 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type UserObservation struct { + + // The managed database ID you want to attach this user to. + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The encryption type of the new managed database user's password (MySQL engine types only - caching_sha2_password, mysql_native_password). + Encryption *string `json:"encryption,omitempty" tf:"encryption,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The password of the new managed database user. + Password *string `json:"password,omitempty" tf:"password,omitempty"` + + // The username of the new managed database user. + Username *string `json:"username,omitempty" tf:"username,omitempty"` +} + +type UserParameters struct { + + // The managed database ID you want to attach this user to. + // +kubebuilder:validation:Optional + DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The encryption type of the new managed database user's password (MySQL engine types only - caching_sha2_password, mysql_native_password). + // +kubebuilder:validation:Optional + Encryption *string `json:"encryption,omitempty" tf:"encryption,omitempty"` + + // The password of the new managed database user. + // +kubebuilder:validation:Optional + Password *string `json:"password,omitempty" tf:"password,omitempty"` + + // The username of the new managed database user. + // +kubebuilder:validation:Optional + Username *string `json:"username,omitempty" tf:"username,omitempty"` +} + +// UserSpec defines the desired state of User +type UserSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider UserParameters `json:"forProvider"` +} + +// UserStatus defines the observed state of User. +type UserStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider UserObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// User is the Schema for the Users API. Provides a Vultr database user resource. This can be used to create, read, modify, and delete users for a managed database on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type User struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username)",message="username is a required parameter" + Spec UserSpec `json:"spec"` + Status UserStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// UserList contains a list of Users +type UserList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []User `json:"items"` +} + +// Repository type metadata. +var ( + User_Kind = "User" + User_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: User_Kind}.String() + User_KindAPIVersion = User_Kind + "." + CRDGroupVersion.String() + User_GroupVersionKind = CRDGroupVersion.WithKind(User_Kind) +) + +func init() { + SchemeBuilder.Register(&User{}, &UserList{}) +} diff --git a/apis/vultr/v1alpha1/zz_database_types.go b/apis/vultr/v1alpha1/zz_database_types.go new file mode 100755 index 0000000..549beca --- /dev/null +++ b/apis/vultr/v1alpha1/zz_database_types.go @@ -0,0 +1,363 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type DatabaseObservation struct { + + // The configured time zone for the Managed Database in TZ database format (e.g. UTC, America/New_York, Europe/London). + ClusterTimeZone *string `json:"clusterTimeZone,omitempty" tf:"cluster_time_zone,omitempty"` + + // The database engine of the new managed database. + DatabaseEngine *string `json:"databaseEngine,omitempty" tf:"database_engine,omitempty"` + + // The database engine version of the new managed database. + DatabaseEngineVersion *string `json:"databaseEngineVersion,omitempty" tf:"database_engine_version,omitempty"` + + // The date the managed database was added to your Vultr account. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // The managed database's default logical database. + Dbname *string `json:"dbname,omitempty" tf:"dbname,omitempty"` + + // The hostname assigned to the managed database. + Host *string `json:"host,omitempty" tf:"host,omitempty"` + + // The ID of the managed database. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // A label for the managed database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The date of the latest backup available on the managed database. + LatestBackup *string `json:"latestBackup,omitempty" tf:"latest_backup,omitempty"` + + // The preferred maintenance day of week for the managed database. + MaintenanceDow *string `json:"maintenanceDow,omitempty" tf:"maintenance_dow,omitempty"` + + // The preferred maintenance time for the managed database. + MaintenanceTime *string `json:"maintenanceTime,omitempty" tf:"maintenance_time,omitempty"` + + // The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only). + MySQLLongQueryTime *float64 `json:"mysqlLongQueryTime,omitempty" tf:"mysql_long_query_time,omitempty"` + + // The configuration value for whether primary keys are required on the managed database (MySQL engine types only). + MySQLRequirePrimaryKey *bool `json:"mysqlRequirePrimaryKey,omitempty" tf:"mysql_require_primary_key,omitempty"` + + // A list of SQL modes to configure for the managed database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + MySQLSQLModes []*string `json:"mysqlSqlModes,omitempty" tf:"mysql_sql_modes,omitempty"` + + // The configuration value for slow query logging on the managed database (MySQL engine types only). + MySQLSlowQueryLog *bool `json:"mysqlSlowQueryLog,omitempty" tf:"mysql_slow_query_log,omitempty"` + + // The password for the managed database's primary admin user. + Password *string `json:"password,omitempty" tf:"password,omitempty"` + + // The ID of the plan that you want the managed database to subscribe to. See List Managed Database Plans + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // The description of the disk(s) on the managed database. + PlanDisk *float64 `json:"planDisk,omitempty" tf:"plan_disk,omitempty"` + + // The amount of memory available on the managed database in MB. + PlanRAM *float64 `json:"planRam,omitempty" tf:"plan_ram,omitempty"` + + // The number of standby nodes available on the managed database. + PlanReplicas *float64 `json:"planReplicas,omitempty" tf:"plan_replicas,omitempty"` + + // The number of virtual CPUs available on the managed database. + PlanVcpus *float64 `json:"planVcpus,omitempty" tf:"plan_vcpus,omitempty"` + + // The connection port for the managed database. + Port *string `json:"port,omitempty" tf:"port,omitempty"` + + // A list of read replicas attached to the managed database. + ReadReplicas []ReadReplicasObservation `json:"readReplicas,omitempty" tf:"read_replicas,omitempty"` + + // The configuration value for the data eviction policy on the managed database (Redis engine types only - noeviction, allkeys-lru, volatile-lru, allkeys-random, volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu). + RedisEvictionPolicy *string `json:"redisEvictionPolicy,omitempty" tf:"redis_eviction_policy,omitempty"` + + // The ID of the region that the managed database is to be created in. See List Regions + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The current status of the managed database (poweroff, rebuilding, rebalancing, running). + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // The tag to assign to the managed database. + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // A list of allowed IP addresses for the managed database. + TrustedIps []*string `json:"trustedIps,omitempty" tf:"trusted_ips,omitempty"` + + // The primary admin user for the managed database. + User *string `json:"user,omitempty" tf:"user,omitempty"` +} + +type DatabaseParameters struct { + + // The configured time zone for the Managed Database in TZ database format (e.g. UTC, America/New_York, Europe/London). + // +kubebuilder:validation:Optional + ClusterTimeZone *string `json:"clusterTimeZone,omitempty" tf:"cluster_time_zone,omitempty"` + + // The database engine of the new managed database. + // +kubebuilder:validation:Optional + DatabaseEngine *string `json:"databaseEngine,omitempty" tf:"database_engine,omitempty"` + + // The database engine version of the new managed database. + // +kubebuilder:validation:Optional + DatabaseEngineVersion *string `json:"databaseEngineVersion,omitempty" tf:"database_engine_version,omitempty"` + + // A label for the managed database. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The preferred maintenance day of week for the managed database. + // +kubebuilder:validation:Optional + MaintenanceDow *string `json:"maintenanceDow,omitempty" tf:"maintenance_dow,omitempty"` + + // The preferred maintenance time for the managed database. + // +kubebuilder:validation:Optional + MaintenanceTime *string `json:"maintenanceTime,omitempty" tf:"maintenance_time,omitempty"` + + // The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLLongQueryTime *float64 `json:"mysqlLongQueryTime,omitempty" tf:"mysql_long_query_time,omitempty"` + + // The configuration value for whether primary keys are required on the managed database (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLRequirePrimaryKey *bool `json:"mysqlRequirePrimaryKey,omitempty" tf:"mysql_require_primary_key,omitempty"` + + // A list of SQL modes to configure for the managed database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + // +kubebuilder:validation:Optional + MySQLSQLModes []*string `json:"mysqlSqlModes,omitempty" tf:"mysql_sql_modes,omitempty"` + + // The configuration value for slow query logging on the managed database (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLSlowQueryLog *bool `json:"mysqlSlowQueryLog,omitempty" tf:"mysql_slow_query_log,omitempty"` + + // The password for the managed database's primary admin user. + // +kubebuilder:validation:Optional + Password *string `json:"password,omitempty" tf:"password,omitempty"` + + // The ID of the plan that you want the managed database to subscribe to. See List Managed Database Plans + // +kubebuilder:validation:Optional + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // The description of the disk(s) on the managed database. + // +kubebuilder:validation:Optional + PlanDisk *float64 `json:"planDisk,omitempty" tf:"plan_disk,omitempty"` + + // A list of read replicas attached to the managed database. + // +kubebuilder:validation:Optional + ReadReplicas []ReadReplicasParameters `json:"readReplicas,omitempty" tf:"read_replicas,omitempty"` + + // The configuration value for the data eviction policy on the managed database (Redis engine types only - noeviction, allkeys-lru, volatile-lru, allkeys-random, volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu). + // +kubebuilder:validation:Optional + RedisEvictionPolicy *string `json:"redisEvictionPolicy,omitempty" tf:"redis_eviction_policy,omitempty"` + + // The ID of the region that the managed database is to be created in. See List Regions + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The tag to assign to the managed database. + // +kubebuilder:validation:Optional + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // A list of allowed IP addresses for the managed database. + // +kubebuilder:validation:Optional + TrustedIps []*string `json:"trustedIps,omitempty" tf:"trusted_ips,omitempty"` +} + +type ReadReplicasObservation struct { + + // The configured time zone for the Managed Database in TZ database format (e.g. UTC, America/New_York, Europe/London). + ClusterTimeZone *string `json:"clusterTimeZone,omitempty" tf:"cluster_time_zone,omitempty"` + + // The database engine of the new managed database. + DatabaseEngine *string `json:"databaseEngine,omitempty" tf:"database_engine,omitempty"` + + // The database engine version of the new managed database. + DatabaseEngineVersion *string `json:"databaseEngineVersion,omitempty" tf:"database_engine_version,omitempty"` + + // The date the managed database was added to your Vultr account. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // The managed database's default logical database. + Dbname *string `json:"dbname,omitempty" tf:"dbname,omitempty"` + + // The hostname assigned to the managed database. + Host *string `json:"host,omitempty" tf:"host,omitempty"` + + // The ID of the managed database. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // A label for the managed database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The date of the latest backup available on the managed database. + LatestBackup *string `json:"latestBackup,omitempty" tf:"latest_backup,omitempty"` + + // The preferred maintenance day of week for the managed database. + MaintenanceDow *string `json:"maintenanceDow,omitempty" tf:"maintenance_dow,omitempty"` + + // The preferred maintenance time for the managed database. + MaintenanceTime *string `json:"maintenanceTime,omitempty" tf:"maintenance_time,omitempty"` + + // The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only). + MySQLLongQueryTime *float64 `json:"mysqlLongQueryTime,omitempty" tf:"mysql_long_query_time,omitempty"` + + // The configuration value for whether primary keys are required on the managed database (MySQL engine types only). + MySQLRequirePrimaryKey *bool `json:"mysqlRequirePrimaryKey,omitempty" tf:"mysql_require_primary_key,omitempty"` + + // A list of SQL modes to configure for the managed database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + MySQLSQLModes []*string `json:"mysqlSqlModes,omitempty" tf:"mysql_sql_modes,omitempty"` + + // The configuration value for slow query logging on the managed database (MySQL engine types only). + MySQLSlowQueryLog *bool `json:"mysqlSlowQueryLog,omitempty" tf:"mysql_slow_query_log,omitempty"` + + // The password for the managed database's primary admin user. + Password *string `json:"password,omitempty" tf:"password,omitempty"` + + // The ID of the plan that you want the managed database to subscribe to. See List Managed Database Plans + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // The description of the disk(s) on the managed database. + PlanDisk *float64 `json:"planDisk,omitempty" tf:"plan_disk,omitempty"` + + // The amount of memory available on the managed database in MB. + PlanRAM *float64 `json:"planRam,omitempty" tf:"plan_ram,omitempty"` + + // The number of standby nodes available on the managed database. + PlanReplicas *float64 `json:"planReplicas,omitempty" tf:"plan_replicas,omitempty"` + + // The number of virtual CPUs available on the managed database. + PlanVcpus *float64 `json:"planVcpus,omitempty" tf:"plan_vcpus,omitempty"` + + // The connection port for the managed database. + Port *string `json:"port,omitempty" tf:"port,omitempty"` + + // The configuration value for the data eviction policy on the managed database (Redis engine types only - noeviction, allkeys-lru, volatile-lru, allkeys-random, volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu). + RedisEvictionPolicy *string `json:"redisEvictionPolicy,omitempty" tf:"redis_eviction_policy,omitempty"` + + // The ID of the region that the managed database is to be created in. See List Regions + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The current status of the managed database (poweroff, rebuilding, rebalancing, running). + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // The tag to assign to the managed database. + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // A list of allowed IP addresses for the managed database. + TrustedIps []*string `json:"trustedIps,omitempty" tf:"trusted_ips,omitempty"` + + // The primary admin user for the managed database. + User *string `json:"user,omitempty" tf:"user,omitempty"` +} + +type ReadReplicasParameters struct { + + // A label for the managed database. + // +kubebuilder:validation:Required + Label *string `json:"label" tf:"label,omitempty"` + + // The configuration value for the long query time (in seconds) on the managed database (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLLongQueryTime *float64 `json:"mysqlLongQueryTime,omitempty" tf:"mysql_long_query_time,omitempty"` + + // The configuration value for whether primary keys are required on the managed database (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLRequirePrimaryKey *bool `json:"mysqlRequirePrimaryKey,omitempty" tf:"mysql_require_primary_key,omitempty"` + + // A list of SQL modes to configure for the managed database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + // +kubebuilder:validation:Optional + MySQLSQLModes []*string `json:"mysqlSqlModes,omitempty" tf:"mysql_sql_modes,omitempty"` + + // The configuration value for slow query logging on the managed database (MySQL engine types only). + // +kubebuilder:validation:Optional + MySQLSlowQueryLog *bool `json:"mysqlSlowQueryLog,omitempty" tf:"mysql_slow_query_log,omitempty"` + + // The description of the disk(s) on the managed database. + // +kubebuilder:validation:Optional + PlanDisk *float64 `json:"planDisk,omitempty" tf:"plan_disk,omitempty"` + + // The configuration value for the data eviction policy on the managed database (Redis engine types only - noeviction, allkeys-lru, volatile-lru, allkeys-random, volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu). + // +kubebuilder:validation:Optional + RedisEvictionPolicy *string `json:"redisEvictionPolicy,omitempty" tf:"redis_eviction_policy,omitempty"` + + // The ID of the region that the managed database is to be created in. See List Regions + // +kubebuilder:validation:Required + Region *string `json:"region" tf:"region,omitempty"` + + // The tag to assign to the managed database. + // +kubebuilder:validation:Optional + Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` + + // A list of allowed IP addresses for the managed database. + // +kubebuilder:validation:Optional + TrustedIps []*string `json:"trustedIps,omitempty" tf:"trusted_ips,omitempty"` +} + +// DatabaseSpec defines the desired state of Database +type DatabaseSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider DatabaseParameters `json:"forProvider"` +} + +// DatabaseStatus defines the observed state of Database. +type DatabaseStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider DatabaseObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Database is the Schema for the Databases API. Provides a Vultr database resource. This can be used to create, read, modify, and delete managed databases on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type Database struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseEngine)",message="databaseEngine is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseEngineVersion)",message="databaseEngineVersion is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label)",message="label is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.plan)",message="plan is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + Spec DatabaseSpec `json:"spec"` + Status DatabaseStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// DatabaseList contains a list of Databases +type DatabaseList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Database `json:"items"` +} + +// Repository type metadata. +var ( + Database_Kind = "Database" + Database_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Database_Kind}.String() + Database_KindAPIVersion = Database_Kind + "." + CRDGroupVersion.String() + Database_GroupVersionKind = CRDGroupVersion.WithKind(Database_Kind) +) + +func init() { + SchemeBuilder.Register(&Database{}, &DatabaseList{}) +} diff --git a/apis/vultr/v1alpha1/zz_generated.deepcopy.go b/apis/vultr/v1alpha1/zz_generated.deepcopy.go index 68e902e..14148ca 100644 --- a/apis/vultr/v1alpha1/zz_generated.deepcopy.go +++ b/apis/vultr/v1alpha1/zz_generated.deepcopy.go @@ -83,6 +83,392 @@ func (in *BackupsScheduleParameters) DeepCopy() *BackupsScheduleParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Database) DeepCopyInto(out *Database) { + *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 Database. +func (in *Database) DeepCopy() *Database { + if in == nil { + return nil + } + out := new(Database) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Database) 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 *DatabaseList) DeepCopyInto(out *DatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Database, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseList. +func (in *DatabaseList) DeepCopy() *DatabaseList { + if in == nil { + return nil + } + out := new(DatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DatabaseList) 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 *DatabaseObservation) DeepCopyInto(out *DatabaseObservation) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Dbname != nil { + in, out := &in.Dbname, &out.Dbname + *out = new(string) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LatestBackup != nil { + in, out := &in.LatestBackup, &out.LatestBackup + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.PlanRAM != nil { + in, out := &in.PlanRAM, &out.PlanRAM + *out = new(float64) + **out = **in + } + if in.PlanReplicas != nil { + in, out := &in.PlanReplicas, &out.PlanReplicas + *out = new(float64) + **out = **in + } + if in.PlanVcpus != nil { + in, out := &in.PlanVcpus, &out.PlanVcpus + *out = new(float64) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.ReadReplicas != nil { + in, out := &in.ReadReplicas, &out.ReadReplicas + *out = make([]ReadReplicasObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *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.User != nil { + in, out := &in.User, &out.User + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObservation. +func (in *DatabaseObservation) DeepCopy() *DatabaseObservation { + if in == nil { + return nil + } + out := new(DatabaseObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseParameters) DeepCopyInto(out *DatabaseParameters) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.ReadReplicas != nil { + in, out := &in.ReadReplicas, &out.ReadReplicas + *out = make([]ReadReplicasParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseParameters. +func (in *DatabaseParameters) DeepCopy() *DatabaseParameters { + if in == nil { + return nil + } + out := new(DatabaseParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec. +func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { + if in == nil { + return nil + } + out := new(DatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. +func (in *DatabaseStatus) DeepCopy() *DatabaseStatus { + if in == nil { + return nil + } + out := new(DatabaseStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Instance) DeepCopyInto(out *Instance) { *out = *in @@ -952,3 +1338,247 @@ func (in *NodesParameters) DeepCopy() *NodesParameters { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReadReplicasObservation) DeepCopyInto(out *ReadReplicasObservation) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Dbname != nil { + in, out := &in.Dbname, &out.Dbname + *out = new(string) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LatestBackup != nil { + in, out := &in.LatestBackup, &out.LatestBackup + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.PlanRAM != nil { + in, out := &in.PlanRAM, &out.PlanRAM + *out = new(float64) + **out = **in + } + if in.PlanReplicas != nil { + in, out := &in.PlanReplicas, &out.PlanReplicas + *out = new(float64) + **out = **in + } + if in.PlanVcpus != nil { + in, out := &in.PlanVcpus, &out.PlanVcpus + *out = new(float64) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *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.User != nil { + in, out := &in.User, &out.User + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadReplicasObservation. +func (in *ReadReplicasObservation) DeepCopy() *ReadReplicasObservation { + if in == nil { + return nil + } + out := new(ReadReplicasObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReadReplicasParameters) DeepCopyInto(out *ReadReplicasParameters) { + *out = *in + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadReplicasParameters. +func (in *ReadReplicasParameters) DeepCopy() *ReadReplicasParameters { + if in == nil { + return nil + } + out := new(ReadReplicasParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/vultr/v1alpha1/zz_generated.managed.go b/apis/vultr/v1alpha1/zz_generated.managed.go index 0c07ad6..7392c08 100644 --- a/apis/vultr/v1alpha1/zz_generated.managed.go +++ b/apis/vultr/v1alpha1/zz_generated.managed.go @@ -7,6 +7,82 @@ package v1alpha1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this Database. +func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Database. +func (mg *Database) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Database. +func (mg *Database) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Database. +func (mg *Database) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Database. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Database) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Database. +func (mg *Database) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Database. +func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Database. +func (mg *Database) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Database. +func (mg *Database) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Database. +func (mg *Database) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Database. +func (mg *Database) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Database. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Database) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Database. +func (mg *Database) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Database. +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Instance. func (mg *Instance) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/vultr/v1alpha1/zz_generated.managedlist.go b/apis/vultr/v1alpha1/zz_generated.managedlist.go index c5b81ae..181191b 100644 --- a/apis/vultr/v1alpha1/zz_generated.managedlist.go +++ b/apis/vultr/v1alpha1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this DatabaseList. +func (l *DatabaseList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this InstanceList. func (l *InstanceList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/vultr/v1alpha1/zz_generated_terraformed.go b/apis/vultr/v1alpha1/zz_generated_terraformed.go index a75b626..3b4b6ec 100755 --- a/apis/vultr/v1alpha1/zz_generated_terraformed.go +++ b/apis/vultr/v1alpha1/zz_generated_terraformed.go @@ -13,6 +13,80 @@ import ( "github.com/upbound/upjet/pkg/resource/json" ) +// GetTerraformResourceType returns Terraform resource type for this Database +func (mg *Database) GetTerraformResourceType() string { + return "vultr_database" +} + +// GetConnectionDetailsMapping for this Database +func (tr *Database) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Database +func (tr *Database) 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 Database +func (tr *Database) 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 Database +func (tr *Database) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Database +func (tr *Database) 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 Database +func (tr *Database) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Database using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Database) LateInitialize(attrs []byte) (bool, error) { + params := &DatabaseParameters{} + 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 *Database) GetTerraformSchemaVersion() int { + return 0 +} + // GetTerraformResourceType returns Terraform resource type for this Instance func (mg *Instance) GetTerraformResourceType() string { return "vultr_instance" diff --git a/apis/zz_register.go b/apis/zz_register.go index b6901c7..2c798d3 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -10,7 +10,8 @@ package apis import ( "k8s.io/apimachinery/pkg/runtime" - v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" + v1alpha1kubernetes "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" v1alpha1object "github.com/crossplane-contrib/provider-vultr/apis/object/v1alpha1" v1alpha1apis "github.com/crossplane-contrib/provider-vultr/apis/v1alpha1" v1beta1 "github.com/crossplane-contrib/provider-vultr/apis/v1beta1" @@ -21,6 +22,7 @@ func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, + v1alpha1kubernetes.SchemeBuilder.AddToScheme, v1alpha1object.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/instance/config.go b/config/compute/config.go similarity index 90% rename from config/instance/config.go rename to config/compute/config.go index 2db55df..9036d2e 100644 --- a/config/instance/config.go +++ b/config/compute/config.go @@ -1,4 +1,4 @@ -package instance +package compute import "github.com/upbound/upjet/pkg/config" diff --git a/config/database/config.go b/config/database/config.go new file mode 100644 index 0000000..45e867a --- /dev/null +++ b/config/database/config.go @@ -0,0 +1,16 @@ +package database + +import "github.com/upbound/upjet/pkg/config" + +func Configure(p *config.Provider) { + p.AddResourceConfigurator("vultr_database", func(r *config.Resource) { + }) + p.AddResourceConfigurator("vultr_database_connection_pool", func(r *config.Resource) { + }) + p.AddResourceConfigurator("vultr_database_db", func(r *config.Resource) { + }) + p.AddResourceConfigurator("vultr_database_replica", func(r *config.Resource) { + }) + p.AddResourceConfigurator("vultr_database_user", func(r *config.Resource) { + }) +} \ No newline at end of file diff --git a/config/external_name.go b/config/external_name.go index ed8d36b..3f691f5 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -10,11 +10,16 @@ import "github.com/upbound/upjet/pkg/config" // provider. var ExternalNameConfigs = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: nl-2e21sda - "null_resource": config.IdentifierFromProvider, - "vultr_kubernetes": config.IdentifierFromProvider, - "vultr_kubernetes_node_pools": config.IdentifierFromProvider, - "vultr_object_storage": config.NameAsIdentifier, - "vultr_instance": config.NameAsIdentifier, + "null_resource": config.IdentifierFromProvider, + "vultr_kubernetes": config.IdentifierFromProvider, + "vultr_kubernetes_node_pools": config.IdentifierFromProvider, + "vultr_object_storage": config.NameAsIdentifier, + "vultr_instance": config.NameAsIdentifier, + "vultr_database": config.IdentifierFromProvider, + "vultr_database_connection_pool": config.IdentifierFromProvider, + "vultr_database_db": config.IdentifierFromProvider, + "vultr_database_replica": config.IdentifierFromProvider, + "vultr_database_user": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/provider.go b/config/provider.go index b052acd..3278ebf 100644 --- a/config/provider.go +++ b/config/provider.go @@ -10,10 +10,11 @@ import ( ujconfig "github.com/upbound/upjet/pkg/config" + "github.com/crossplane-contrib/provider-vultr/config/database" + "github.com/crossplane-contrib/provider-vultr/config/compute" "github.com/crossplane-contrib/provider-vultr/config/kubernetes" "github.com/crossplane-contrib/provider-vultr/config/nodepools" "github.com/crossplane-contrib/provider-vultr/config/object" - "github.com/crossplane-contrib/provider-vultr/config/instance" ) const ( @@ -40,7 +41,8 @@ func GetProvider() *ujconfig.Provider { kubernetes.Configure, nodepools.Configure, object.Configure, - instance.Configure, + compute.Configure, + database.Configure, } { configure(pc) } diff --git a/examples-generated/database/connectionpool.yaml b/examples-generated/database/connectionpool.yaml new file mode 100644 index 0000000..12da10c --- /dev/null +++ b/examples-generated/database/connectionpool.yaml @@ -0,0 +1,19 @@ +apiVersion: database.vultr.upbound.io/v1alpha1 +kind: ConnectionPool +metadata: + annotations: + meta.upbound.io/example-id: database/v1alpha1/connectionpool + labels: + testing.upbound.io/example-name: my_database_connection_pool + name: my-database-connection-pool +spec: + forProvider: + database: defaultdb + databaseId: ${vultr_database.my_database.id} + mode: transaction + name: my_database_connection_pool_name + size: "3" + username: vultradmin + +--- + diff --git a/examples-generated/database/db.yaml b/examples-generated/database/db.yaml new file mode 100644 index 0000000..ad3521c --- /dev/null +++ b/examples-generated/database/db.yaml @@ -0,0 +1,15 @@ +apiVersion: database.vultr.upbound.io/v1alpha1 +kind: DB +metadata: + annotations: + meta.upbound.io/example-id: database/v1alpha1/db + labels: + testing.upbound.io/example-name: my_database_db + name: my-database-db +spec: + forProvider: + databaseId: ${vultr_database.my_database.id} + name: my_database_db + +--- + diff --git a/examples-generated/database/replica.yaml b/examples-generated/database/replica.yaml new file mode 100644 index 0000000..7b9aa48 --- /dev/null +++ b/examples-generated/database/replica.yaml @@ -0,0 +1,17 @@ +apiVersion: database.vultr.upbound.io/v1alpha1 +kind: Replica +metadata: + annotations: + meta.upbound.io/example-id: database/v1alpha1/replica + labels: + testing.upbound.io/example-name: my_database_replica + name: my-database-replica +spec: + forProvider: + databaseId: ${vultr_database.my_database.id} + label: my_database_replica_label + region: sea + tag: test tag + +--- + diff --git a/examples-generated/database/user.yaml b/examples-generated/database/user.yaml new file mode 100644 index 0000000..3e9fdf1 --- /dev/null +++ b/examples-generated/database/user.yaml @@ -0,0 +1,16 @@ +apiVersion: database.vultr.upbound.io/v1alpha1 +kind: User +metadata: + annotations: + meta.upbound.io/example-id: database/v1alpha1/user + labels: + testing.upbound.io/example-name: my_database_user + name: my-database-user +spec: + forProvider: + databaseId: ${vultr_database.my_database.id} + password: randomTestPW40298 + username: my_database_user + +--- + diff --git a/examples-generated/vultr/database.yaml b/examples-generated/vultr/database.yaml new file mode 100644 index 0000000..9048131 --- /dev/null +++ b/examples-generated/vultr/database.yaml @@ -0,0 +1,18 @@ +apiVersion: vultr.vultr.upbound.io/v1alpha1 +kind: Database +metadata: + annotations: + meta.upbound.io/example-id: vultr/v1alpha1/database + labels: + testing.upbound.io/example-name: my_database + name: my-database +spec: + forProvider: + databaseEngine: pg + databaseEngineVersion: "15" + label: my_database_label + plan: vultr-dbaas-startup-cc-1-55-2 + region: ewr + +--- + diff --git a/internal/controller/database/connectionpool/zz_controller.go b/internal/controller/database/connectionpool/zz_controller.go new file mode 100755 index 0000000..9ecf96a --- /dev/null +++ b/internal/controller/database/connectionpool/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package connectionpool + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles ConnectionPool managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.ConnectionPool_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_database_connection_pool"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ConnectionPool_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ConnectionPool_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.ConnectionPool{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/database/db/zz_controller.go b/internal/controller/database/db/zz_controller.go new file mode 100755 index 0000000..b9f3e14 --- /dev/null +++ b/internal/controller/database/db/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package db + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles DB managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.DB_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_database_db"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.DB_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.DB_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.DB{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/database/replica/zz_controller.go b/internal/controller/database/replica/zz_controller.go new file mode 100755 index 0000000..f901ab7 --- /dev/null +++ b/internal/controller/database/replica/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package replica + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles Replica managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Replica_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_database_replica"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Replica_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Replica_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Replica{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/database/user/zz_controller.go b/internal/controller/database/user/zz_controller.go new file mode 100755 index 0000000..c44dde6 --- /dev/null +++ b/internal/controller/database/user/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package user + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles User managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.User_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_database_user"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.User_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.User{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/vultr/database/zz_controller.go b/internal/controller/vultr/database/zz_controller.go new file mode 100755 index 0000000..829ea45 --- /dev/null +++ b/internal/controller/vultr/database/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package database + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles Database managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Database_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_database"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Database_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Database_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Database{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index f858854..68d370e 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -9,9 +9,14 @@ import ( "github.com/upbound/upjet/pkg/controller" + connectionpool "github.com/crossplane-contrib/provider-vultr/internal/controller/database/connectionpool" + db "github.com/crossplane-contrib/provider-vultr/internal/controller/database/db" + replica "github.com/crossplane-contrib/provider-vultr/internal/controller/database/replica" + user "github.com/crossplane-contrib/provider-vultr/internal/controller/database/user" nodepools "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/nodepools" storage "github.com/crossplane-contrib/provider-vultr/internal/controller/object/storage" providerconfig "github.com/crossplane-contrib/provider-vultr/internal/controller/providerconfig" + database "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/database" instance "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/instance" kubernetes "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/kubernetes" ) @@ -20,9 +25,14 @@ import ( // the supplied manager. func Setup(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ + connectionpool.Setup, + db.Setup, + replica.Setup, + user.Setup, nodepools.Setup, storage.Setup, providerconfig.Setup, + database.Setup, instance.Setup, kubernetes.Setup, } { diff --git a/package/crds/database.vultr.upbound.io_connectionpools.yaml b/package/crds/database.vultr.upbound.io_connectionpools.yaml new file mode 100644 index 0000000..23a4df6 --- /dev/null +++ b/package/crds/database.vultr.upbound.io_connectionpools.yaml @@ -0,0 +1,365 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: connectionpools.database.vultr.upbound.io +spec: + group: database.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: ConnectionPool + listKind: ConnectionPoolList + plural: connectionpools + singular: connectionpool + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: ConnectionPool is the Schema for the ConnectionPools API. Provides + a Vultr database connection pool resource. This can be used to create, read, + modify, and delete connection pools for a PostgreSQL managed database on + your Vultr account. + 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: ConnectionPoolSpec defines the desired state of ConnectionPool + 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 ManagementPolicy 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: + database: + description: The logical database to use for the new managed database + connection pool. + type: string + databaseId: + description: The managed database ID you want to attach this connection + pool to. + type: string + mode: + description: The mode to configure for the new managed database + connection pool (session, transaction, statement). + type: string + name: + description: The name of the new managed database connection pool. + type: string + size: + description: The size of the new managed database connection pool. + type: number + username: + description: The database user to use for the new managed database + connection pool. + type: string + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: database is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.database) + - message: databaseId is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) + - message: mode is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.mode) + - message: name is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name) + - message: size is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size) + - message: username is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username) + status: + description: ConnectionPoolStatus defines the observed state of ConnectionPool. + properties: + atProvider: + properties: + database: + description: The logical database to use for the new managed database + connection pool. + type: string + databaseId: + description: The managed database ID you want to attach this connection + pool to. + type: string + id: + type: string + mode: + description: The mode to configure for the new managed database + connection pool (session, transaction, statement). + type: string + name: + description: The name of the new managed database connection pool. + type: string + size: + description: The size of the new managed database connection pool. + type: number + username: + description: The database user to use for the new managed database + connection pool. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/database.vultr.upbound.io_dbs.yaml b/package/crds/database.vultr.upbound.io_dbs.yaml new file mode 100644 index 0000000..5ce4709 --- /dev/null +++ b/package/crds/database.vultr.upbound.io_dbs.yaml @@ -0,0 +1,326 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: dbs.database.vultr.upbound.io +spec: + group: database.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: DB + listKind: DBList + plural: dbs + singular: db + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: DB is the Schema for the DBs API. Provides a Vultr database DB + resource. This can be used to create, read, and delete logical DBs for a + managed database on your Vultr account. + 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: DBSpec defines the desired state of DB + 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 ManagementPolicy 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: + databaseId: + description: The managed database ID you want to attach this logical + DB to. + type: string + name: + description: The name of the new managed database logical DB. + type: string + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: databaseId is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) + - message: name is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name) + status: + description: DBStatus defines the observed state of DB. + properties: + atProvider: + properties: + databaseId: + description: The managed database ID you want to attach this logical + DB to. + type: string + id: + type: string + name: + description: The name of the new managed database logical DB. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/database.vultr.upbound.io_replicas.yaml b/package/crds/database.vultr.upbound.io_replicas.yaml new file mode 100644 index 0000000..be2d2f1 --- /dev/null +++ b/package/crds/database.vultr.upbound.io_replicas.yaml @@ -0,0 +1,478 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: replicas.database.vultr.upbound.io +spec: + group: database.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: Replica + listKind: ReplicaList + plural: replicas + singular: replica + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Replica is the Schema for the Replicas API. Provides a Vultr + database replica resource. This can be used to create, read, modify, and + delete managed database read replicas on your Vultr account. + 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: ReplicaSpec defines the desired state of Replica + 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 ManagementPolicy 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: + databaseId: + description: The managed database ID you want to attach this replica + to. + type: string + label: + description: A label for the managed database read replica. + type: string + mysqlLongQueryTime: + description: The configuration value for the long query time (in + seconds) on the managed database read replica (MySQL engine + types only). + type: number + mysqlRequirePrimaryKey: + description: The configuration value for whether primary keys + are required on the managed database read replica (MySQL engine + types only). + type: boolean + mysqlSlowQueryLog: + description: The configuration value for slow query logging on + the managed database read replica (MySQL engine types only). + type: boolean + mysqlSqlModes: + description: A list of SQL modes currently configured for the + managed database read replica (MySQL engine types only). + items: + type: string + type: array + planDisk: + description: The description of the disk(s) on the managed database + read replica. + type: number + redisEvictionPolicy: + description: The configuration value for the data eviction policy + on the managed database read replica (Redis engine types only). + type: string + region: + description: The ID of the region that the managed database read + replica is to be created in. See List Regions + type: string + tag: + description: The tag to assign to the managed database read replica. + type: string + trustedIps: + description: A list of allowed IP addresses for the managed database + read replica. + items: + type: string + type: array + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: databaseId is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) + - message: label is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: region is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + status: + description: ReplicaStatus defines the observed state of Replica. + properties: + atProvider: + properties: + clusterTimeZone: + description: The configured time zone for the managed database + read replica in TZ database format. + type: string + databaseEngine: + description: The database engine of the managed database read + replica. + type: string + databaseEngineVersion: + description: The database engine version of the managed database + read replica. + type: string + databaseId: + description: The managed database ID you want to attach this replica + to. + type: string + dateCreated: + description: The date the managed database read replica was added + to your Vultr account. + type: string + dbname: + description: The managed database read replica's default logical + database. + type: string + host: + description: The hostname assigned to the managed database read + replica. + type: string + id: + description: The ID of the managed database read replica. + type: string + label: + description: A label for the managed database read replica. + type: string + latestBackup: + description: The date of the latest backup available on the managed + database read replica. + type: string + maintenanceDow: + description: The preferred maintenance day of week for the managed + database read replica. + type: string + maintenanceTime: + description: The preferred maintenance time for the managed database + read replica. + type: string + mysqlLongQueryTime: + description: The configuration value for the long query time (in + seconds) on the managed database read replica (MySQL engine + types only). + type: number + mysqlRequirePrimaryKey: + description: The configuration value for whether primary keys + are required on the managed database read replica (MySQL engine + types only). + type: boolean + mysqlSlowQueryLog: + description: The configuration value for slow query logging on + the managed database read replica (MySQL engine types only). + type: boolean + mysqlSqlModes: + description: A list of SQL modes currently configured for the + managed database read replica (MySQL engine types only). + items: + type: string + type: array + password: + description: The password for the managed database read replica's + primary admin user. + type: string + plan: + description: The managed database read replica's plan ID. + type: string + planDisk: + description: The description of the disk(s) on the managed database + read replica. + type: number + planRam: + description: The amount of memory available on the managed database + read replica in MB. + type: number + planReplicas: + description: The number of standby nodes available on the managed + database read replica. + type: number + planVcpus: + description: The number of virtual CPUs available on the managed + database read replica. + type: number + port: + description: The connection port for the managed database read + replica. + type: string + redisEvictionPolicy: + description: The configuration value for the data eviction policy + on the managed database read replica (Redis engine types only). + type: string + region: + description: The ID of the region that the managed database read + replica is to be created in. See List Regions + type: string + status: + description: The current status of the managed database read replica + (poweroff, rebuilding, rebalancing, running). + type: string + tag: + description: The tag to assign to the managed database read replica. + type: string + trustedIps: + description: A list of allowed IP addresses for the managed database + read replica. + items: + type: string + type: array + user: + description: The primary admin user for the managed database read + replica. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/database.vultr.upbound.io_users.yaml b/package/crds/database.vultr.upbound.io_users.yaml new file mode 100644 index 0000000..eb30306 --- /dev/null +++ b/package/crds/database.vultr.upbound.io_users.yaml @@ -0,0 +1,340 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: users.database.vultr.upbound.io +spec: + group: database.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: User + listKind: UserList + plural: users + singular: user + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: User is the Schema for the Users API. Provides a Vultr database + user resource. This can be used to create, read, modify, and delete users + for a managed database on your Vultr account. + 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: UserSpec defines the desired state of User + 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 ManagementPolicy 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: + databaseId: + description: The managed database ID you want to attach this user + to. + type: string + encryption: + description: The encryption type of the new managed database user's + password (MySQL engine types only - caching_sha2_password, mysql_native_password). + type: string + password: + description: The password of the new managed database user. + type: string + username: + description: The username of the new managed database user. + type: string + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: databaseId is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) + - message: username is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username) + status: + description: UserStatus defines the observed state of User. + properties: + atProvider: + properties: + databaseId: + description: The managed database ID you want to attach this user + to. + type: string + encryption: + description: The encryption type of the new managed database user's + password (MySQL engine types only - caching_sha2_password, mysql_native_password). + type: string + id: + type: string + password: + description: The password of the new managed database user. + type: string + username: + description: The username of the new managed database user. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/vultr.vultr.upbound.io_databases.yaml b/package/crds/vultr.vultr.upbound.io_databases.yaml new file mode 100644 index 0000000..c8364d0 --- /dev/null +++ b/package/crds/vultr.vultr.upbound.io_databases.yaml @@ -0,0 +1,684 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: databases.vultr.vultr.upbound.io +spec: + group: vultr.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: Database + listKind: DatabaseList + plural: databases + singular: database + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Database is the Schema for the Databases API. Provides a Vultr + database resource. This can be used to create, read, modify, and delete + managed databases on your Vultr account. + 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: DatabaseSpec defines the desired state of Database + 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 ManagementPolicy 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: + clusterTimeZone: + description: The configured time zone for the Managed Database + in TZ database format (e.g. UTC, America/New_York, Europe/London). + type: string + databaseEngine: + description: The database engine of the new managed database. + type: string + databaseEngineVersion: + description: The database engine version of the new managed database. + type: string + label: + description: A label for the managed database. + type: string + maintenanceDow: + description: The preferred maintenance day of week for the managed + database. + type: string + maintenanceTime: + description: The preferred maintenance time for the managed database. + type: string + mysqlLongQueryTime: + description: The configuration value for the long query time (in + seconds) on the managed database (MySQL engine types only). + type: number + mysqlRequirePrimaryKey: + description: The configuration value for whether primary keys + are required on the managed database (MySQL engine types only). + type: boolean + mysqlSlowQueryLog: + description: The configuration value for slow query logging on + the managed database (MySQL engine types only). + type: boolean + mysqlSqlModes: + description: A list of SQL modes to configure for the managed + database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, + ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, + IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, + NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, + PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, + TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + items: + type: string + type: array + password: + description: The password for the managed database's primary admin + user. + type: string + plan: + description: The ID of the plan that you want the managed database + to subscribe to. See List Managed Database Plans + type: string + planDisk: + description: The description of the disk(s) on the managed database. + type: number + readReplicas: + description: A list of read replicas attached to the managed database. + items: + properties: + label: + description: A label for the managed database. + type: string + mysqlLongQueryTime: + description: The configuration value for the long query + time (in seconds) on the managed database (MySQL engine + types only). + type: number + mysqlRequirePrimaryKey: + description: The configuration value for whether primary + keys are required on the managed database (MySQL engine + types only). + type: boolean + mysqlSlowQueryLog: + description: The configuration value for slow query logging + on the managed database (MySQL engine types only). + type: boolean + mysqlSqlModes: + description: A list of SQL modes to configure for the managed + database (MySQL engine types only - ALLOW_INVALID_DATES, + ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, + IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, + NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, + NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, + REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, + TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + items: + type: string + type: array + planDisk: + description: The description of the disk(s) on the managed + database. + type: number + redisEvictionPolicy: + description: The configuration value for the data eviction + policy on the managed database (Redis engine types only + - noeviction, allkeys-lru, volatile-lru, allkeys-random, + volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu). + type: string + region: + description: The ID of the region that the managed database + is to be created in. See List Regions + type: string + tag: + description: The tag to assign to the managed database. + type: string + trustedIps: + description: A list of allowed IP addresses for the managed + database. + items: + type: string + type: array + required: + - label + - region + type: object + type: array + redisEvictionPolicy: + description: The configuration value for the data eviction policy + on the managed database (Redis engine types only - noeviction, + allkeys-lru, volatile-lru, allkeys-random, volatile-random, + volatile-ttl, volatile-lfu, allkeys-lfu). + type: string + region: + description: The ID of the region that the managed database is + to be created in. See List Regions + type: string + tag: + description: The tag to assign to the managed database. + type: string + trustedIps: + description: A list of allowed IP addresses for the managed database. + items: + type: string + type: array + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: databaseEngine is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseEngine) + - message: databaseEngineVersion is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseEngineVersion) + - message: label is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.label) + - message: plan is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.plan) + - message: region is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + status: + description: DatabaseStatus defines the observed state of Database. + properties: + atProvider: + properties: + clusterTimeZone: + description: The configured time zone for the Managed Database + in TZ database format (e.g. UTC, America/New_York, Europe/London). + type: string + databaseEngine: + description: The database engine of the new managed database. + type: string + databaseEngineVersion: + description: The database engine version of the new managed database. + type: string + dateCreated: + description: The date the managed database was added to your Vultr + account. + type: string + dbname: + description: The managed database's default logical database. + type: string + host: + description: The hostname assigned to the managed database. + type: string + id: + description: The ID of the managed database. + type: string + label: + description: A label for the managed database. + type: string + latestBackup: + description: The date of the latest backup available on the managed + database. + type: string + maintenanceDow: + description: The preferred maintenance day of week for the managed + database. + type: string + maintenanceTime: + description: The preferred maintenance time for the managed database. + type: string + mysqlLongQueryTime: + description: The configuration value for the long query time (in + seconds) on the managed database (MySQL engine types only). + type: number + mysqlRequirePrimaryKey: + description: The configuration value for whether primary keys + are required on the managed database (MySQL engine types only). + type: boolean + mysqlSlowQueryLog: + description: The configuration value for slow query logging on + the managed database (MySQL engine types only). + type: boolean + mysqlSqlModes: + description: A list of SQL modes to configure for the managed + database (MySQL engine types only - ALLOW_INVALID_DATES, ANSI, + ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, + IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, NO_ENGINE_SUBSTITUTION, + NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, + PIPES_AS_CONCAT, REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, + TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + items: + type: string + type: array + password: + description: The password for the managed database's primary admin + user. + type: string + plan: + description: The ID of the plan that you want the managed database + to subscribe to. See List Managed Database Plans + type: string + planDisk: + description: The description of the disk(s) on the managed database. + type: number + planRam: + description: The amount of memory available on the managed database + in MB. + type: number + planReplicas: + description: The number of standby nodes available on the managed + database. + type: number + planVcpus: + description: The number of virtual CPUs available on the managed + database. + type: number + port: + description: The connection port for the managed database. + type: string + readReplicas: + description: A list of read replicas attached to the managed database. + items: + properties: + clusterTimeZone: + description: The configured time zone for the Managed Database + in TZ database format (e.g. UTC, America/New_York, Europe/London). + type: string + databaseEngine: + description: The database engine of the new managed database. + type: string + databaseEngineVersion: + description: The database engine version of the new managed + database. + type: string + dateCreated: + description: The date the managed database was added to + your Vultr account. + type: string + dbname: + description: The managed database's default logical database. + type: string + host: + description: The hostname assigned to the managed database. + type: string + id: + description: The ID of the managed database. + type: string + label: + description: A label for the managed database. + type: string + latestBackup: + description: The date of the latest backup available on + the managed database. + type: string + maintenanceDow: + description: The preferred maintenance day of week for the + managed database. + type: string + maintenanceTime: + description: The preferred maintenance time for the managed + database. + type: string + mysqlLongQueryTime: + description: The configuration value for the long query + time (in seconds) on the managed database (MySQL engine + types only). + type: number + mysqlRequirePrimaryKey: + description: The configuration value for whether primary + keys are required on the managed database (MySQL engine + types only). + type: boolean + mysqlSlowQueryLog: + description: The configuration value for slow query logging + on the managed database (MySQL engine types only). + type: boolean + mysqlSqlModes: + description: A list of SQL modes to configure for the managed + database (MySQL engine types only - ALLOW_INVALID_DATES, + ANSI, ANSI_QUOTES, ERROR_FOR_DIVISION_BY_ZERO, HIGH_NOT_PRECEDENCE, + IGNORE_SPACE, NO_AUTO_VALUE_ON_ZERO, NO_DIR_IN_CREATE, + NO_ENGINE_SUBSTITUTION, NO_UNSIGNED_SUBTRACTION, NO_ZERO_DATE, + NO_ZERO_IN_DATE, ONLY_FULL_GROUP_BY, PIPES_AS_CONCAT, + REAL_AS_FLOAT, STRICT_ALL_TABLES, STRICT_TRANS_TABLES, + TIME_TRUNCATE_FRACTIONAL, TRADITIONAL). + items: + type: string + type: array + password: + description: The password for the managed database's primary + admin user. + type: string + plan: + description: The ID of the plan that you want the managed + database to subscribe to. See List Managed Database Plans + type: string + planDisk: + description: The description of the disk(s) on the managed + database. + type: number + planRam: + description: The amount of memory available on the managed + database in MB. + type: number + planReplicas: + description: The number of standby nodes available on the + managed database. + type: number + planVcpus: + description: The number of virtual CPUs available on the + managed database. + type: number + port: + description: The connection port for the managed database. + type: string + redisEvictionPolicy: + description: The configuration value for the data eviction + policy on the managed database (Redis engine types only + - noeviction, allkeys-lru, volatile-lru, allkeys-random, + volatile-random, volatile-ttl, volatile-lfu, allkeys-lfu). + type: string + region: + description: The ID of the region that the managed database + is to be created in. See List Regions + type: string + status: + description: The current status of the managed database + (poweroff, rebuilding, rebalancing, running). + type: string + tag: + description: The tag to assign to the managed database. + type: string + trustedIps: + description: A list of allowed IP addresses for the managed + database. + items: + type: string + type: array + user: + description: The primary admin user for the managed database. + type: string + type: object + type: array + redisEvictionPolicy: + description: The configuration value for the data eviction policy + on the managed database (Redis engine types only - noeviction, + allkeys-lru, volatile-lru, allkeys-random, volatile-random, + volatile-ttl, volatile-lfu, allkeys-lfu). + type: string + region: + description: The ID of the region that the managed database is + to be created in. See List Regions + type: string + status: + description: The current status of the managed database (poweroff, + rebuilding, rebalancing, running). + type: string + tag: + description: The tag to assign to the managed database. + type: string + trustedIps: + description: A list of allowed IP addresses for the managed database. + items: + type: string + type: array + user: + description: The primary admin user for the managed database. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From be25dbd54c8a833d46b42adc1fe4c2e742e7620b Mon Sep 17 00:00:00 2001 From: cmondragon Date: Wed, 19 Jul 2023 11:33:23 -0400 Subject: [PATCH 03/13] add vultr resources --- .golangci.yml | 4 +- apis/load/v1alpha1/zz_balancer_types.go | 323 +++++++++ apis/load/v1alpha1/zz_generated.deepcopy.go | 611 +++++++++++++++++ apis/load/v1alpha1/zz_generated.managed.go | 84 +++ .../load/v1alpha1/zz_generated.managedlist.go | 17 + .../load/v1alpha1/zz_generated_terraformed.go | 88 +++ apis/load/v1alpha1/zz_groupversion_info.go | 32 + apis/zz_register.go | 2 + config/external_name.go | 1 + config/loadbalancer/config.go | 8 + config/provider.go | 4 +- examples-generated/load/balancer.yaml | 29 + .../controller/load/balancer/zz_controller.go | 55 ++ internal/controller/zz_setup.go | 2 + .../crds/load.vultr.upbound.io_balancers.yaml | 620 ++++++++++++++++++ 15 files changed, 1876 insertions(+), 4 deletions(-) create mode 100755 apis/load/v1alpha1/zz_balancer_types.go create mode 100644 apis/load/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/load/v1alpha1/zz_generated.managed.go create mode 100644 apis/load/v1alpha1/zz_generated.managedlist.go create mode 100755 apis/load/v1alpha1/zz_generated_terraformed.go create mode 100755 apis/load/v1alpha1/zz_groupversion_info.go create mode 100644 config/loadbalancer/config.go create mode 100644 examples-generated/load/balancer.yaml create mode 100755 internal/controller/load/balancer/zz_controller.go create mode 100644 package/crds/load.vultr.upbound.io_balancers.yaml diff --git a/.golangci.yml b/.golangci.yml index 494a907..1ae4aa4 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -108,12 +108,11 @@ linters: - govet - gocyclo - gocritic - - interfacer - goconst - goimports - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - golint + - revive - unconvert - misspell - nakedret @@ -134,7 +133,6 @@ issues: - errcheck - dupl - gosec - - scopelint - unparam # Ease some gocritic warnings on test files. diff --git a/apis/load/v1alpha1/zz_balancer_types.go b/apis/load/v1alpha1/zz_balancer_types.go new file mode 100755 index 0000000..85e3419 --- /dev/null +++ b/apis/load/v1alpha1/zz_balancer_types.go @@ -0,0 +1,323 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type BalancerObservation struct { + + // Array of instances that are currently attached to the load balancer. + AttachedInstances []*string `json:"attachedInstances,omitempty" tf:"attached_instances,omitempty"` + + // The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin + BalancingAlgorithm *string `json:"balancingAlgorithm,omitempty" tf:"balancing_algorithm,omitempty"` + + // Name for your given sticky session. + CookieName *string `json:"cookieName,omitempty" tf:"cookie_name,omitempty"` + + // Defines the firewall rules for a load balancer. + FirewallRules []FirewallRulesObservation `json:"firewallRules,omitempty" tf:"firewall_rules,omitempty"` + + // List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below. + ForwardingRules []ForwardingRulesObservation `json:"forwardingRules,omitempty" tf:"forwarding_rules,omitempty"` + + // Boolean value that indicates if SSL is enabled. + HasSSL *bool `json:"hasSsl,omitempty" tf:"has_ssl,omitempty"` + + // A block that defines the way load balancers should check for health. The configuration of a health_check is listed below. + HealthCheck []HealthCheckObservation `json:"healthCheck,omitempty" tf:"health_check,omitempty"` + + // The load balancer ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // IPv4 address for your load balancer. + IPv4 *string `json:"ipv4,omitempty" tf:"ipv4,omitempty"` + + // IPv6 address for your load balancer. + IPv6 *string `json:"ipv6,omitempty" tf:"ipv6,omitempty"` + + // The load balancer's label. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // (Deprecated: use vpc instead) A private network ID that the load balancer should be attached to. + PrivateNetwork *string `json:"privateNetwork,omitempty" tf:"private_network,omitempty"` + + // Boolean value that indicates if Proxy Protocol is enabled. + ProxyProtocol *bool `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` + + // The region your load balancer is deployed in. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below. + SSL []SSLObservation `json:"ssl,omitempty" tf:"ssl,omitempty"` + + // Boolean value that indicates if HTTP calls will be redirected to HTTPS. + SSLRedirect *bool `json:"sslRedirect,omitempty" tf:"ssl_redirect,omitempty"` + + // Current status for the load balancer + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // A VPC ID that the load balancer should be attached to. + VPC *string `json:"vpc,omitempty" tf:"vpc,omitempty"` +} + +type BalancerParameters struct { + + // Array of instances that are currently attached to the load balancer. + // +kubebuilder:validation:Optional + AttachedInstances []*string `json:"attachedInstances,omitempty" tf:"attached_instances,omitempty"` + + // The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin + // +kubebuilder:validation:Optional + BalancingAlgorithm *string `json:"balancingAlgorithm,omitempty" tf:"balancing_algorithm,omitempty"` + + // Name for your given sticky session. + // +kubebuilder:validation:Optional + CookieName *string `json:"cookieName,omitempty" tf:"cookie_name,omitempty"` + + // Defines the firewall rules for a load balancer. + // +kubebuilder:validation:Optional + FirewallRules []FirewallRulesParameters `json:"firewallRules,omitempty" tf:"firewall_rules,omitempty"` + + // List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below. + // +kubebuilder:validation:Optional + ForwardingRules []ForwardingRulesParameters `json:"forwardingRules,omitempty" tf:"forwarding_rules,omitempty"` + + // A block that defines the way load balancers should check for health. The configuration of a health_check is listed below. + // +kubebuilder:validation:Optional + HealthCheck []HealthCheckParameters `json:"healthCheck,omitempty" tf:"health_check,omitempty"` + + // The load balancer's label. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // (Deprecated: use vpc instead) A private network ID that the load balancer should be attached to. + // +kubebuilder:validation:Optional + PrivateNetwork *string `json:"privateNetwork,omitempty" tf:"private_network,omitempty"` + + // Boolean value that indicates if Proxy Protocol is enabled. + // +kubebuilder:validation:Optional + ProxyProtocol *bool `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` + + // The region your load balancer is deployed in. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below. + // +kubebuilder:validation:Optional + SSL []SSLParameters `json:"ssl,omitempty" tf:"ssl,omitempty"` + + // Boolean value that indicates if HTTP calls will be redirected to HTTPS. + // +kubebuilder:validation:Optional + SSLRedirect *bool `json:"sslRedirect,omitempty" tf:"ssl_redirect,omitempty"` + + // A VPC ID that the load balancer should be attached to. + // +kubebuilder:validation:Optional + VPC *string `json:"vpc,omitempty" tf:"vpc,omitempty"` +} + +type FirewallRulesObservation struct { + + // The load balancer ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The type of ip this rule is - may be either v4 or v6. + IPType *string `json:"ipType,omitempty" tf:"ip_type,omitempty"` + + // The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range. + Source *string `json:"source,omitempty" tf:"source,omitempty"` +} + +type FirewallRulesParameters struct { + + // The type of ip this rule is - may be either v4 or v6. + // +kubebuilder:validation:Required + IPType *string `json:"ipType" tf:"ip_type,omitempty"` + + // The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80. + // +kubebuilder:validation:Required + Port *float64 `json:"port" tf:"port,omitempty"` + + // IP address with subnet that is allowed through the firewall. You may also pass in cloudflare which will allow only CloudFlares IP range. + // +kubebuilder:validation:Required + Source *string `json:"source" tf:"source,omitempty"` +} + +type ForwardingRulesObservation struct { + + // Port on instance side. + BackendPort *float64 `json:"backendPort,omitempty" tf:"backend_port,omitempty"` + + // Protocol on instance side. Possible values: "http", "https", "tcp". + BackendProtocol *string `json:"backendProtocol,omitempty" tf:"backend_protocol,omitempty"` + + // Port on load balancer side. + FrontendPort *float64 `json:"frontendPort,omitempty" tf:"frontend_port,omitempty"` + + // Protocol on load balancer side. Possible values: "http", "https", "tcp". + FrontendProtocol *string `json:"frontendProtocol,omitempty" tf:"frontend_protocol,omitempty"` + + // The load balancer ID. + RuleID *string `json:"ruleId,omitempty" tf:"rule_id,omitempty"` +} + +type ForwardingRulesParameters struct { + + // Port on instance side. + // +kubebuilder:validation:Required + BackendPort *float64 `json:"backendPort" tf:"backend_port,omitempty"` + + // Protocol on instance side. Possible values: "http", "https", "tcp". + // +kubebuilder:validation:Required + BackendProtocol *string `json:"backendProtocol" tf:"backend_protocol,omitempty"` + + // Port on load balancer side. + // +kubebuilder:validation:Required + FrontendPort *float64 `json:"frontendPort" tf:"frontend_port,omitempty"` + + // Protocol on load balancer side. Possible values: "http", "https", "tcp". + // +kubebuilder:validation:Required + FrontendProtocol *string `json:"frontendProtocol" tf:"frontend_protocol,omitempty"` +} + +type HealthCheckObservation struct { + + // Time in seconds to perform health check. Default value is 15. + CheckInterval *float64 `json:"checkInterval,omitempty" tf:"check_interval,omitempty"` + + // Number of failed attempts encountered before failover. Default value is 5. + HealthyThreshold *float64 `json:"healthyThreshold,omitempty" tf:"healthy_threshold,omitempty"` + + // The path on the attached instances that the load balancer should check against. Default value is / + Path *string `json:"path,omitempty" tf:"path,omitempty"` + + // The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http. + Protocol *string `json:"protocol,omitempty" tf:"protocol,omitempty"` + + // Time in seconds to wait for a health check response. Default value is 5. + ResponseTimeout *float64 `json:"responseTimeout,omitempty" tf:"response_timeout,omitempty"` + + // Number of failed attempts encountered before failover. Default value is 5. + UnhealthyThreshold *float64 `json:"unhealthyThreshold,omitempty" tf:"unhealthy_threshold,omitempty"` +} + +type HealthCheckParameters struct { + + // Time in seconds to perform health check. Default value is 15. + // +kubebuilder:validation:Required + CheckInterval *float64 `json:"checkInterval" tf:"check_interval,omitempty"` + + // Number of failed attempts encountered before failover. Default value is 5. + // +kubebuilder:validation:Required + HealthyThreshold *float64 `json:"healthyThreshold" tf:"healthy_threshold,omitempty"` + + // The path on the attached instances that the load balancer should check against. Default value is / + // +kubebuilder:validation:Optional + Path *string `json:"path,omitempty" tf:"path,omitempty"` + + // The assigned port (integer) on the attached instances that the load balancer should check against. Default value is 80. + // +kubebuilder:validation:Required + Port *float64 `json:"port" tf:"port,omitempty"` + + // The protocol used to traffic requests to the load balancer. Possible values are http, or tcp. Default value is http. + // +kubebuilder:validation:Required + Protocol *string `json:"protocol" tf:"protocol,omitempty"` + + // Time in seconds to wait for a health check response. Default value is 5. + // +kubebuilder:validation:Required + ResponseTimeout *float64 `json:"responseTimeout" tf:"response_timeout,omitempty"` + + // Number of failed attempts encountered before failover. Default value is 5. + // +kubebuilder:validation:Required + UnhealthyThreshold *float64 `json:"unhealthyThreshold" tf:"unhealthy_threshold,omitempty"` +} + +type SSLObservation struct { + + // The SSL Certificate. + Certificate *string `json:"certificate,omitempty" tf:"certificate,omitempty"` + + // The SSL certificate chain. + Chain *string `json:"chain,omitempty" tf:"chain,omitempty"` +} + +type SSLParameters struct { + + // The SSL Certificate. + // +kubebuilder:validation:Required + Certificate *string `json:"certificate" tf:"certificate,omitempty"` + + // The SSL certificate chain. + // +kubebuilder:validation:Optional + Chain *string `json:"chain,omitempty" tf:"chain,omitempty"` + + // The SSL certificates private key. + // +kubebuilder:validation:Required + PrivateKeySecretRef v1.SecretKeySelector `json:"privateKeySecretRef" tf:"-"` +} + +// BalancerSpec defines the desired state of Balancer +type BalancerSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider BalancerParameters `json:"forProvider"` +} + +// BalancerStatus defines the observed state of Balancer. +type BalancerStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider BalancerObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Balancer is the Schema for the Balancers API. Get information about a Vultr Load Balancer. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type Balancer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.forwardingRules)",message="forwardingRules is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + Spec BalancerSpec `json:"spec"` + Status BalancerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// BalancerList contains a list of Balancers +type BalancerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Balancer `json:"items"` +} + +// Repository type metadata. +var ( + Balancer_Kind = "Balancer" + Balancer_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Balancer_Kind}.String() + Balancer_KindAPIVersion = Balancer_Kind + "." + CRDGroupVersion.String() + Balancer_GroupVersionKind = CRDGroupVersion.WithKind(Balancer_Kind) +) + +func init() { + SchemeBuilder.Register(&Balancer{}, &BalancerList{}) +} diff --git a/apis/load/v1alpha1/zz_generated.deepcopy.go b/apis/load/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..c8d4fe9 --- /dev/null +++ b/apis/load/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,611 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// 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 *Balancer) DeepCopyInto(out *Balancer) { + *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 Balancer. +func (in *Balancer) DeepCopy() *Balancer { + if in == nil { + return nil + } + out := new(Balancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Balancer) 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 *BalancerList) DeepCopyInto(out *BalancerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Balancer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerList. +func (in *BalancerList) DeepCopy() *BalancerList { + if in == nil { + return nil + } + out := new(BalancerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BalancerList) 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 *BalancerObservation) DeepCopyInto(out *BalancerObservation) { + *out = *in + if in.AttachedInstances != nil { + in, out := &in.AttachedInstances, &out.AttachedInstances + *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.BalancingAlgorithm != nil { + in, out := &in.BalancingAlgorithm, &out.BalancingAlgorithm + *out = new(string) + **out = **in + } + if in.CookieName != nil { + in, out := &in.CookieName, &out.CookieName + *out = new(string) + **out = **in + } + if in.FirewallRules != nil { + in, out := &in.FirewallRules, &out.FirewallRules + *out = make([]FirewallRulesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ForwardingRules != nil { + in, out := &in.ForwardingRules, &out.ForwardingRules + *out = make([]ForwardingRulesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.HasSSL != nil { + in, out := &in.HasSSL, &out.HasSSL + *out = new(bool) + **out = **in + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = make([]HealthCheckObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IPv4 != nil { + in, out := &in.IPv4, &out.IPv4 + *out = new(string) + **out = **in + } + if in.IPv6 != nil { + in, out := &in.IPv6, &out.IPv6 + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.PrivateNetwork != nil { + in, out := &in.PrivateNetwork, &out.PrivateNetwork + *out = new(string) + **out = **in + } + if in.ProxyProtocol != nil { + in, out := &in.ProxyProtocol, &out.ProxyProtocol + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SSL != nil { + in, out := &in.SSL, &out.SSL + *out = make([]SSLObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SSLRedirect != nil { + in, out := &in.SSLRedirect, &out.SSLRedirect + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerObservation. +func (in *BalancerObservation) DeepCopy() *BalancerObservation { + if in == nil { + return nil + } + out := new(BalancerObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BalancerParameters) DeepCopyInto(out *BalancerParameters) { + *out = *in + if in.AttachedInstances != nil { + in, out := &in.AttachedInstances, &out.AttachedInstances + *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.BalancingAlgorithm != nil { + in, out := &in.BalancingAlgorithm, &out.BalancingAlgorithm + *out = new(string) + **out = **in + } + if in.CookieName != nil { + in, out := &in.CookieName, &out.CookieName + *out = new(string) + **out = **in + } + if in.FirewallRules != nil { + in, out := &in.FirewallRules, &out.FirewallRules + *out = make([]FirewallRulesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ForwardingRules != nil { + in, out := &in.ForwardingRules, &out.ForwardingRules + *out = make([]ForwardingRulesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = make([]HealthCheckParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.PrivateNetwork != nil { + in, out := &in.PrivateNetwork, &out.PrivateNetwork + *out = new(string) + **out = **in + } + if in.ProxyProtocol != nil { + in, out := &in.ProxyProtocol, &out.ProxyProtocol + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SSL != nil { + in, out := &in.SSL, &out.SSL + *out = make([]SSLParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SSLRedirect != nil { + in, out := &in.SSLRedirect, &out.SSLRedirect + *out = new(bool) + **out = **in + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerParameters. +func (in *BalancerParameters) DeepCopy() *BalancerParameters { + if in == nil { + return nil + } + out := new(BalancerParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BalancerSpec) DeepCopyInto(out *BalancerSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerSpec. +func (in *BalancerSpec) DeepCopy() *BalancerSpec { + if in == nil { + return nil + } + out := new(BalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BalancerStatus) DeepCopyInto(out *BalancerStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerStatus. +func (in *BalancerStatus) DeepCopy() *BalancerStatus { + if in == nil { + return nil + } + out := new(BalancerStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallRulesObservation) DeepCopyInto(out *FirewallRulesObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IPType != nil { + in, out := &in.IPType, &out.IPType + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallRulesObservation. +func (in *FirewallRulesObservation) DeepCopy() *FirewallRulesObservation { + if in == nil { + return nil + } + out := new(FirewallRulesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallRulesParameters) DeepCopyInto(out *FirewallRulesParameters) { + *out = *in + if in.IPType != nil { + in, out := &in.IPType, &out.IPType + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallRulesParameters. +func (in *FirewallRulesParameters) DeepCopy() *FirewallRulesParameters { + if in == nil { + return nil + } + out := new(FirewallRulesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForwardingRulesObservation) DeepCopyInto(out *ForwardingRulesObservation) { + *out = *in + if in.BackendPort != nil { + in, out := &in.BackendPort, &out.BackendPort + *out = new(float64) + **out = **in + } + if in.BackendProtocol != nil { + in, out := &in.BackendProtocol, &out.BackendProtocol + *out = new(string) + **out = **in + } + if in.FrontendPort != nil { + in, out := &in.FrontendPort, &out.FrontendPort + *out = new(float64) + **out = **in + } + if in.FrontendProtocol != nil { + in, out := &in.FrontendProtocol, &out.FrontendProtocol + *out = new(string) + **out = **in + } + if in.RuleID != nil { + in, out := &in.RuleID, &out.RuleID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForwardingRulesObservation. +func (in *ForwardingRulesObservation) DeepCopy() *ForwardingRulesObservation { + if in == nil { + return nil + } + out := new(ForwardingRulesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForwardingRulesParameters) DeepCopyInto(out *ForwardingRulesParameters) { + *out = *in + if in.BackendPort != nil { + in, out := &in.BackendPort, &out.BackendPort + *out = new(float64) + **out = **in + } + if in.BackendProtocol != nil { + in, out := &in.BackendProtocol, &out.BackendProtocol + *out = new(string) + **out = **in + } + if in.FrontendPort != nil { + in, out := &in.FrontendPort, &out.FrontendPort + *out = new(float64) + **out = **in + } + if in.FrontendProtocol != nil { + in, out := &in.FrontendProtocol, &out.FrontendProtocol + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForwardingRulesParameters. +func (in *ForwardingRulesParameters) DeepCopy() *ForwardingRulesParameters { + if in == nil { + return nil + } + out := new(ForwardingRulesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckObservation) DeepCopyInto(out *HealthCheckObservation) { + *out = *in + if in.CheckInterval != nil { + in, out := &in.CheckInterval, &out.CheckInterval + *out = new(float64) + **out = **in + } + if in.HealthyThreshold != nil { + in, out := &in.HealthyThreshold, &out.HealthyThreshold + *out = new(float64) + **out = **in + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ResponseTimeout != nil { + in, out := &in.ResponseTimeout, &out.ResponseTimeout + *out = new(float64) + **out = **in + } + if in.UnhealthyThreshold != nil { + in, out := &in.UnhealthyThreshold, &out.UnhealthyThreshold + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckObservation. +func (in *HealthCheckObservation) DeepCopy() *HealthCheckObservation { + if in == nil { + return nil + } + out := new(HealthCheckObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckParameters) DeepCopyInto(out *HealthCheckParameters) { + *out = *in + if in.CheckInterval != nil { + in, out := &in.CheckInterval, &out.CheckInterval + *out = new(float64) + **out = **in + } + if in.HealthyThreshold != nil { + in, out := &in.HealthyThreshold, &out.HealthyThreshold + *out = new(float64) + **out = **in + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ResponseTimeout != nil { + in, out := &in.ResponseTimeout, &out.ResponseTimeout + *out = new(float64) + **out = **in + } + if in.UnhealthyThreshold != nil { + in, out := &in.UnhealthyThreshold, &out.UnhealthyThreshold + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckParameters. +func (in *HealthCheckParameters) DeepCopy() *HealthCheckParameters { + if in == nil { + return nil + } + out := new(HealthCheckParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSLObservation) DeepCopyInto(out *SSLObservation) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.Chain != nil { + in, out := &in.Chain, &out.Chain + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSLObservation. +func (in *SSLObservation) DeepCopy() *SSLObservation { + if in == nil { + return nil + } + out := new(SSLObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSLParameters) DeepCopyInto(out *SSLParameters) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.Chain != nil { + in, out := &in.Chain, &out.Chain + *out = new(string) + **out = **in + } + out.PrivateKeySecretRef = in.PrivateKeySecretRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSLParameters. +func (in *SSLParameters) DeepCopy() *SSLParameters { + if in == nil { + return nil + } + out := new(SSLParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/load/v1alpha1/zz_generated.managed.go b/apis/load/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..e16c073 --- /dev/null +++ b/apis/load/v1alpha1/zz_generated.managed.go @@ -0,0 +1,84 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this Balancer. +func (mg *Balancer) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Balancer. +func (mg *Balancer) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Balancer. +func (mg *Balancer) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Balancer. +func (mg *Balancer) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Balancer. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Balancer) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Balancer. +func (mg *Balancer) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Balancer. +func (mg *Balancer) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Balancer. +func (mg *Balancer) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Balancer. +func (mg *Balancer) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Balancer. +func (mg *Balancer) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Balancer. +func (mg *Balancer) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Balancer. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Balancer) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Balancer. +func (mg *Balancer) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Balancer. +func (mg *Balancer) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/load/v1alpha1/zz_generated.managedlist.go b/apis/load/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..8859186 --- /dev/null +++ b/apis/load/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,17 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this BalancerList. +func (l *BalancerList) 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/load/v1alpha1/zz_generated_terraformed.go b/apis/load/v1alpha1/zz_generated_terraformed.go new file mode 100755 index 0000000..bec05c4 --- /dev/null +++ b/apis/load/v1alpha1/zz_generated_terraformed.go @@ -0,0 +1,88 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/pkg/errors" + + "github.com/upbound/upjet/pkg/resource" + "github.com/upbound/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Balancer +func (mg *Balancer) GetTerraformResourceType() string { + return "vultr_load_balancer" +} + +// GetConnectionDetailsMapping for this Balancer +func (tr *Balancer) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ssl[*].private_key": "spec.forProvider.ssl[*].privateKeySecretRef"} +} + +// GetObservation of this Balancer +func (tr *Balancer) 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 Balancer +func (tr *Balancer) 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 Balancer +func (tr *Balancer) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Balancer +func (tr *Balancer) 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 Balancer +func (tr *Balancer) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Balancer using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Balancer) LateInitialize(attrs []byte) (bool, error) { + params := &BalancerParameters{} + 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 *Balancer) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/load/v1alpha1/zz_groupversion_info.go b/apis/load/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..d1c9f32 --- /dev/null +++ b/apis/load/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=load.vultr.upbound.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "load.vultr.upbound.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/zz_register.go b/apis/zz_register.go index 2c798d3..f791422 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -12,6 +12,7 @@ import ( v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" v1alpha1kubernetes "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" + v1alpha1load "github.com/crossplane-contrib/provider-vultr/apis/load/v1alpha1" v1alpha1object "github.com/crossplane-contrib/provider-vultr/apis/object/v1alpha1" v1alpha1apis "github.com/crossplane-contrib/provider-vultr/apis/v1alpha1" v1beta1 "github.com/crossplane-contrib/provider-vultr/apis/v1beta1" @@ -23,6 +24,7 @@ func init() { AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha1kubernetes.SchemeBuilder.AddToScheme, + v1alpha1load.SchemeBuilder.AddToScheme, v1alpha1object.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index 3f691f5..1303de0 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -20,6 +20,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "vultr_database_db": config.IdentifierFromProvider, "vultr_database_replica": config.IdentifierFromProvider, "vultr_database_user": config.IdentifierFromProvider, + "vultr_load_balancer": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/loadbalancer/config.go b/config/loadbalancer/config.go new file mode 100644 index 0000000..bdb7d87 --- /dev/null +++ b/config/loadbalancer/config.go @@ -0,0 +1,8 @@ +package loadbalancer + +import "github.com/upbound/upjet/pkg/config" + +func Configure(p *config.Provider) { + p.AddResourceConfigurator("vultr_load_balancer", func(r *config.Resource) { + }) +} diff --git a/config/provider.go b/config/provider.go index 3278ebf..42ccd3b 100644 --- a/config/provider.go +++ b/config/provider.go @@ -10,9 +10,10 @@ import ( ujconfig "github.com/upbound/upjet/pkg/config" - "github.com/crossplane-contrib/provider-vultr/config/database" "github.com/crossplane-contrib/provider-vultr/config/compute" + "github.com/crossplane-contrib/provider-vultr/config/database" "github.com/crossplane-contrib/provider-vultr/config/kubernetes" + "github.com/crossplane-contrib/provider-vultr/config/loadbalancer" "github.com/crossplane-contrib/provider-vultr/config/nodepools" "github.com/crossplane-contrib/provider-vultr/config/object" ) @@ -43,6 +44,7 @@ func GetProvider() *ujconfig.Provider { object.Configure, compute.Configure, database.Configure, + loadbalancer.Configure, } { configure(pc) } diff --git a/examples-generated/load/balancer.yaml b/examples-generated/load/balancer.yaml new file mode 100644 index 0000000..5d628c2 --- /dev/null +++ b/examples-generated/load/balancer.yaml @@ -0,0 +1,29 @@ +apiVersion: load.vultr.upbound.io/v1alpha1 +kind: Balancer +metadata: + annotations: + meta.upbound.io/example-id: load/v1alpha1/balancer + labels: + testing.upbound.io/example-name: lb + name: lb +spec: + forProvider: + balancingAlgorithm: roundrobin + forwardingRules: + - backendPort: 81 + backendProtocol: http + frontendPort: 82 + frontendProtocol: http + healthCheck: + - checkInterval: 3 + healthyThreshold: 4 + path: /test + port: "8080" + protocol: http + responseTimeout: 1 + unhealthyThreshold: 2 + label: terraform lb example + region: ewr + +--- + diff --git a/internal/controller/load/balancer/zz_controller.go b/internal/controller/load/balancer/zz_controller.go new file mode 100755 index 0000000..4321952 --- /dev/null +++ b/internal/controller/load/balancer/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package balancer + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/load/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles Balancer managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Balancer_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_load_balancer"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Balancer_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Balancer_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Balancer{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 68d370e..4dc7960 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -14,6 +14,7 @@ import ( replica "github.com/crossplane-contrib/provider-vultr/internal/controller/database/replica" user "github.com/crossplane-contrib/provider-vultr/internal/controller/database/user" nodepools "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/nodepools" + balancer "github.com/crossplane-contrib/provider-vultr/internal/controller/load/balancer" storage "github.com/crossplane-contrib/provider-vultr/internal/controller/object/storage" providerconfig "github.com/crossplane-contrib/provider-vultr/internal/controller/providerconfig" database "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/database" @@ -30,6 +31,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { replica.Setup, user.Setup, nodepools.Setup, + balancer.Setup, storage.Setup, providerconfig.Setup, database.Setup, diff --git a/package/crds/load.vultr.upbound.io_balancers.yaml b/package/crds/load.vultr.upbound.io_balancers.yaml new file mode 100644 index 0000000..46f1059 --- /dev/null +++ b/package/crds/load.vultr.upbound.io_balancers.yaml @@ -0,0 +1,620 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: balancers.load.vultr.upbound.io +spec: + group: load.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: Balancer + listKind: BalancerList + plural: balancers + singular: balancer + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Balancer is the Schema for the Balancers API. Get information + about a Vultr Load Balancer. + 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: BalancerSpec defines the desired state of Balancer + 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 ManagementPolicy 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: + attachedInstances: + description: Array of instances that are currently attached to + the load balancer. + items: + type: string + type: array + balancingAlgorithm: + description: The balancing algorithm for your load balancer. Options + are roundrobin or leastconn. Default value is roundrobin + type: string + cookieName: + description: Name for your given sticky session. + type: string + firewallRules: + description: Defines the firewall rules for a load balancer. + items: + properties: + ipType: + description: The type of ip this rule is - may be either + v4 or v6. + type: string + port: + description: The assigned port (integer) on the attached + instances that the load balancer should check against. + Default value is 80. + type: number + source: + description: IP address with subnet that is allowed through + the firewall. You may also pass in cloudflare which will + allow only CloudFlares IP range. + type: string + required: + - ipType + - port + - source + type: object + type: array + forwardingRules: + description: List of forwarding rules for a load balancer. The + configuration of a forwarding_rules is listened below. + items: + properties: + backendPort: + description: Port on instance side. + type: number + backendProtocol: + description: 'Protocol on instance side. Possible values: + "http", "https", "tcp".' + type: string + frontendPort: + description: Port on load balancer side. + type: number + frontendProtocol: + description: 'Protocol on load balancer side. Possible values: + "http", "https", "tcp".' + type: string + required: + - backendPort + - backendProtocol + - frontendPort + - frontendProtocol + type: object + type: array + healthCheck: + description: A block that defines the way load balancers should + check for health. The configuration of a health_check is listed + below. + items: + properties: + checkInterval: + description: Time in seconds to perform health check. Default + value is 15. + type: number + healthyThreshold: + description: Number of failed attempts encountered before + failover. Default value is 5. + type: number + path: + description: The path on the attached instances that the + load balancer should check against. Default value is / + type: string + port: + description: The assigned port (integer) on the attached + instances that the load balancer should check against. + Default value is 80. + type: number + protocol: + description: The protocol used to traffic requests to the + load balancer. Possible values are http, or tcp. Default + value is http. + type: string + responseTimeout: + description: Time in seconds to wait for a health check + response. Default value is 5. + type: number + unhealthyThreshold: + description: Number of failed attempts encountered before + failover. Default value is 5. + type: number + required: + - checkInterval + - healthyThreshold + - port + - protocol + - responseTimeout + - unhealthyThreshold + type: object + type: array + label: + description: The load balancer's label. + type: string + privateNetwork: + description: '(Deprecated: use vpc instead) A private network + ID that the load balancer should be attached to.' + type: string + proxyProtocol: + description: Boolean value that indicates if Proxy Protocol is + enabled. + type: boolean + region: + description: The region your load balancer is deployed in. + type: string + ssl: + description: A block that supplies your ssl configuration to be + used with HTTPS. The configuration of a ssl is listed below. + items: + properties: + certificate: + description: The SSL Certificate. + type: string + chain: + description: The SSL certificate chain. + type: string + privateKeySecretRef: + description: The SSL certificates private key. + 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 + required: + - certificate + - privateKeySecretRef + type: object + type: array + sslRedirect: + description: Boolean value that indicates if HTTP calls will be + redirected to HTTPS. + type: boolean + vpc: + description: A VPC ID that the load balancer should be attached + to. + type: string + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: forwardingRules is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.forwardingRules) + - message: region is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + status: + description: BalancerStatus defines the observed state of Balancer. + properties: + atProvider: + properties: + attachedInstances: + description: Array of instances that are currently attached to + the load balancer. + items: + type: string + type: array + balancingAlgorithm: + description: The balancing algorithm for your load balancer. Options + are roundrobin or leastconn. Default value is roundrobin + type: string + cookieName: + description: Name for your given sticky session. + type: string + firewallRules: + description: Defines the firewall rules for a load balancer. + items: + properties: + id: + description: The load balancer ID. + type: string + ipType: + description: The type of ip this rule is - may be either + v4 or v6. + type: string + port: + description: The assigned port (integer) on the attached + instances that the load balancer should check against. + Default value is 80. + type: number + source: + description: IP address with subnet that is allowed through + the firewall. You may also pass in cloudflare which will + allow only CloudFlares IP range. + type: string + type: object + type: array + forwardingRules: + description: List of forwarding rules for a load balancer. The + configuration of a forwarding_rules is listened below. + items: + properties: + backendPort: + description: Port on instance side. + type: number + backendProtocol: + description: 'Protocol on instance side. Possible values: + "http", "https", "tcp".' + type: string + frontendPort: + description: Port on load balancer side. + type: number + frontendProtocol: + description: 'Protocol on load balancer side. Possible values: + "http", "https", "tcp".' + type: string + ruleId: + description: The load balancer ID. + type: string + type: object + type: array + hasSsl: + description: Boolean value that indicates if SSL is enabled. + type: boolean + healthCheck: + description: A block that defines the way load balancers should + check for health. The configuration of a health_check is listed + below. + items: + properties: + checkInterval: + description: Time in seconds to perform health check. Default + value is 15. + type: number + healthyThreshold: + description: Number of failed attempts encountered before + failover. Default value is 5. + type: number + path: + description: The path on the attached instances that the + load balancer should check against. Default value is / + type: string + port: + description: The assigned port (integer) on the attached + instances that the load balancer should check against. + Default value is 80. + type: number + protocol: + description: The protocol used to traffic requests to the + load balancer. Possible values are http, or tcp. Default + value is http. + type: string + responseTimeout: + description: Time in seconds to wait for a health check + response. Default value is 5. + type: number + unhealthyThreshold: + description: Number of failed attempts encountered before + failover. Default value is 5. + type: number + type: object + type: array + id: + description: The load balancer ID. + type: string + ipv4: + description: IPv4 address for your load balancer. + type: string + ipv6: + description: IPv6 address for your load balancer. + type: string + label: + description: The load balancer's label. + type: string + privateNetwork: + description: '(Deprecated: use vpc instead) A private network + ID that the load balancer should be attached to.' + type: string + proxyProtocol: + description: Boolean value that indicates if Proxy Protocol is + enabled. + type: boolean + region: + description: The region your load balancer is deployed in. + type: string + ssl: + description: A block that supplies your ssl configuration to be + used with HTTPS. The configuration of a ssl is listed below. + items: + properties: + certificate: + description: The SSL Certificate. + type: string + chain: + description: The SSL certificate chain. + type: string + type: object + type: array + sslRedirect: + description: Boolean value that indicates if HTTP calls will be + redirected to HTTPS. + type: boolean + status: + description: Current status for the load balancer + type: string + vpc: + description: A VPC ID that the load balancer should be attached + to. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From 93a46fe1cc1ed849859610e65378b087af160473 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Mon, 14 Aug 2023 11:57:21 -0400 Subject: [PATCH 04/13] format provider resources --- .../v1alpha1/zz_connectionpool_types.go | 8 - apis/database/v1alpha1/zz_db_types.go | 8 - .../v1alpha1/zz_generated.deepcopy.go | 20 - apis/load/v1alpha1/zz_generated.deepcopy.go | 611 ----------- apis/load/v1alpha1/zz_generated.managed.go | 84 -- .../load/v1alpha1/zz_generated.managedlist.go | 17 - .../load/v1alpha1/zz_generated_terraformed.go | 88 -- apis/load/v1alpha1/zz_groupversion_info.go | 32 - .../v1alpha1/zz_baremetalserver_types.go | 218 ++++ apis/vultr/v1alpha1/zz_generated.deepcopy.go | 966 +++++++++++++++++- apis/vultr/v1alpha1/zz_generated.managed.go | 152 +++ .../v1alpha1/zz_generated.managedlist.go | 18 + .../v1alpha1/zz_generated_terraformed.go | 148 +++ .../v1alpha1/zz_loadbalancer_types.go} | 260 ++--- apis/zz_register.go | 2 - config/baremetal/config.go | 9 + config/external_name.go | 17 +- config/groups.go | 54 + config/kubernetes/config.go | 3 + config/loadbalancer/config.go | 1 + config/nodepools/config.go | 8 - config/provider.go | 14 +- .../database/connectionpool.yaml | 1 - examples-generated/database/db.yaml | 1 - examples-generated/vultr/baremetalserver.yaml | 16 + .../balancer.yaml => vultr/loadbalancer.yaml} | 6 +- .../database/connectionpool/zz_controller.go | 1 + .../controller/database/db/zz_controller.go | 1 + .../database/replica/zz_controller.go | 1 + .../controller/database/user/zz_controller.go | 1 + .../vultr/baremetalserver/zz_controller.go | 56 + .../vultr/database/zz_controller.go | 1 + .../loadbalancer}/zz_controller.go | 15 +- internal/controller/zz_setup.go | 6 +- ...base.vultr.upbound.io_connectionpools.yaml | 8 - .../crds/database.vultr.upbound.io_dbs.yaml | 8 - ...ltr.vultr.upbound.io_baremetalservers.yaml | 481 +++++++++ ...vultr.vultr.upbound.io_loadbalancers.yaml} | 18 +- 38 files changed, 2300 insertions(+), 1059 deletions(-) delete mode 100644 apis/load/v1alpha1/zz_generated.deepcopy.go delete mode 100644 apis/load/v1alpha1/zz_generated.managed.go delete mode 100644 apis/load/v1alpha1/zz_generated.managedlist.go delete mode 100755 apis/load/v1alpha1/zz_generated_terraformed.go delete mode 100755 apis/load/v1alpha1/zz_groupversion_info.go create mode 100755 apis/vultr/v1alpha1/zz_baremetalserver_types.go rename apis/{load/v1alpha1/zz_balancer_types.go => vultr/v1alpha1/zz_loadbalancer_types.go} (91%) create mode 100644 config/baremetal/config.go create mode 100644 config/groups.go delete mode 100644 config/nodepools/config.go create mode 100644 examples-generated/vultr/baremetalserver.yaml rename examples-generated/{load/balancer.yaml => vultr/loadbalancer.yaml} (80%) create mode 100755 internal/controller/vultr/baremetalserver/zz_controller.go rename internal/controller/{load/balancer => vultr/loadbalancer}/zz_controller.go (80%) create mode 100644 package/crds/vultr.vultr.upbound.io_baremetalservers.yaml rename package/crds/{load.vultr.upbound.io_balancers.yaml => vultr.vultr.upbound.io_loadbalancers.yaml} (98%) diff --git a/apis/database/v1alpha1/zz_connectionpool_types.go b/apis/database/v1alpha1/zz_connectionpool_types.go index d6a6de4..c1a9847 100755 --- a/apis/database/v1alpha1/zz_connectionpool_types.go +++ b/apis/database/v1alpha1/zz_connectionpool_types.go @@ -26,9 +26,6 @@ type ConnectionPoolObservation struct { // The mode to configure for the new managed database connection pool (session, transaction, statement). Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` - // The name of the new managed database connection pool. - Name *string `json:"name,omitempty" tf:"name,omitempty"` - // The size of the new managed database connection pool. Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -50,10 +47,6 @@ type ConnectionPoolParameters struct { // +kubebuilder:validation:Optional Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` - // The name of the new managed database connection pool. - // +kubebuilder:validation:Optional - Name *string `json:"name,omitempty" tf:"name,omitempty"` - // The size of the new managed database connection pool. // +kubebuilder:validation:Optional Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -90,7 +83,6 @@ type ConnectionPool struct { // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.database)",message="database is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.mode)",message="mode is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size)",message="size is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username)",message="username is a required parameter" Spec ConnectionPoolSpec `json:"spec"` diff --git a/apis/database/v1alpha1/zz_db_types.go b/apis/database/v1alpha1/zz_db_types.go index aae31d7..728943f 100755 --- a/apis/database/v1alpha1/zz_db_types.go +++ b/apis/database/v1alpha1/zz_db_types.go @@ -19,9 +19,6 @@ type DBObservation struct { DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // The name of the new managed database logical DB. - Name *string `json:"name,omitempty" tf:"name,omitempty"` } type DBParameters struct { @@ -29,10 +26,6 @@ type DBParameters struct { // The managed database ID you want to attach this logical DB to. // +kubebuilder:validation:Optional DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` - - // The name of the new managed database logical DB. - // +kubebuilder:validation:Optional - Name *string `json:"name,omitempty" tf:"name,omitempty"` } // DBSpec defines the desired state of DB @@ -60,7 +53,6 @@ type DB struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" - // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter" Spec DBSpec `json:"spec"` Status DBStatus `json:"status,omitempty"` } diff --git a/apis/database/v1alpha1/zz_generated.deepcopy.go b/apis/database/v1alpha1/zz_generated.deepcopy.go index 96280de..fa02efc 100644 --- a/apis/database/v1alpha1/zz_generated.deepcopy.go +++ b/apis/database/v1alpha1/zz_generated.deepcopy.go @@ -95,11 +95,6 @@ func (in *ConnectionPoolObservation) DeepCopyInto(out *ConnectionPoolObservation *out = new(string) **out = **in } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -140,11 +135,6 @@ func (in *ConnectionPoolParameters) DeepCopyInto(out *ConnectionPoolParameters) *out = new(string) **out = **in } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -273,11 +263,6 @@ func (in *DBObservation) DeepCopyInto(out *DBObservation) { *out = new(string) **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 DBObservation. @@ -298,11 +283,6 @@ func (in *DBParameters) DeepCopyInto(out *DBParameters) { *out = new(string) **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 DBParameters. diff --git a/apis/load/v1alpha1/zz_generated.deepcopy.go b/apis/load/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index c8d4fe9..0000000 --- a/apis/load/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,611 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 Upbound Inc. -*/ - -// 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 *Balancer) DeepCopyInto(out *Balancer) { - *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 Balancer. -func (in *Balancer) DeepCopy() *Balancer { - if in == nil { - return nil - } - out := new(Balancer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Balancer) 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 *BalancerList) DeepCopyInto(out *BalancerList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Balancer, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerList. -func (in *BalancerList) DeepCopy() *BalancerList { - if in == nil { - return nil - } - out := new(BalancerList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *BalancerList) 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 *BalancerObservation) DeepCopyInto(out *BalancerObservation) { - *out = *in - if in.AttachedInstances != nil { - in, out := &in.AttachedInstances, &out.AttachedInstances - *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.BalancingAlgorithm != nil { - in, out := &in.BalancingAlgorithm, &out.BalancingAlgorithm - *out = new(string) - **out = **in - } - if in.CookieName != nil { - in, out := &in.CookieName, &out.CookieName - *out = new(string) - **out = **in - } - if in.FirewallRules != nil { - in, out := &in.FirewallRules, &out.FirewallRules - *out = make([]FirewallRulesObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ForwardingRules != nil { - in, out := &in.ForwardingRules, &out.ForwardingRules - *out = make([]ForwardingRulesObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.HasSSL != nil { - in, out := &in.HasSSL, &out.HasSSL - *out = new(bool) - **out = **in - } - if in.HealthCheck != nil { - in, out := &in.HealthCheck, &out.HealthCheck - *out = make([]HealthCheckObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.IPv4 != nil { - in, out := &in.IPv4, &out.IPv4 - *out = new(string) - **out = **in - } - if in.IPv6 != nil { - in, out := &in.IPv6, &out.IPv6 - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.PrivateNetwork != nil { - in, out := &in.PrivateNetwork, &out.PrivateNetwork - *out = new(string) - **out = **in - } - if in.ProxyProtocol != nil { - in, out := &in.ProxyProtocol, &out.ProxyProtocol - *out = new(bool) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.SSL != nil { - in, out := &in.SSL, &out.SSL - *out = make([]SSLObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SSLRedirect != nil { - in, out := &in.SSLRedirect, &out.SSLRedirect - *out = new(bool) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } - if in.VPC != nil { - in, out := &in.VPC, &out.VPC - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerObservation. -func (in *BalancerObservation) DeepCopy() *BalancerObservation { - if in == nil { - return nil - } - out := new(BalancerObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BalancerParameters) DeepCopyInto(out *BalancerParameters) { - *out = *in - if in.AttachedInstances != nil { - in, out := &in.AttachedInstances, &out.AttachedInstances - *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.BalancingAlgorithm != nil { - in, out := &in.BalancingAlgorithm, &out.BalancingAlgorithm - *out = new(string) - **out = **in - } - if in.CookieName != nil { - in, out := &in.CookieName, &out.CookieName - *out = new(string) - **out = **in - } - if in.FirewallRules != nil { - in, out := &in.FirewallRules, &out.FirewallRules - *out = make([]FirewallRulesParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.ForwardingRules != nil { - in, out := &in.ForwardingRules, &out.ForwardingRules - *out = make([]ForwardingRulesParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.HealthCheck != nil { - in, out := &in.HealthCheck, &out.HealthCheck - *out = make([]HealthCheckParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.PrivateNetwork != nil { - in, out := &in.PrivateNetwork, &out.PrivateNetwork - *out = new(string) - **out = **in - } - if in.ProxyProtocol != nil { - in, out := &in.ProxyProtocol, &out.ProxyProtocol - *out = new(bool) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.SSL != nil { - in, out := &in.SSL, &out.SSL - *out = make([]SSLParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SSLRedirect != nil { - in, out := &in.SSLRedirect, &out.SSLRedirect - *out = new(bool) - **out = **in - } - if in.VPC != nil { - in, out := &in.VPC, &out.VPC - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerParameters. -func (in *BalancerParameters) DeepCopy() *BalancerParameters { - if in == nil { - return nil - } - out := new(BalancerParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BalancerSpec) DeepCopyInto(out *BalancerSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerSpec. -func (in *BalancerSpec) DeepCopy() *BalancerSpec { - if in == nil { - return nil - } - out := new(BalancerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BalancerStatus) DeepCopyInto(out *BalancerStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BalancerStatus. -func (in *BalancerStatus) DeepCopy() *BalancerStatus { - if in == nil { - return nil - } - out := new(BalancerStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirewallRulesObservation) DeepCopyInto(out *FirewallRulesObservation) { - *out = *in - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.IPType != nil { - in, out := &in.IPType, &out.IPType - *out = new(string) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(float64) - **out = **in - } - if in.Source != nil { - in, out := &in.Source, &out.Source - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallRulesObservation. -func (in *FirewallRulesObservation) DeepCopy() *FirewallRulesObservation { - if in == nil { - return nil - } - out := new(FirewallRulesObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FirewallRulesParameters) DeepCopyInto(out *FirewallRulesParameters) { - *out = *in - if in.IPType != nil { - in, out := &in.IPType, &out.IPType - *out = new(string) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(float64) - **out = **in - } - if in.Source != nil { - in, out := &in.Source, &out.Source - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallRulesParameters. -func (in *FirewallRulesParameters) DeepCopy() *FirewallRulesParameters { - if in == nil { - return nil - } - out := new(FirewallRulesParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ForwardingRulesObservation) DeepCopyInto(out *ForwardingRulesObservation) { - *out = *in - if in.BackendPort != nil { - in, out := &in.BackendPort, &out.BackendPort - *out = new(float64) - **out = **in - } - if in.BackendProtocol != nil { - in, out := &in.BackendProtocol, &out.BackendProtocol - *out = new(string) - **out = **in - } - if in.FrontendPort != nil { - in, out := &in.FrontendPort, &out.FrontendPort - *out = new(float64) - **out = **in - } - if in.FrontendProtocol != nil { - in, out := &in.FrontendProtocol, &out.FrontendProtocol - *out = new(string) - **out = **in - } - if in.RuleID != nil { - in, out := &in.RuleID, &out.RuleID - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForwardingRulesObservation. -func (in *ForwardingRulesObservation) DeepCopy() *ForwardingRulesObservation { - if in == nil { - return nil - } - out := new(ForwardingRulesObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ForwardingRulesParameters) DeepCopyInto(out *ForwardingRulesParameters) { - *out = *in - if in.BackendPort != nil { - in, out := &in.BackendPort, &out.BackendPort - *out = new(float64) - **out = **in - } - if in.BackendProtocol != nil { - in, out := &in.BackendProtocol, &out.BackendProtocol - *out = new(string) - **out = **in - } - if in.FrontendPort != nil { - in, out := &in.FrontendPort, &out.FrontendPort - *out = new(float64) - **out = **in - } - if in.FrontendProtocol != nil { - in, out := &in.FrontendProtocol, &out.FrontendProtocol - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForwardingRulesParameters. -func (in *ForwardingRulesParameters) DeepCopy() *ForwardingRulesParameters { - if in == nil { - return nil - } - out := new(ForwardingRulesParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheckObservation) DeepCopyInto(out *HealthCheckObservation) { - *out = *in - if in.CheckInterval != nil { - in, out := &in.CheckInterval, &out.CheckInterval - *out = new(float64) - **out = **in - } - if in.HealthyThreshold != nil { - in, out := &in.HealthyThreshold, &out.HealthyThreshold - *out = new(float64) - **out = **in - } - if in.Path != nil { - in, out := &in.Path, &out.Path - *out = new(string) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(float64) - **out = **in - } - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(string) - **out = **in - } - if in.ResponseTimeout != nil { - in, out := &in.ResponseTimeout, &out.ResponseTimeout - *out = new(float64) - **out = **in - } - if in.UnhealthyThreshold != nil { - in, out := &in.UnhealthyThreshold, &out.UnhealthyThreshold - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckObservation. -func (in *HealthCheckObservation) DeepCopy() *HealthCheckObservation { - if in == nil { - return nil - } - out := new(HealthCheckObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HealthCheckParameters) DeepCopyInto(out *HealthCheckParameters) { - *out = *in - if in.CheckInterval != nil { - in, out := &in.CheckInterval, &out.CheckInterval - *out = new(float64) - **out = **in - } - if in.HealthyThreshold != nil { - in, out := &in.HealthyThreshold, &out.HealthyThreshold - *out = new(float64) - **out = **in - } - if in.Path != nil { - in, out := &in.Path, &out.Path - *out = new(string) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(float64) - **out = **in - } - if in.Protocol != nil { - in, out := &in.Protocol, &out.Protocol - *out = new(string) - **out = **in - } - if in.ResponseTimeout != nil { - in, out := &in.ResponseTimeout, &out.ResponseTimeout - *out = new(float64) - **out = **in - } - if in.UnhealthyThreshold != nil { - in, out := &in.UnhealthyThreshold, &out.UnhealthyThreshold - *out = new(float64) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckParameters. -func (in *HealthCheckParameters) DeepCopy() *HealthCheckParameters { - if in == nil { - return nil - } - out := new(HealthCheckParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SSLObservation) DeepCopyInto(out *SSLObservation) { - *out = *in - if in.Certificate != nil { - in, out := &in.Certificate, &out.Certificate - *out = new(string) - **out = **in - } - if in.Chain != nil { - in, out := &in.Chain, &out.Chain - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSLObservation. -func (in *SSLObservation) DeepCopy() *SSLObservation { - if in == nil { - return nil - } - out := new(SSLObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SSLParameters) DeepCopyInto(out *SSLParameters) { - *out = *in - if in.Certificate != nil { - in, out := &in.Certificate, &out.Certificate - *out = new(string) - **out = **in - } - if in.Chain != nil { - in, out := &in.Chain, &out.Chain - *out = new(string) - **out = **in - } - out.PrivateKeySecretRef = in.PrivateKeySecretRef -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSLParameters. -func (in *SSLParameters) DeepCopy() *SSLParameters { - if in == nil { - return nil - } - out := new(SSLParameters) - in.DeepCopyInto(out) - return out -} diff --git a/apis/load/v1alpha1/zz_generated.managed.go b/apis/load/v1alpha1/zz_generated.managed.go deleted file mode 100644 index e16c073..0000000 --- a/apis/load/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this Balancer. -func (mg *Balancer) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Balancer. -func (mg *Balancer) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicy of this Balancer. -func (mg *Balancer) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy -} - -// GetProviderConfigReference of this Balancer. -func (mg *Balancer) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -/* -GetProviderReference of this Balancer. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Balancer) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - -// GetPublishConnectionDetailsTo of this Balancer. -func (mg *Balancer) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Balancer. -func (mg *Balancer) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Balancer. -func (mg *Balancer) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Balancer. -func (mg *Balancer) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicy of this Balancer. -func (mg *Balancer) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r -} - -// SetProviderConfigReference of this Balancer. -func (mg *Balancer) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -/* -SetProviderReference of this Balancer. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Balancer) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - -// SetPublishConnectionDetailsTo of this Balancer. -func (mg *Balancer) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Balancer. -func (mg *Balancer) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/load/v1alpha1/zz_generated.managedlist.go b/apis/load/v1alpha1/zz_generated.managedlist.go deleted file mode 100644 index 8859186..0000000 --- a/apis/load/v1alpha1/zz_generated.managedlist.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import resource "github.com/crossplane/crossplane-runtime/pkg/resource" - -// GetItems of this BalancerList. -func (l *BalancerList) 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/load/v1alpha1/zz_generated_terraformed.go b/apis/load/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index bec05c4..0000000 --- a/apis/load/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/pkg/errors" - - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Balancer -func (mg *Balancer) GetTerraformResourceType() string { - return "vultr_load_balancer" -} - -// GetConnectionDetailsMapping for this Balancer -func (tr *Balancer) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"ssl[*].private_key": "spec.forProvider.ssl[*].privateKeySecretRef"} -} - -// GetObservation of this Balancer -func (tr *Balancer) 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 Balancer -func (tr *Balancer) 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 Balancer -func (tr *Balancer) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Balancer -func (tr *Balancer) 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 Balancer -func (tr *Balancer) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) -} - -// LateInitialize this Balancer using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Balancer) LateInitialize(attrs []byte) (bool, error) { - params := &BalancerParameters{} - 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 *Balancer) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/load/v1alpha1/zz_groupversion_info.go b/apis/load/v1alpha1/zz_groupversion_info.go deleted file mode 100755 index d1c9f32..0000000 --- a/apis/load/v1alpha1/zz_groupversion_info.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -// +kubebuilder:object:generate=true -// +groupName=load.vultr.upbound.io -// +versionName=v1alpha1 -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// Package type metadata. -const ( - CRDGroup = "load.vultr.upbound.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/vultr/v1alpha1/zz_baremetalserver_types.go b/apis/vultr/v1alpha1/zz_baremetalserver_types.go new file mode 100755 index 0000000..58f6d06 --- /dev/null +++ b/apis/vultr/v1alpha1/zz_baremetalserver_types.go @@ -0,0 +1,218 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type BareMetalServerObservation struct { + + // Whether an activation email will be sent when the server is ready. + ActivationEmail *bool `json:"activationEmail,omitempty" tf:"activation_email,omitempty"` + + // The ID of the Vultr application to be installed on the server. See List Applications + AppID *float64 `json:"appId,omitempty" tf:"app_id,omitempty"` + + // The number of CPUs available on the server. + CPUCount *float64 `json:"cpuCount,omitempty" tf:"cpu_count,omitempty"` + + // The date the server was added to your Vultr account. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // The description of the disk(s) on the server. + Disk *string `json:"disk,omitempty" tf:"disk,omitempty"` + + // Whether the server has IPv6 networking activated. + EnableIPv6 *bool `json:"enableIpv6,omitempty" tf:"enable_ipv6,omitempty"` + + // The server's IPv4 gateway. + GatewayV4 *string `json:"gatewayV4,omitempty" tf:"gateway_v4,omitempty"` + + // The hostname to assign to the server. + Hostname *string `json:"hostname,omitempty" tf:"hostname,omitempty"` + + // ID of the server. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The ID of the Vultr marketplace application to be installed on the server. See List Applications Note marketplace applications are denoted by type: marketplace and you must use the image_id not the id. + ImageID *string `json:"imageId,omitempty" tf:"image_id,omitempty"` + + // A label for the server. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The MAC address associated with the server. + MacAddress *float64 `json:"macAddress,omitempty" tf:"mac_address,omitempty"` + + // The server's main IP address. + MainIP *string `json:"mainIp,omitempty" tf:"main_ip,omitempty"` + + // The server's IPv4 netmask. + NetmaskV4 *string `json:"netmaskV4,omitempty" tf:"netmask_v4,omitempty"` + + // The string description of the operating system installed on the server. + Os *string `json:"os,omitempty" tf:"os,omitempty"` + + // The ID of the operating system to be installed on the server. See List OS + OsID *float64 `json:"osId,omitempty" tf:"os_id,omitempty"` + + // The ID of the plan that you want the server to subscribe to. See List Plans + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // The amount of memory available on the server in MB. + RAM *string `json:"ram,omitempty" tf:"ram,omitempty"` + + // The ID of the region that the server is to be created in. See List Regions + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The ID of the floating IP to use as the main IP of this server. See Reserved IPs + ReservedIPv4 *string `json:"reservedIpv4,omitempty" tf:"reserved_ipv4,omitempty"` + + // A list of SSH key IDs to apply to the server on install (only valid for Linux/FreeBSD). + SSHKeyIds []*string `json:"sshKeyIds,omitempty" tf:"ssh_key_ids,omitempty"` + + // The ID of the startup script you want added to the server. + ScriptID *string `json:"scriptId,omitempty" tf:"script_id,omitempty"` + + // The ID of the Vultr snapshot that the server will restore for the initial installation. See List Snapshots + SnapshotID *string `json:"snapshotId,omitempty" tf:"snapshot_id,omitempty"` + + // The status of the server's subscription. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // A list of tags to apply to the servier. + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Generic data store, which some provisioning tools and cloud operating systems use as a configuration file. It is generally consumed only once after an instance has been launched, but individual needs may vary. + UserData *string `json:"userData,omitempty" tf:"user_data,omitempty"` + + // The main IPv6 network address. + V6MainIP *string `json:"v6MainIp,omitempty" tf:"v6_main_ip,omitempty"` + + // The IPv6 subnet. + V6Network *string `json:"v6Network,omitempty" tf:"v6_network,omitempty"` + + // The IPv6 network size in bits. + V6NetworkSize *float64 `json:"v6NetworkSize,omitempty" tf:"v6_network_size,omitempty"` +} + +type BareMetalServerParameters struct { + + // Whether an activation email will be sent when the server is ready. + // +kubebuilder:validation:Optional + ActivationEmail *bool `json:"activationEmail,omitempty" tf:"activation_email,omitempty"` + + // The ID of the Vultr application to be installed on the server. See List Applications + // +kubebuilder:validation:Optional + AppID *float64 `json:"appId,omitempty" tf:"app_id,omitempty"` + + // Whether the server has IPv6 networking activated. + // +kubebuilder:validation:Optional + EnableIPv6 *bool `json:"enableIpv6,omitempty" tf:"enable_ipv6,omitempty"` + + // The hostname to assign to the server. + // +kubebuilder:validation:Optional + Hostname *string `json:"hostname,omitempty" tf:"hostname,omitempty"` + + // The ID of the Vultr marketplace application to be installed on the server. See List Applications Note marketplace applications are denoted by type: marketplace and you must use the image_id not the id. + // +kubebuilder:validation:Optional + ImageID *string `json:"imageId,omitempty" tf:"image_id,omitempty"` + + // A label for the server. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The ID of the operating system to be installed on the server. See List OS + // +kubebuilder:validation:Optional + OsID *float64 `json:"osId,omitempty" tf:"os_id,omitempty"` + + // The ID of the plan that you want the server to subscribe to. See List Plans + // +kubebuilder:validation:Optional + Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` + + // The ID of the region that the server is to be created in. See List Regions + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The ID of the floating IP to use as the main IP of this server. See Reserved IPs + // +kubebuilder:validation:Optional + ReservedIPv4 *string `json:"reservedIpv4,omitempty" tf:"reserved_ipv4,omitempty"` + + // A list of SSH key IDs to apply to the server on install (only valid for Linux/FreeBSD). + // +kubebuilder:validation:Optional + SSHKeyIds []*string `json:"sshKeyIds,omitempty" tf:"ssh_key_ids,omitempty"` + + // The ID of the startup script you want added to the server. + // +kubebuilder:validation:Optional + ScriptID *string `json:"scriptId,omitempty" tf:"script_id,omitempty"` + + // The ID of the Vultr snapshot that the server will restore for the initial installation. See List Snapshots + // +kubebuilder:validation:Optional + SnapshotID *string `json:"snapshotId,omitempty" tf:"snapshot_id,omitempty"` + + // A list of tags to apply to the servier. + // +kubebuilder:validation:Optional + Tags []*string `json:"tags,omitempty" tf:"tags,omitempty"` + + // Generic data store, which some provisioning tools and cloud operating systems use as a configuration file. It is generally consumed only once after an instance has been launched, but individual needs may vary. + // +kubebuilder:validation:Optional + UserData *string `json:"userData,omitempty" tf:"user_data,omitempty"` +} + +// BareMetalServerSpec defines the desired state of BareMetalServer +type BareMetalServerSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider BareMetalServerParameters `json:"forProvider"` +} + +// BareMetalServerStatus defines the observed state of BareMetalServer. +type BareMetalServerStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider BareMetalServerObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// BareMetalServer is the Schema for the BareMetalServers API. Provides a Vultr bare metal server resource. This can be used to create, read, modify, and delete bare metal servers on your Vultr account. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type BareMetalServer struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.plan)",message="plan is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + Spec BareMetalServerSpec `json:"spec"` + Status BareMetalServerStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// BareMetalServerList contains a list of BareMetalServers +type BareMetalServerList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BareMetalServer `json:"items"` +} + +// Repository type metadata. +var ( + BareMetalServer_Kind = "BareMetalServer" + BareMetalServer_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: BareMetalServer_Kind}.String() + BareMetalServer_KindAPIVersion = BareMetalServer_Kind + "." + CRDGroupVersion.String() + BareMetalServer_GroupVersionKind = CRDGroupVersion.WithKind(BareMetalServer_Kind) +) + +func init() { + SchemeBuilder.Register(&BareMetalServer{}, &BareMetalServerList{}) +} diff --git a/apis/vultr/v1alpha1/zz_generated.deepcopy.go b/apis/vultr/v1alpha1/zz_generated.deepcopy.go index 14148ca..869fc47 100644 --- a/apis/vultr/v1alpha1/zz_generated.deepcopy.go +++ b/apis/vultr/v1alpha1/zz_generated.deepcopy.go @@ -83,6 +83,373 @@ func (in *BackupsScheduleParameters) DeepCopy() *BackupsScheduleParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BareMetalServer) DeepCopyInto(out *BareMetalServer) { + *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 BareMetalServer. +func (in *BareMetalServer) DeepCopy() *BareMetalServer { + if in == nil { + return nil + } + out := new(BareMetalServer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BareMetalServer) 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 *BareMetalServerList) DeepCopyInto(out *BareMetalServerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BareMetalServer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalServerList. +func (in *BareMetalServerList) DeepCopy() *BareMetalServerList { + if in == nil { + return nil + } + out := new(BareMetalServerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BareMetalServerList) 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 *BareMetalServerObservation) DeepCopyInto(out *BareMetalServerObservation) { + *out = *in + if in.ActivationEmail != nil { + in, out := &in.ActivationEmail, &out.ActivationEmail + *out = new(bool) + **out = **in + } + if in.AppID != nil { + in, out := &in.AppID, &out.AppID + *out = new(float64) + **out = **in + } + if in.CPUCount != nil { + in, out := &in.CPUCount, &out.CPUCount + *out = new(float64) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Disk != nil { + in, out := &in.Disk, &out.Disk + *out = new(string) + **out = **in + } + if in.EnableIPv6 != nil { + in, out := &in.EnableIPv6, &out.EnableIPv6 + *out = new(bool) + **out = **in + } + if in.GatewayV4 != nil { + in, out := &in.GatewayV4, &out.GatewayV4 + *out = new(string) + **out = **in + } + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.ImageID != nil { + in, out := &in.ImageID, &out.ImageID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MacAddress != nil { + in, out := &in.MacAddress, &out.MacAddress + *out = new(float64) + **out = **in + } + if in.MainIP != nil { + in, out := &in.MainIP, &out.MainIP + *out = new(string) + **out = **in + } + if in.NetmaskV4 != nil { + in, out := &in.NetmaskV4, &out.NetmaskV4 + *out = new(string) + **out = **in + } + if in.Os != nil { + in, out := &in.Os, &out.Os + *out = new(string) + **out = **in + } + if in.OsID != nil { + in, out := &in.OsID, &out.OsID + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.RAM != nil { + in, out := &in.RAM, &out.RAM + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReservedIPv4 != nil { + in, out := &in.ReservedIPv4, &out.ReservedIPv4 + *out = new(string) + **out = **in + } + if in.SSHKeyIds != nil { + in, out := &in.SSHKeyIds, &out.SSHKeyIds + *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.ScriptID != nil { + in, out := &in.ScriptID, &out.ScriptID + *out = new(string) + **out = **in + } + if in.SnapshotID != nil { + in, out := &in.SnapshotID, &out.SnapshotID + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } + if in.V6MainIP != nil { + in, out := &in.V6MainIP, &out.V6MainIP + *out = new(string) + **out = **in + } + if in.V6Network != nil { + in, out := &in.V6Network, &out.V6Network + *out = new(string) + **out = **in + } + if in.V6NetworkSize != nil { + in, out := &in.V6NetworkSize, &out.V6NetworkSize + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalServerObservation. +func (in *BareMetalServerObservation) DeepCopy() *BareMetalServerObservation { + if in == nil { + return nil + } + out := new(BareMetalServerObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BareMetalServerParameters) DeepCopyInto(out *BareMetalServerParameters) { + *out = *in + if in.ActivationEmail != nil { + in, out := &in.ActivationEmail, &out.ActivationEmail + *out = new(bool) + **out = **in + } + if in.AppID != nil { + in, out := &in.AppID, &out.AppID + *out = new(float64) + **out = **in + } + if in.EnableIPv6 != nil { + in, out := &in.EnableIPv6, &out.EnableIPv6 + *out = new(bool) + **out = **in + } + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname + *out = new(string) + **out = **in + } + if in.ImageID != nil { + in, out := &in.ImageID, &out.ImageID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.OsID != nil { + in, out := &in.OsID, &out.OsID + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReservedIPv4 != nil { + in, out := &in.ReservedIPv4, &out.ReservedIPv4 + *out = new(string) + **out = **in + } + if in.SSHKeyIds != nil { + in, out := &in.SSHKeyIds, &out.SSHKeyIds + *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.ScriptID != nil { + in, out := &in.ScriptID, &out.ScriptID + *out = new(string) + **out = **in + } + if in.SnapshotID != nil { + in, out := &in.SnapshotID, &out.SnapshotID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *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.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalServerParameters. +func (in *BareMetalServerParameters) DeepCopy() *BareMetalServerParameters { + if in == nil { + return nil + } + out := new(BareMetalServerParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BareMetalServerSpec) DeepCopyInto(out *BareMetalServerSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalServerSpec. +func (in *BareMetalServerSpec) DeepCopy() *BareMetalServerSpec { + if in == nil { + return nil + } + out := new(BareMetalServerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BareMetalServerStatus) DeepCopyInto(out *BareMetalServerStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BareMetalServerStatus. +func (in *BareMetalServerStatus) DeepCopy() *BareMetalServerStatus { + if in == nil { + return nil + } + out := new(BareMetalServerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Database) DeepCopyInto(out *Database) { *out = *in @@ -464,7 +831,247 @@ func (in *DatabaseStatus) DeepCopy() *DatabaseStatus { if in == nil { return nil } - out := new(DatabaseStatus) + out := new(DatabaseStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallRulesObservation) DeepCopyInto(out *FirewallRulesObservation) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IPType != nil { + in, out := &in.IPType, &out.IPType + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallRulesObservation. +func (in *FirewallRulesObservation) DeepCopy() *FirewallRulesObservation { + if in == nil { + return nil + } + out := new(FirewallRulesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FirewallRulesParameters) DeepCopyInto(out *FirewallRulesParameters) { + *out = *in + if in.IPType != nil { + in, out := &in.IPType, &out.IPType + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Source != nil { + in, out := &in.Source, &out.Source + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FirewallRulesParameters. +func (in *FirewallRulesParameters) DeepCopy() *FirewallRulesParameters { + if in == nil { + return nil + } + out := new(FirewallRulesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForwardingRulesObservation) DeepCopyInto(out *ForwardingRulesObservation) { + *out = *in + if in.BackendPort != nil { + in, out := &in.BackendPort, &out.BackendPort + *out = new(float64) + **out = **in + } + if in.BackendProtocol != nil { + in, out := &in.BackendProtocol, &out.BackendProtocol + *out = new(string) + **out = **in + } + if in.FrontendPort != nil { + in, out := &in.FrontendPort, &out.FrontendPort + *out = new(float64) + **out = **in + } + if in.FrontendProtocol != nil { + in, out := &in.FrontendProtocol, &out.FrontendProtocol + *out = new(string) + **out = **in + } + if in.RuleID != nil { + in, out := &in.RuleID, &out.RuleID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForwardingRulesObservation. +func (in *ForwardingRulesObservation) DeepCopy() *ForwardingRulesObservation { + if in == nil { + return nil + } + out := new(ForwardingRulesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ForwardingRulesParameters) DeepCopyInto(out *ForwardingRulesParameters) { + *out = *in + if in.BackendPort != nil { + in, out := &in.BackendPort, &out.BackendPort + *out = new(float64) + **out = **in + } + if in.BackendProtocol != nil { + in, out := &in.BackendProtocol, &out.BackendProtocol + *out = new(string) + **out = **in + } + if in.FrontendPort != nil { + in, out := &in.FrontendPort, &out.FrontendPort + *out = new(float64) + **out = **in + } + if in.FrontendProtocol != nil { + in, out := &in.FrontendProtocol, &out.FrontendProtocol + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ForwardingRulesParameters. +func (in *ForwardingRulesParameters) DeepCopy() *ForwardingRulesParameters { + if in == nil { + return nil + } + out := new(ForwardingRulesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckObservation) DeepCopyInto(out *HealthCheckObservation) { + *out = *in + if in.CheckInterval != nil { + in, out := &in.CheckInterval, &out.CheckInterval + *out = new(float64) + **out = **in + } + if in.HealthyThreshold != nil { + in, out := &in.HealthyThreshold, &out.HealthyThreshold + *out = new(float64) + **out = **in + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ResponseTimeout != nil { + in, out := &in.ResponseTimeout, &out.ResponseTimeout + *out = new(float64) + **out = **in + } + if in.UnhealthyThreshold != nil { + in, out := &in.UnhealthyThreshold, &out.UnhealthyThreshold + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckObservation. +func (in *HealthCheckObservation) DeepCopy() *HealthCheckObservation { + if in == nil { + return nil + } + out := new(HealthCheckObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *HealthCheckParameters) DeepCopyInto(out *HealthCheckParameters) { + *out = *in + if in.CheckInterval != nil { + in, out := &in.CheckInterval, &out.CheckInterval + *out = new(float64) + **out = **in + } + if in.HealthyThreshold != nil { + in, out := &in.HealthyThreshold, &out.HealthyThreshold + *out = new(float64) + **out = **in + } + if in.Path != nil { + in, out := &in.Path, &out.Path + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Protocol != nil { + in, out := &in.Protocol, &out.Protocol + *out = new(string) + **out = **in + } + if in.ResponseTimeout != nil { + in, out := &in.ResponseTimeout, &out.ResponseTimeout + *out = new(float64) + **out = **in + } + if in.UnhealthyThreshold != nil { + in, out := &in.UnhealthyThreshold, &out.UnhealthyThreshold + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheckParameters. +func (in *HealthCheckParameters) DeepCopy() *HealthCheckParameters { + if in == nil { + return nil + } + out := new(HealthCheckParameters) in.DeepCopyInto(out) return out } @@ -1167,6 +1774,312 @@ func (in *KubernetesStatus) DeepCopy() *KubernetesStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancer) DeepCopyInto(out *LoadBalancer) { + *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 LoadBalancer. +func (in *LoadBalancer) DeepCopy() *LoadBalancer { + if in == nil { + return nil + } + out := new(LoadBalancer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LoadBalancer) 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 *LoadBalancerList) DeepCopyInto(out *LoadBalancerList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LoadBalancer, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerList. +func (in *LoadBalancerList) DeepCopy() *LoadBalancerList { + if in == nil { + return nil + } + out := new(LoadBalancerList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LoadBalancerList) 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 *LoadBalancerObservation) DeepCopyInto(out *LoadBalancerObservation) { + *out = *in + if in.AttachedInstances != nil { + in, out := &in.AttachedInstances, &out.AttachedInstances + *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.BalancingAlgorithm != nil { + in, out := &in.BalancingAlgorithm, &out.BalancingAlgorithm + *out = new(string) + **out = **in + } + if in.CookieName != nil { + in, out := &in.CookieName, &out.CookieName + *out = new(string) + **out = **in + } + if in.FirewallRules != nil { + in, out := &in.FirewallRules, &out.FirewallRules + *out = make([]FirewallRulesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ForwardingRules != nil { + in, out := &in.ForwardingRules, &out.ForwardingRules + *out = make([]ForwardingRulesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.HasSSL != nil { + in, out := &in.HasSSL, &out.HasSSL + *out = new(bool) + **out = **in + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = make([]HealthCheckObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IPv4 != nil { + in, out := &in.IPv4, &out.IPv4 + *out = new(string) + **out = **in + } + if in.IPv6 != nil { + in, out := &in.IPv6, &out.IPv6 + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.PrivateNetwork != nil { + in, out := &in.PrivateNetwork, &out.PrivateNetwork + *out = new(string) + **out = **in + } + if in.ProxyProtocol != nil { + in, out := &in.ProxyProtocol, &out.ProxyProtocol + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SSL != nil { + in, out := &in.SSL, &out.SSL + *out = make([]SSLObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SSLRedirect != nil { + in, out := &in.SSLRedirect, &out.SSLRedirect + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerObservation. +func (in *LoadBalancerObservation) DeepCopy() *LoadBalancerObservation { + if in == nil { + return nil + } + out := new(LoadBalancerObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerParameters) DeepCopyInto(out *LoadBalancerParameters) { + *out = *in + if in.AttachedInstances != nil { + in, out := &in.AttachedInstances, &out.AttachedInstances + *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.BalancingAlgorithm != nil { + in, out := &in.BalancingAlgorithm, &out.BalancingAlgorithm + *out = new(string) + **out = **in + } + if in.CookieName != nil { + in, out := &in.CookieName, &out.CookieName + *out = new(string) + **out = **in + } + if in.FirewallRules != nil { + in, out := &in.FirewallRules, &out.FirewallRules + *out = make([]FirewallRulesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ForwardingRules != nil { + in, out := &in.ForwardingRules, &out.ForwardingRules + *out = make([]ForwardingRulesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = make([]HealthCheckParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.PrivateNetwork != nil { + in, out := &in.PrivateNetwork, &out.PrivateNetwork + *out = new(string) + **out = **in + } + if in.ProxyProtocol != nil { + in, out := &in.ProxyProtocol, &out.ProxyProtocol + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SSL != nil { + in, out := &in.SSL, &out.SSL + *out = make([]SSLParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SSLRedirect != nil { + in, out := &in.SSLRedirect, &out.SSLRedirect + *out = new(bool) + **out = **in + } + if in.VPC != nil { + in, out := &in.VPC, &out.VPC + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerParameters. +func (in *LoadBalancerParameters) DeepCopy() *LoadBalancerParameters { + if in == nil { + return nil + } + out := new(LoadBalancerParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec. +func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { + if in == nil { + return nil + } + out := new(LoadBalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LoadBalancerStatus) DeepCopyInto(out *LoadBalancerStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerStatus. +func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus { + if in == nil { + return nil + } + out := new(LoadBalancerStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePoolsObservation) DeepCopyInto(out *NodePoolsObservation) { *out = *in @@ -1582,3 +2495,54 @@ func (in *ReadReplicasParameters) DeepCopy() *ReadReplicasParameters { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSLObservation) DeepCopyInto(out *SSLObservation) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.Chain != nil { + in, out := &in.Chain, &out.Chain + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSLObservation. +func (in *SSLObservation) DeepCopy() *SSLObservation { + if in == nil { + return nil + } + out := new(SSLObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SSLParameters) DeepCopyInto(out *SSLParameters) { + *out = *in + if in.Certificate != nil { + in, out := &in.Certificate, &out.Certificate + *out = new(string) + **out = **in + } + if in.Chain != nil { + in, out := &in.Chain, &out.Chain + *out = new(string) + **out = **in + } + out.PrivateKeySecretRef = in.PrivateKeySecretRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SSLParameters. +func (in *SSLParameters) DeepCopy() *SSLParameters { + if in == nil { + return nil + } + out := new(SSLParameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/vultr/v1alpha1/zz_generated.managed.go b/apis/vultr/v1alpha1/zz_generated.managed.go index 7392c08..60efa45 100644 --- a/apis/vultr/v1alpha1/zz_generated.managed.go +++ b/apis/vultr/v1alpha1/zz_generated.managed.go @@ -7,6 +7,82 @@ package v1alpha1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this BareMetalServer. +func (mg *BareMetalServer) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this BareMetalServer. +func (mg *BareMetalServer) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this BareMetalServer. +func (mg *BareMetalServer) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this BareMetalServer. +func (mg *BareMetalServer) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this BareMetalServer. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *BareMetalServer) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this BareMetalServer. +func (mg *BareMetalServer) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this BareMetalServer. +func (mg *BareMetalServer) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this BareMetalServer. +func (mg *BareMetalServer) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this BareMetalServer. +func (mg *BareMetalServer) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this BareMetalServer. +func (mg *BareMetalServer) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this BareMetalServer. +func (mg *BareMetalServer) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this BareMetalServer. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *BareMetalServer) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this BareMetalServer. +func (mg *BareMetalServer) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this BareMetalServer. +func (mg *BareMetalServer) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Database. func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) @@ -234,3 +310,79 @@ func (mg *Kubernetes) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDet func (mg *Kubernetes) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this LoadBalancer. +func (mg *LoadBalancer) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this LoadBalancer. +func (mg *LoadBalancer) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this LoadBalancer. +func (mg *LoadBalancer) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this LoadBalancer. +func (mg *LoadBalancer) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this LoadBalancer. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *LoadBalancer) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this LoadBalancer. +func (mg *LoadBalancer) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this LoadBalancer. +func (mg *LoadBalancer) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this LoadBalancer. +func (mg *LoadBalancer) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this LoadBalancer. +func (mg *LoadBalancer) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this LoadBalancer. +func (mg *LoadBalancer) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this LoadBalancer. +func (mg *LoadBalancer) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this LoadBalancer. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *LoadBalancer) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this LoadBalancer. +func (mg *LoadBalancer) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this LoadBalancer. +func (mg *LoadBalancer) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/vultr/v1alpha1/zz_generated.managedlist.go b/apis/vultr/v1alpha1/zz_generated.managedlist.go index 181191b..f96053c 100644 --- a/apis/vultr/v1alpha1/zz_generated.managedlist.go +++ b/apis/vultr/v1alpha1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this BareMetalServerList. +func (l *BareMetalServerList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this DatabaseList. func (l *DatabaseList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) @@ -33,3 +42,12 @@ func (l *KubernetesList) GetItems() []resource.Managed { } return items } + +// GetItems of this LoadBalancerList. +func (l *LoadBalancerList) 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/vultr/v1alpha1/zz_generated_terraformed.go b/apis/vultr/v1alpha1/zz_generated_terraformed.go index 3b4b6ec..9fe4288 100755 --- a/apis/vultr/v1alpha1/zz_generated_terraformed.go +++ b/apis/vultr/v1alpha1/zz_generated_terraformed.go @@ -13,6 +13,80 @@ import ( "github.com/upbound/upjet/pkg/resource/json" ) +// GetTerraformResourceType returns Terraform resource type for this BareMetalServer +func (mg *BareMetalServer) GetTerraformResourceType() string { + return "vultr_bare_metal_server" +} + +// GetConnectionDetailsMapping for this BareMetalServer +func (tr *BareMetalServer) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"default_password": "status.atProvider.defaultPassword"} +} + +// GetObservation of this BareMetalServer +func (tr *BareMetalServer) 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 BareMetalServer +func (tr *BareMetalServer) 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 BareMetalServer +func (tr *BareMetalServer) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this BareMetalServer +func (tr *BareMetalServer) 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 BareMetalServer +func (tr *BareMetalServer) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this BareMetalServer using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *BareMetalServer) LateInitialize(attrs []byte) (bool, error) { + params := &BareMetalServerParameters{} + 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 *BareMetalServer) GetTerraformSchemaVersion() int { + return 0 +} + // GetTerraformResourceType returns Terraform resource type for this Database func (mg *Database) GetTerraformResourceType() string { return "vultr_database" @@ -234,3 +308,77 @@ func (tr *Kubernetes) LateInitialize(attrs []byte) (bool, error) { func (tr *Kubernetes) GetTerraformSchemaVersion() int { return 0 } + +// GetTerraformResourceType returns Terraform resource type for this LoadBalancer +func (mg *LoadBalancer) GetTerraformResourceType() string { + return "vultr_load_balancer" +} + +// GetConnectionDetailsMapping for this LoadBalancer +func (tr *LoadBalancer) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ssl[*].private_key": "spec.forProvider.ssl[*].privateKeySecretRef"} +} + +// GetObservation of this LoadBalancer +func (tr *LoadBalancer) 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 LoadBalancer +func (tr *LoadBalancer) 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 LoadBalancer +func (tr *LoadBalancer) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this LoadBalancer +func (tr *LoadBalancer) 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 LoadBalancer +func (tr *LoadBalancer) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this LoadBalancer using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *LoadBalancer) LateInitialize(attrs []byte) (bool, error) { + params := &LoadBalancerParameters{} + 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 *LoadBalancer) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/load/v1alpha1/zz_balancer_types.go b/apis/vultr/v1alpha1/zz_loadbalancer_types.go similarity index 91% rename from apis/load/v1alpha1/zz_balancer_types.go rename to apis/vultr/v1alpha1/zz_loadbalancer_types.go index 85e3419..038ae76 100755 --- a/apis/load/v1alpha1/zz_balancer_types.go +++ b/apis/vultr/v1alpha1/zz_loadbalancer_types.go @@ -13,118 +13,6 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type BalancerObservation struct { - - // Array of instances that are currently attached to the load balancer. - AttachedInstances []*string `json:"attachedInstances,omitempty" tf:"attached_instances,omitempty"` - - // The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin - BalancingAlgorithm *string `json:"balancingAlgorithm,omitempty" tf:"balancing_algorithm,omitempty"` - - // Name for your given sticky session. - CookieName *string `json:"cookieName,omitempty" tf:"cookie_name,omitempty"` - - // Defines the firewall rules for a load balancer. - FirewallRules []FirewallRulesObservation `json:"firewallRules,omitempty" tf:"firewall_rules,omitempty"` - - // List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below. - ForwardingRules []ForwardingRulesObservation `json:"forwardingRules,omitempty" tf:"forwarding_rules,omitempty"` - - // Boolean value that indicates if SSL is enabled. - HasSSL *bool `json:"hasSsl,omitempty" tf:"has_ssl,omitempty"` - - // A block that defines the way load balancers should check for health. The configuration of a health_check is listed below. - HealthCheck []HealthCheckObservation `json:"healthCheck,omitempty" tf:"health_check,omitempty"` - - // The load balancer ID. - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // IPv4 address for your load balancer. - IPv4 *string `json:"ipv4,omitempty" tf:"ipv4,omitempty"` - - // IPv6 address for your load balancer. - IPv6 *string `json:"ipv6,omitempty" tf:"ipv6,omitempty"` - - // The load balancer's label. - Label *string `json:"label,omitempty" tf:"label,omitempty"` - - // (Deprecated: use vpc instead) A private network ID that the load balancer should be attached to. - PrivateNetwork *string `json:"privateNetwork,omitempty" tf:"private_network,omitempty"` - - // Boolean value that indicates if Proxy Protocol is enabled. - ProxyProtocol *bool `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` - - // The region your load balancer is deployed in. - Region *string `json:"region,omitempty" tf:"region,omitempty"` - - // A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below. - SSL []SSLObservation `json:"ssl,omitempty" tf:"ssl,omitempty"` - - // Boolean value that indicates if HTTP calls will be redirected to HTTPS. - SSLRedirect *bool `json:"sslRedirect,omitempty" tf:"ssl_redirect,omitempty"` - - // Current status for the load balancer - Status *string `json:"status,omitempty" tf:"status,omitempty"` - - // A VPC ID that the load balancer should be attached to. - VPC *string `json:"vpc,omitempty" tf:"vpc,omitempty"` -} - -type BalancerParameters struct { - - // Array of instances that are currently attached to the load balancer. - // +kubebuilder:validation:Optional - AttachedInstances []*string `json:"attachedInstances,omitempty" tf:"attached_instances,omitempty"` - - // The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin - // +kubebuilder:validation:Optional - BalancingAlgorithm *string `json:"balancingAlgorithm,omitempty" tf:"balancing_algorithm,omitempty"` - - // Name for your given sticky session. - // +kubebuilder:validation:Optional - CookieName *string `json:"cookieName,omitempty" tf:"cookie_name,omitempty"` - - // Defines the firewall rules for a load balancer. - // +kubebuilder:validation:Optional - FirewallRules []FirewallRulesParameters `json:"firewallRules,omitempty" tf:"firewall_rules,omitempty"` - - // List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below. - // +kubebuilder:validation:Optional - ForwardingRules []ForwardingRulesParameters `json:"forwardingRules,omitempty" tf:"forwarding_rules,omitempty"` - - // A block that defines the way load balancers should check for health. The configuration of a health_check is listed below. - // +kubebuilder:validation:Optional - HealthCheck []HealthCheckParameters `json:"healthCheck,omitempty" tf:"health_check,omitempty"` - - // The load balancer's label. - // +kubebuilder:validation:Optional - Label *string `json:"label,omitempty" tf:"label,omitempty"` - - // (Deprecated: use vpc instead) A private network ID that the load balancer should be attached to. - // +kubebuilder:validation:Optional - PrivateNetwork *string `json:"privateNetwork,omitempty" tf:"private_network,omitempty"` - - // Boolean value that indicates if Proxy Protocol is enabled. - // +kubebuilder:validation:Optional - ProxyProtocol *bool `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` - - // The region your load balancer is deployed in. - // +kubebuilder:validation:Optional - Region *string `json:"region,omitempty" tf:"region,omitempty"` - - // A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below. - // +kubebuilder:validation:Optional - SSL []SSLParameters `json:"ssl,omitempty" tf:"ssl,omitempty"` - - // Boolean value that indicates if HTTP calls will be redirected to HTTPS. - // +kubebuilder:validation:Optional - SSLRedirect *bool `json:"sslRedirect,omitempty" tf:"ssl_redirect,omitempty"` - - // A VPC ID that the load balancer should be attached to. - // +kubebuilder:validation:Optional - VPC *string `json:"vpc,omitempty" tf:"vpc,omitempty"` -} - type FirewallRulesObservation struct { // The load balancer ID. @@ -247,6 +135,118 @@ type HealthCheckParameters struct { UnhealthyThreshold *float64 `json:"unhealthyThreshold" tf:"unhealthy_threshold,omitempty"` } +type LoadBalancerObservation struct { + + // Array of instances that are currently attached to the load balancer. + AttachedInstances []*string `json:"attachedInstances,omitempty" tf:"attached_instances,omitempty"` + + // The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin + BalancingAlgorithm *string `json:"balancingAlgorithm,omitempty" tf:"balancing_algorithm,omitempty"` + + // Name for your given sticky session. + CookieName *string `json:"cookieName,omitempty" tf:"cookie_name,omitempty"` + + // Defines the firewall rules for a load balancer. + FirewallRules []FirewallRulesObservation `json:"firewallRules,omitempty" tf:"firewall_rules,omitempty"` + + // List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below. + ForwardingRules []ForwardingRulesObservation `json:"forwardingRules,omitempty" tf:"forwarding_rules,omitempty"` + + // Boolean value that indicates if SSL is enabled. + HasSSL *bool `json:"hasSsl,omitempty" tf:"has_ssl,omitempty"` + + // A block that defines the way load balancers should check for health. The configuration of a health_check is listed below. + HealthCheck []HealthCheckObservation `json:"healthCheck,omitempty" tf:"health_check,omitempty"` + + // The load balancer ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // IPv4 address for your load balancer. + IPv4 *string `json:"ipv4,omitempty" tf:"ipv4,omitempty"` + + // IPv6 address for your load balancer. + IPv6 *string `json:"ipv6,omitempty" tf:"ipv6,omitempty"` + + // The load balancer's label. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // (Deprecated: use vpc instead) A private network ID that the load balancer should be attached to. + PrivateNetwork *string `json:"privateNetwork,omitempty" tf:"private_network,omitempty"` + + // Boolean value that indicates if Proxy Protocol is enabled. + ProxyProtocol *bool `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` + + // The region your load balancer is deployed in. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below. + SSL []SSLObservation `json:"ssl,omitempty" tf:"ssl,omitempty"` + + // Boolean value that indicates if HTTP calls will be redirected to HTTPS. + SSLRedirect *bool `json:"sslRedirect,omitempty" tf:"ssl_redirect,omitempty"` + + // Current status for the load balancer + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // A VPC ID that the load balancer should be attached to. + VPC *string `json:"vpc,omitempty" tf:"vpc,omitempty"` +} + +type LoadBalancerParameters struct { + + // Array of instances that are currently attached to the load balancer. + // +kubebuilder:validation:Optional + AttachedInstances []*string `json:"attachedInstances,omitempty" tf:"attached_instances,omitempty"` + + // The balancing algorithm for your load balancer. Options are roundrobin or leastconn. Default value is roundrobin + // +kubebuilder:validation:Optional + BalancingAlgorithm *string `json:"balancingAlgorithm,omitempty" tf:"balancing_algorithm,omitempty"` + + // Name for your given sticky session. + // +kubebuilder:validation:Optional + CookieName *string `json:"cookieName,omitempty" tf:"cookie_name,omitempty"` + + // Defines the firewall rules for a load balancer. + // +kubebuilder:validation:Optional + FirewallRules []FirewallRulesParameters `json:"firewallRules,omitempty" tf:"firewall_rules,omitempty"` + + // List of forwarding rules for a load balancer. The configuration of a forwarding_rules is listened below. + // +kubebuilder:validation:Optional + ForwardingRules []ForwardingRulesParameters `json:"forwardingRules,omitempty" tf:"forwarding_rules,omitempty"` + + // A block that defines the way load balancers should check for health. The configuration of a health_check is listed below. + // +kubebuilder:validation:Optional + HealthCheck []HealthCheckParameters `json:"healthCheck,omitempty" tf:"health_check,omitempty"` + + // The load balancer's label. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // (Deprecated: use vpc instead) A private network ID that the load balancer should be attached to. + // +kubebuilder:validation:Optional + PrivateNetwork *string `json:"privateNetwork,omitempty" tf:"private_network,omitempty"` + + // Boolean value that indicates if Proxy Protocol is enabled. + // +kubebuilder:validation:Optional + ProxyProtocol *bool `json:"proxyProtocol,omitempty" tf:"proxy_protocol,omitempty"` + + // The region your load balancer is deployed in. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // A block that supplies your ssl configuration to be used with HTTPS. The configuration of a ssl is listed below. + // +kubebuilder:validation:Optional + SSL []SSLParameters `json:"ssl,omitempty" tf:"ssl,omitempty"` + + // Boolean value that indicates if HTTP calls will be redirected to HTTPS. + // +kubebuilder:validation:Optional + SSLRedirect *bool `json:"sslRedirect,omitempty" tf:"ssl_redirect,omitempty"` + + // A VPC ID that the load balancer should be attached to. + // +kubebuilder:validation:Optional + VPC *string `json:"vpc,omitempty" tf:"vpc,omitempty"` +} + type SSLObservation struct { // The SSL Certificate. @@ -271,53 +271,53 @@ type SSLParameters struct { PrivateKeySecretRef v1.SecretKeySelector `json:"privateKeySecretRef" tf:"-"` } -// BalancerSpec defines the desired state of Balancer -type BalancerSpec struct { +// LoadBalancerSpec defines the desired state of LoadBalancer +type LoadBalancerSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider BalancerParameters `json:"forProvider"` + ForProvider LoadBalancerParameters `json:"forProvider"` } -// BalancerStatus defines the observed state of Balancer. -type BalancerStatus struct { +// LoadBalancerStatus defines the observed state of LoadBalancer. +type LoadBalancerStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider BalancerObservation `json:"atProvider,omitempty"` + AtProvider LoadBalancerObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// Balancer is the Schema for the Balancers API. Get information about a Vultr Load Balancer. +// LoadBalancer is the Schema for the LoadBalancers API. Get information about a Vultr Load Balancer. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} -type Balancer struct { +type LoadBalancer struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.forwardingRules)",message="forwardingRules is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" - Spec BalancerSpec `json:"spec"` - Status BalancerStatus `json:"status,omitempty"` + Spec LoadBalancerSpec `json:"spec"` + Status LoadBalancerStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// BalancerList contains a list of Balancers -type BalancerList struct { +// LoadBalancerList contains a list of LoadBalancers +type LoadBalancerList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []Balancer `json:"items"` + Items []LoadBalancer `json:"items"` } // Repository type metadata. var ( - Balancer_Kind = "Balancer" - Balancer_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Balancer_Kind}.String() - Balancer_KindAPIVersion = Balancer_Kind + "." + CRDGroupVersion.String() - Balancer_GroupVersionKind = CRDGroupVersion.WithKind(Balancer_Kind) + LoadBalancer_Kind = "LoadBalancer" + LoadBalancer_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: LoadBalancer_Kind}.String() + LoadBalancer_KindAPIVersion = LoadBalancer_Kind + "." + CRDGroupVersion.String() + LoadBalancer_GroupVersionKind = CRDGroupVersion.WithKind(LoadBalancer_Kind) ) func init() { - SchemeBuilder.Register(&Balancer{}, &BalancerList{}) + SchemeBuilder.Register(&LoadBalancer{}, &LoadBalancerList{}) } diff --git a/apis/zz_register.go b/apis/zz_register.go index f791422..2c798d3 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -12,7 +12,6 @@ import ( v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" v1alpha1kubernetes "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" - v1alpha1load "github.com/crossplane-contrib/provider-vultr/apis/load/v1alpha1" v1alpha1object "github.com/crossplane-contrib/provider-vultr/apis/object/v1alpha1" v1alpha1apis "github.com/crossplane-contrib/provider-vultr/apis/v1alpha1" v1beta1 "github.com/crossplane-contrib/provider-vultr/apis/v1beta1" @@ -24,7 +23,6 @@ func init() { AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha1kubernetes.SchemeBuilder.AddToScheme, - v1alpha1load.SchemeBuilder.AddToScheme, v1alpha1object.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/baremetal/config.go b/config/baremetal/config.go new file mode 100644 index 0000000..9dc9bdf --- /dev/null +++ b/config/baremetal/config.go @@ -0,0 +1,9 @@ +package baremetal + +import "github.com/upbound/upjet/pkg/config" + +func Configure(p *config.Provider) { + p.AddResourceConfigurator("vultr_bare_metal_server", func(r *config.Resource) { + //r.ShortGroup = "baremetal" + }) +} \ No newline at end of file diff --git a/config/external_name.go b/config/external_name.go index 1303de0..dc2410d 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -10,17 +10,18 @@ import "github.com/upbound/upjet/pkg/config" // provider. var ExternalNameConfigs = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: nl-2e21sda - "null_resource": config.IdentifierFromProvider, - "vultr_kubernetes": config.IdentifierFromProvider, + "null_resource": config.IdentifierFromProvider, + "vultr_kubernetes": config.IdentifierFromProvider, "vultr_kubernetes_node_pools": config.IdentifierFromProvider, "vultr_object_storage": config.NameAsIdentifier, "vultr_instance": config.NameAsIdentifier, - "vultr_database": config.IdentifierFromProvider, - "vultr_database_connection_pool": config.IdentifierFromProvider, - "vultr_database_db": config.IdentifierFromProvider, - "vultr_database_replica": config.IdentifierFromProvider, - "vultr_database_user": config.IdentifierFromProvider, - "vultr_load_balancer": config.IdentifierFromProvider, + "vultr_load_balancer": config.NameAsIdentifier, + "vultr_database": config.NameAsIdentifier, + "vultr_database_connection_pool": config.NameAsIdentifier, + "vultr_database_db": config.NameAsIdentifier, + "vultr_database_replica": config.NameAsIdentifier, + "vultr_database_user": config.NameAsIdentifier, + "vultr_bare_metal_server": config.NameAsIdentifier, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/groups.go b/config/groups.go new file mode 100644 index 0000000..df2fc5c --- /dev/null +++ b/config/groups.go @@ -0,0 +1,54 @@ +/* +Copyright 2021 Upbound Inc. +*/ + +package config + +import ( + "strings" + + "github.com/upbound/upjet/pkg/config" + "github.com/upbound/upjet/pkg/types/name" +) + +// GroupKindOverrides overrides the group and kind of the resource if it matches +// any entry in the GroupMap. +func GroupKindOverrides() config.ResourceOption { + return func(r *config.Resource) { + if f, ok := GroupMap[r.Name]; ok { + r.ShortGroup, r.Kind = f(r.Name) + } + } +} + + +// GroupKindCalculator returns the correct group and kind name for given TF +// resource. +type GroupKindCalculator func(resource string) (string, string) + +// ReplaceGroupWords uses given group as the group of the resource and removes +// a number of words in resource name before calculating the kind of the resource. +func ReplaceGroupWords(group string, count int) GroupKindCalculator { + return func(resource string) (string, string) { + words := strings.Split(strings.TrimPrefix(resource, "vultr_"), "_") + snakeKind := strings.Join(words[count:], "_") + return group, name.NewFromSnake(snakeKind).Camel + } +} + + +var GroupMap = map[string]GroupKindCalculator{ + //"aws_alb_listener_certificate": ReplaceGroupWords("elbv2", 0), + "vultr_load_balancer": ReplaceGroupWords("vultr", 0), + "vultr_bare_metal_server": ReplaceGroupWords("vultr", 0), + + +} + +// KindMap contains kind string overrides. +var KindMap = map[string]string{ + "vultr_load_balancer": "loadbalancer", + "vultr_bare_metal_server": "baremetal", + + +} \ No newline at end of file diff --git a/config/kubernetes/config.go b/config/kubernetes/config.go index cca0063..35c5bf8 100644 --- a/config/kubernetes/config.go +++ b/config/kubernetes/config.go @@ -5,4 +5,7 @@ import "github.com/upbound/upjet/pkg/config" func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_kubernetes", func(r *config.Resource) { }) + + p.AddResourceConfigurator("vultr_kubernetes_node_pools", func(r *config.Resource) { + }) } diff --git a/config/loadbalancer/config.go b/config/loadbalancer/config.go index bdb7d87..a11d354 100644 --- a/config/loadbalancer/config.go +++ b/config/loadbalancer/config.go @@ -4,5 +4,6 @@ import "github.com/upbound/upjet/pkg/config" func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_load_balancer", func(r *config.Resource) { + //r.ShortGroup = "loadbalancer" }) } diff --git a/config/nodepools/config.go b/config/nodepools/config.go deleted file mode 100644 index 34caa91..0000000 --- a/config/nodepools/config.go +++ /dev/null @@ -1,8 +0,0 @@ -package nodepools - -import "github.com/upbound/upjet/pkg/config" - -func Configure(p *config.Provider) { - p.AddResourceConfigurator("vultr_kubernetes_node_pools", func(r *config.Resource) { - }) -} diff --git a/config/provider.go b/config/provider.go index 42ccd3b..241c331 100644 --- a/config/provider.go +++ b/config/provider.go @@ -10,11 +10,11 @@ import ( ujconfig "github.com/upbound/upjet/pkg/config" + "github.com/crossplane-contrib/provider-vultr/config/baremetal" "github.com/crossplane-contrib/provider-vultr/config/compute" "github.com/crossplane-contrib/provider-vultr/config/database" "github.com/crossplane-contrib/provider-vultr/config/kubernetes" "github.com/crossplane-contrib/provider-vultr/config/loadbalancer" - "github.com/crossplane-contrib/provider-vultr/config/nodepools" "github.com/crossplane-contrib/provider-vultr/config/object" ) @@ -29,22 +29,30 @@ var providerSchema string //go:embed provider-metadata.yaml var providerMetadata string + // GetProvider returns provider configuration func GetProvider() *ujconfig.Provider { pc := ujconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), + //ujconfig.WithShortName("vultr"), + //ujconfig.WithRootGroup("vultr.upbound.io"), ujconfig.WithIncludeList(ExternalNameConfigured()), ujconfig.WithFeaturesPackage("internal/features"), ujconfig.WithDefaultResourceOptions( ExternalNameConfigurations(), + GroupKindOverrides(), + + )) for _, configure := range []func(provider *ujconfig.Provider){ kubernetes.Configure, - nodepools.Configure, object.Configure, compute.Configure, - database.Configure, loadbalancer.Configure, + database.Configure, + baremetal.Configure, + + } { configure(pc) } diff --git a/examples-generated/database/connectionpool.yaml b/examples-generated/database/connectionpool.yaml index 12da10c..3e99a6d 100644 --- a/examples-generated/database/connectionpool.yaml +++ b/examples-generated/database/connectionpool.yaml @@ -11,7 +11,6 @@ spec: database: defaultdb databaseId: ${vultr_database.my_database.id} mode: transaction - name: my_database_connection_pool_name size: "3" username: vultradmin diff --git a/examples-generated/database/db.yaml b/examples-generated/database/db.yaml index ad3521c..6d56ad6 100644 --- a/examples-generated/database/db.yaml +++ b/examples-generated/database/db.yaml @@ -9,7 +9,6 @@ metadata: spec: forProvider: databaseId: ${vultr_database.my_database.id} - name: my_database_db --- diff --git a/examples-generated/vultr/baremetalserver.yaml b/examples-generated/vultr/baremetalserver.yaml new file mode 100644 index 0000000..fb5dcc9 --- /dev/null +++ b/examples-generated/vultr/baremetalserver.yaml @@ -0,0 +1,16 @@ +apiVersion: vultr.vultr.upbound.io/v1alpha1 +kind: BareMetalServer +metadata: + annotations: + meta.upbound.io/example-id: vultr/v1alpha1/baremetalserver + labels: + testing.upbound.io/example-name: my_server + name: my-server +spec: + forProvider: + osId: 270 + plan: vbm-4c-32gb + region: ewr + +--- + diff --git a/examples-generated/load/balancer.yaml b/examples-generated/vultr/loadbalancer.yaml similarity index 80% rename from examples-generated/load/balancer.yaml rename to examples-generated/vultr/loadbalancer.yaml index 5d628c2..63a143f 100644 --- a/examples-generated/load/balancer.yaml +++ b/examples-generated/vultr/loadbalancer.yaml @@ -1,8 +1,8 @@ -apiVersion: load.vultr.upbound.io/v1alpha1 -kind: Balancer +apiVersion: vultr.vultr.upbound.io/v1alpha1 +kind: LoadBalancer metadata: annotations: - meta.upbound.io/example-id: load/v1alpha1/balancer + meta.upbound.io/example-id: vultr/v1alpha1/loadbalancer labels: testing.upbound.io/example-name: lb name: lb diff --git a/internal/controller/database/connectionpool/zz_controller.go b/internal/controller/database/connectionpool/zz_controller.go index 9ecf96a..4206bb9 100755 --- a/internal/controller/database/connectionpool/zz_controller.go +++ b/internal/controller/database/connectionpool/zz_controller.go @@ -26,6 +26,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.ConnectionPool_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/database/db/zz_controller.go b/internal/controller/database/db/zz_controller.go index b9f3e14..670a98e 100755 --- a/internal/controller/database/db/zz_controller.go +++ b/internal/controller/database/db/zz_controller.go @@ -26,6 +26,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.DB_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/database/replica/zz_controller.go b/internal/controller/database/replica/zz_controller.go index f901ab7..4337b2f 100755 --- a/internal/controller/database/replica/zz_controller.go +++ b/internal/controller/database/replica/zz_controller.go @@ -26,6 +26,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.Replica_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/database/user/zz_controller.go b/internal/controller/database/user/zz_controller.go index c44dde6..7d30f88 100755 --- a/internal/controller/database/user/zz_controller.go +++ b/internal/controller/database/user/zz_controller.go @@ -26,6 +26,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.User_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/vultr/baremetalserver/zz_controller.go b/internal/controller/vultr/baremetalserver/zz_controller.go new file mode 100755 index 0000000..15de0c2 --- /dev/null +++ b/internal/controller/vultr/baremetalserver/zz_controller.go @@ -0,0 +1,56 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package baremetalserver + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles BareMetalServer managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.BareMetalServer_GroupVersionKind.String()) + var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_bare_metal_server"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.BareMetalServer_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.BareMetalServer_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.BareMetalServer{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/vultr/database/zz_controller.go b/internal/controller/vultr/database/zz_controller.go index 829ea45..e6e6410 100755 --- a/internal/controller/vultr/database/zz_controller.go +++ b/internal/controller/vultr/database/zz_controller.go @@ -26,6 +26,7 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.Database_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/load/balancer/zz_controller.go b/internal/controller/vultr/loadbalancer/zz_controller.go similarity index 80% rename from internal/controller/load/balancer/zz_controller.go rename to internal/controller/vultr/loadbalancer/zz_controller.go index 4321952..19124f0 100755 --- a/internal/controller/load/balancer/zz_controller.go +++ b/internal/controller/vultr/loadbalancer/zz_controller.go @@ -4,7 +4,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package balancer +package loadbalancer import ( "time" @@ -18,21 +18,22 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/load/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" features "github.com/crossplane-contrib/provider-vultr/internal/features" ) -// Setup adds a controller that reconciles Balancer managed resources. +// Setup adds a controller that reconciles LoadBalancer managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.Balancer_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.LoadBalancer_GroupVersionKind.String()) var initializers managed.InitializerChain + initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) } opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_load_balancer"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Balancer_GroupVersionKind))), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.LoadBalancer_GroupVersionKind))), )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -45,11 +46,11 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableAlphaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Balancer_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.LoadBalancer_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Balancer{}). + For(&v1alpha1.LoadBalancer{}). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 4dc7960..e7d2058 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -14,12 +14,13 @@ import ( replica "github.com/crossplane-contrib/provider-vultr/internal/controller/database/replica" user "github.com/crossplane-contrib/provider-vultr/internal/controller/database/user" nodepools "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/nodepools" - balancer "github.com/crossplane-contrib/provider-vultr/internal/controller/load/balancer" storage "github.com/crossplane-contrib/provider-vultr/internal/controller/object/storage" providerconfig "github.com/crossplane-contrib/provider-vultr/internal/controller/providerconfig" + baremetalserver "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/baremetalserver" database "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/database" instance "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/instance" kubernetes "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/kubernetes" + loadbalancer "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/loadbalancer" ) // Setup creates all controllers with the supplied logger and adds them to @@ -31,12 +32,13 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { replica.Setup, user.Setup, nodepools.Setup, - balancer.Setup, storage.Setup, providerconfig.Setup, + baremetalserver.Setup, database.Setup, instance.Setup, kubernetes.Setup, + loadbalancer.Setup, } { if err := setup(mgr, o); err != nil { return err diff --git a/package/crds/database.vultr.upbound.io_connectionpools.yaml b/package/crds/database.vultr.upbound.io_connectionpools.yaml index 23a4df6..c0f0324 100644 --- a/package/crds/database.vultr.upbound.io_connectionpools.yaml +++ b/package/crds/database.vultr.upbound.io_connectionpools.yaml @@ -82,9 +82,6 @@ spec: description: The mode to configure for the new managed database connection pool (session, transaction, statement). type: string - name: - description: The name of the new managed database connection pool. - type: string size: description: The size of the new managed database connection pool. type: number @@ -286,8 +283,6 @@ spec: rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) - message: mode is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.mode) - - message: name is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name) - message: size is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size) - message: username is a required parameter @@ -311,9 +306,6 @@ spec: description: The mode to configure for the new managed database connection pool (session, transaction, statement). type: string - name: - description: The name of the new managed database connection pool. - type: string size: description: The size of the new managed database connection pool. type: number diff --git a/package/crds/database.vultr.upbound.io_dbs.yaml b/package/crds/database.vultr.upbound.io_dbs.yaml index 5ce4709..b148d97 100644 --- a/package/crds/database.vultr.upbound.io_dbs.yaml +++ b/package/crds/database.vultr.upbound.io_dbs.yaml @@ -73,9 +73,6 @@ spec: description: The managed database ID you want to attach this logical DB to. type: string - name: - description: The name of the new managed database logical DB. - type: string type: object managementPolicy: default: FullControl @@ -266,8 +263,6 @@ spec: x-kubernetes-validations: - message: databaseId is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) - - message: name is a required parameter - rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name) status: description: DBStatus defines the observed state of DB. properties: @@ -279,9 +274,6 @@ spec: type: string id: type: string - name: - description: The name of the new managed database logical DB. - type: string type: object conditions: description: Conditions of the resource. diff --git a/package/crds/vultr.vultr.upbound.io_baremetalservers.yaml b/package/crds/vultr.vultr.upbound.io_baremetalservers.yaml new file mode 100644 index 0000000..e1db6b6 --- /dev/null +++ b/package/crds/vultr.vultr.upbound.io_baremetalservers.yaml @@ -0,0 +1,481 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: baremetalservers.vultr.vultr.upbound.io +spec: + group: vultr.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: BareMetalServer + listKind: BareMetalServerList + plural: baremetalservers + singular: baremetalserver + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: BareMetalServer is the Schema for the BareMetalServers API. Provides + a Vultr bare metal server resource. This can be used to create, read, modify, + and delete bare metal servers on your Vultr account. + 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: BareMetalServerSpec defines the desired state of BareMetalServer + 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 ManagementPolicy 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: + activationEmail: + description: Whether an activation email will be sent when the + server is ready. + type: boolean + appId: + description: The ID of the Vultr application to be installed on + the server. See List Applications + type: number + enableIpv6: + description: Whether the server has IPv6 networking activated. + type: boolean + hostname: + description: The hostname to assign to the server. + type: string + imageId: + description: 'The ID of the Vultr marketplace application to be + installed on the server. See List Applications Note marketplace + applications are denoted by type: marketplace and you must use + the image_id not the id.' + type: string + label: + description: A label for the server. + type: string + osId: + description: The ID of the operating system to be installed on + the server. See List OS + type: number + plan: + description: The ID of the plan that you want the server to subscribe + to. See List Plans + type: string + region: + description: The ID of the region that the server is to be created + in. See List Regions + type: string + reservedIpv4: + description: The ID of the floating IP to use as the main IP of + this server. See Reserved IPs + type: string + scriptId: + description: The ID of the startup script you want added to the + server. + type: string + snapshotId: + description: The ID of the Vultr snapshot that the server will + restore for the initial installation. See List Snapshots + type: string + sshKeyIds: + description: A list of SSH key IDs to apply to the server on install + (only valid for Linux/FreeBSD). + items: + type: string + type: array + tags: + description: A list of tags to apply to the servier. + items: + type: string + type: array + userData: + description: Generic data store, which some provisioning tools + and cloud operating systems use as a configuration file. It + is generally consumed only once after an instance has been launched, + but individual needs may vary. + type: string + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: plan is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.plan) + - message: region is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + status: + description: BareMetalServerStatus defines the observed state of BareMetalServer. + properties: + atProvider: + properties: + activationEmail: + description: Whether an activation email will be sent when the + server is ready. + type: boolean + appId: + description: The ID of the Vultr application to be installed on + the server. See List Applications + type: number + cpuCount: + description: The number of CPUs available on the server. + type: number + dateCreated: + description: The date the server was added to your Vultr account. + type: string + disk: + description: The description of the disk(s) on the server. + type: string + enableIpv6: + description: Whether the server has IPv6 networking activated. + type: boolean + gatewayV4: + description: The server's IPv4 gateway. + type: string + hostname: + description: The hostname to assign to the server. + type: string + id: + description: ID of the server. + type: string + imageId: + description: 'The ID of the Vultr marketplace application to be + installed on the server. See List Applications Note marketplace + applications are denoted by type: marketplace and you must use + the image_id not the id.' + type: string + label: + description: A label for the server. + type: string + macAddress: + description: The MAC address associated with the server. + type: number + mainIp: + description: The server's main IP address. + type: string + netmaskV4: + description: The server's IPv4 netmask. + type: string + os: + description: The string description of the operating system installed + on the server. + type: string + osId: + description: The ID of the operating system to be installed on + the server. See List OS + type: number + plan: + description: The ID of the plan that you want the server to subscribe + to. See List Plans + type: string + ram: + description: The amount of memory available on the server in MB. + type: string + region: + description: The ID of the region that the server is to be created + in. See List Regions + type: string + reservedIpv4: + description: The ID of the floating IP to use as the main IP of + this server. See Reserved IPs + type: string + scriptId: + description: The ID of the startup script you want added to the + server. + type: string + snapshotId: + description: The ID of the Vultr snapshot that the server will + restore for the initial installation. See List Snapshots + type: string + sshKeyIds: + description: A list of SSH key IDs to apply to the server on install + (only valid for Linux/FreeBSD). + items: + type: string + type: array + status: + description: The status of the server's subscription. + type: string + tags: + description: A list of tags to apply to the servier. + items: + type: string + type: array + userData: + description: Generic data store, which some provisioning tools + and cloud operating systems use as a configuration file. It + is generally consumed only once after an instance has been launched, + but individual needs may vary. + type: string + v6MainIp: + description: The main IPv6 network address. + type: string + v6Network: + description: The IPv6 subnet. + type: string + v6NetworkSize: + description: The IPv6 network size in bits. + type: number + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/load.vultr.upbound.io_balancers.yaml b/package/crds/vultr.vultr.upbound.io_loadbalancers.yaml similarity index 98% rename from package/crds/load.vultr.upbound.io_balancers.yaml rename to package/crds/vultr.vultr.upbound.io_loadbalancers.yaml index 46f1059..b3663ac 100644 --- a/package/crds/load.vultr.upbound.io_balancers.yaml +++ b/package/crds/vultr.vultr.upbound.io_loadbalancers.yaml @@ -5,18 +5,18 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: balancers.load.vultr.upbound.io + name: loadbalancers.vultr.vultr.upbound.io spec: - group: load.vultr.upbound.io + group: vultr.vultr.upbound.io names: categories: - crossplane - managed - vultr - kind: Balancer - listKind: BalancerList - plural: balancers - singular: balancer + kind: LoadBalancer + listKind: LoadBalancerList + plural: loadbalancers + singular: loadbalancer scope: Cluster versions: - additionalPrinterColumns: @@ -35,7 +35,7 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: Balancer is the Schema for the Balancers API. Get information + description: LoadBalancer is the Schema for the LoadBalancers API. Get information about a Vultr Load Balancer. properties: apiVersion: @@ -51,7 +51,7 @@ spec: metadata: type: object spec: - description: BalancerSpec defines the desired state of Balancer + description: LoadBalancerSpec defines the desired state of LoadBalancer properties: deletionPolicy: default: Delete @@ -424,7 +424,7 @@ spec: - message: region is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) status: - description: BalancerStatus defines the observed state of Balancer. + description: LoadBalancerStatus defines the observed state of LoadBalancer. properties: atProvider: properties: From f56860f8ac49eb270667364098689385046fbf26 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Tue, 15 Aug 2023 10:46:03 -0400 Subject: [PATCH 05/13] Import resource with IdentifierFromProvider --- config/external_name.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/external_name.go b/config/external_name.go index dc2410d..d48cacd 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -13,15 +13,15 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "null_resource": config.IdentifierFromProvider, "vultr_kubernetes": config.IdentifierFromProvider, "vultr_kubernetes_node_pools": config.IdentifierFromProvider, - "vultr_object_storage": config.NameAsIdentifier, - "vultr_instance": config.NameAsIdentifier, - "vultr_load_balancer": config.NameAsIdentifier, - "vultr_database": config.NameAsIdentifier, - "vultr_database_connection_pool": config.NameAsIdentifier, - "vultr_database_db": config.NameAsIdentifier, - "vultr_database_replica": config.NameAsIdentifier, - "vultr_database_user": config.NameAsIdentifier, - "vultr_bare_metal_server": config.NameAsIdentifier, + "vultr_object_storage": config.IdentifierFromProvider, + "vultr_instance": config.IdentifierFromProvider, + "vultr_load_balancer": config.IdentifierFromProvider, + "vultr_database": config.IdentifierFromProvider, + "vultr_database_connection_pool": config.IdentifierFromProvider, + "vultr_database_db": config.IdentifierFromProvider, + "vultr_database_replica": config.IdentifierFromProvider, + "vultr_database_user": config.IdentifierFromProvider, + "vultr_bare_metal_server": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the From 68cd0438cd7161959bcaa238d8e5ed05a0ab4181 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Mon, 21 Aug 2023 15:30:48 -0400 Subject: [PATCH 06/13] regenerate resources --- .../v1alpha1/zz_connectionpool_types.go | 8 ++++++++ apis/database/v1alpha1/zz_db_types.go | 8 ++++++++ .../v1alpha1/zz_generated.deepcopy.go | 20 +++++++++++++++++++ config/external_name.go | 2 +- .../database/connectionpool.yaml | 1 + examples-generated/database/db.yaml | 1 + .../database/connectionpool/zz_controller.go | 1 - .../controller/database/db/zz_controller.go | 1 - .../database/replica/zz_controller.go | 1 - .../controller/database/user/zz_controller.go | 1 - .../vultr/baremetalserver/zz_controller.go | 1 - .../vultr/database/zz_controller.go | 1 - .../vultr/instance/zz_controller.go | 1 - .../vultr/loadbalancer/zz_controller.go | 1 - ...base.vultr.upbound.io_connectionpools.yaml | 8 ++++++++ .../crds/database.vultr.upbound.io_dbs.yaml | 8 ++++++++ 16 files changed, 55 insertions(+), 9 deletions(-) diff --git a/apis/database/v1alpha1/zz_connectionpool_types.go b/apis/database/v1alpha1/zz_connectionpool_types.go index c1a9847..d6a6de4 100755 --- a/apis/database/v1alpha1/zz_connectionpool_types.go +++ b/apis/database/v1alpha1/zz_connectionpool_types.go @@ -26,6 +26,9 @@ type ConnectionPoolObservation struct { // The mode to configure for the new managed database connection pool (session, transaction, statement). Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + // The name of the new managed database connection pool. + Name *string `json:"name,omitempty" tf:"name,omitempty"` + // The size of the new managed database connection pool. Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -47,6 +50,10 @@ type ConnectionPoolParameters struct { // +kubebuilder:validation:Optional Mode *string `json:"mode,omitempty" tf:"mode,omitempty"` + // The name of the new managed database connection pool. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` + // The size of the new managed database connection pool. // +kubebuilder:validation:Optional Size *float64 `json:"size,omitempty" tf:"size,omitempty"` @@ -83,6 +90,7 @@ type ConnectionPool struct { // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.database)",message="database is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.mode)",message="mode is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size)",message="size is a required parameter" // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.username)",message="username is a required parameter" Spec ConnectionPoolSpec `json:"spec"` diff --git a/apis/database/v1alpha1/zz_db_types.go b/apis/database/v1alpha1/zz_db_types.go index 728943f..aae31d7 100755 --- a/apis/database/v1alpha1/zz_db_types.go +++ b/apis/database/v1alpha1/zz_db_types.go @@ -19,6 +19,9 @@ type DBObservation struct { DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The name of the new managed database logical DB. + Name *string `json:"name,omitempty" tf:"name,omitempty"` } type DBParameters struct { @@ -26,6 +29,10 @@ type DBParameters struct { // The managed database ID you want to attach this logical DB to. // +kubebuilder:validation:Optional DatabaseID *string `json:"databaseId,omitempty" tf:"database_id,omitempty"` + + // The name of the new managed database logical DB. + // +kubebuilder:validation:Optional + Name *string `json:"name,omitempty" tf:"name,omitempty"` } // DBSpec defines the desired state of DB @@ -53,6 +60,7 @@ type DB struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId)",message="databaseId is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name)",message="name is a required parameter" Spec DBSpec `json:"spec"` Status DBStatus `json:"status,omitempty"` } diff --git a/apis/database/v1alpha1/zz_generated.deepcopy.go b/apis/database/v1alpha1/zz_generated.deepcopy.go index fa02efc..96280de 100644 --- a/apis/database/v1alpha1/zz_generated.deepcopy.go +++ b/apis/database/v1alpha1/zz_generated.deepcopy.go @@ -95,6 +95,11 @@ func (in *ConnectionPoolObservation) DeepCopyInto(out *ConnectionPoolObservation *out = new(string) **out = **in } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -135,6 +140,11 @@ func (in *ConnectionPoolParameters) DeepCopyInto(out *ConnectionPoolParameters) *out = new(string) **out = **in } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } if in.Size != nil { in, out := &in.Size, &out.Size *out = new(float64) @@ -263,6 +273,11 @@ func (in *DBObservation) DeepCopyInto(out *DBObservation) { *out = new(string) **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 DBObservation. @@ -283,6 +298,11 @@ func (in *DBParameters) DeepCopyInto(out *DBParameters) { *out = new(string) **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 DBParameters. diff --git a/config/external_name.go b/config/external_name.go index d48cacd..39d591e 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -13,7 +13,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "null_resource": config.IdentifierFromProvider, "vultr_kubernetes": config.IdentifierFromProvider, "vultr_kubernetes_node_pools": config.IdentifierFromProvider, - "vultr_object_storage": config.IdentifierFromProvider, + "vultr_object_storage": config.NameAsIdentifier, "vultr_instance": config.IdentifierFromProvider, "vultr_load_balancer": config.IdentifierFromProvider, "vultr_database": config.IdentifierFromProvider, diff --git a/examples-generated/database/connectionpool.yaml b/examples-generated/database/connectionpool.yaml index 3e99a6d..12da10c 100644 --- a/examples-generated/database/connectionpool.yaml +++ b/examples-generated/database/connectionpool.yaml @@ -11,6 +11,7 @@ spec: database: defaultdb databaseId: ${vultr_database.my_database.id} mode: transaction + name: my_database_connection_pool_name size: "3" username: vultradmin diff --git a/examples-generated/database/db.yaml b/examples-generated/database/db.yaml index 6d56ad6..ad3521c 100644 --- a/examples-generated/database/db.yaml +++ b/examples-generated/database/db.yaml @@ -9,6 +9,7 @@ metadata: spec: forProvider: databaseId: ${vultr_database.my_database.id} + name: my_database_db --- diff --git a/internal/controller/database/connectionpool/zz_controller.go b/internal/controller/database/connectionpool/zz_controller.go index 4206bb9..9ecf96a 100755 --- a/internal/controller/database/connectionpool/zz_controller.go +++ b/internal/controller/database/connectionpool/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.ConnectionPool_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/database/db/zz_controller.go b/internal/controller/database/db/zz_controller.go index 670a98e..b9f3e14 100755 --- a/internal/controller/database/db/zz_controller.go +++ b/internal/controller/database/db/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.DB_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/database/replica/zz_controller.go b/internal/controller/database/replica/zz_controller.go index 4337b2f..f901ab7 100755 --- a/internal/controller/database/replica/zz_controller.go +++ b/internal/controller/database/replica/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.Replica_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/database/user/zz_controller.go b/internal/controller/database/user/zz_controller.go index 7d30f88..c44dde6 100755 --- a/internal/controller/database/user/zz_controller.go +++ b/internal/controller/database/user/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.User_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/vultr/baremetalserver/zz_controller.go b/internal/controller/vultr/baremetalserver/zz_controller.go index 15de0c2..a7a6dd5 100755 --- a/internal/controller/vultr/baremetalserver/zz_controller.go +++ b/internal/controller/vultr/baremetalserver/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.BareMetalServer_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/vultr/database/zz_controller.go b/internal/controller/vultr/database/zz_controller.go index e6e6410..829ea45 100755 --- a/internal/controller/vultr/database/zz_controller.go +++ b/internal/controller/vultr/database/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.Database_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/vultr/instance/zz_controller.go b/internal/controller/vultr/instance/zz_controller.go index 0e7f24a..15eb9a5 100755 --- a/internal/controller/vultr/instance/zz_controller.go +++ b/internal/controller/vultr/instance/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.Instance_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/internal/controller/vultr/loadbalancer/zz_controller.go b/internal/controller/vultr/loadbalancer/zz_controller.go index 19124f0..c28c431 100755 --- a/internal/controller/vultr/loadbalancer/zz_controller.go +++ b/internal/controller/vultr/loadbalancer/zz_controller.go @@ -26,7 +26,6 @@ import ( func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { name := managed.ControllerName(v1alpha1.LoadBalancer_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) diff --git a/package/crds/database.vultr.upbound.io_connectionpools.yaml b/package/crds/database.vultr.upbound.io_connectionpools.yaml index c0f0324..23a4df6 100644 --- a/package/crds/database.vultr.upbound.io_connectionpools.yaml +++ b/package/crds/database.vultr.upbound.io_connectionpools.yaml @@ -82,6 +82,9 @@ spec: description: The mode to configure for the new managed database connection pool (session, transaction, statement). type: string + name: + description: The name of the new managed database connection pool. + type: string size: description: The size of the new managed database connection pool. type: number @@ -283,6 +286,8 @@ spec: rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) - message: mode is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.mode) + - message: name is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name) - message: size is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.size) - message: username is a required parameter @@ -306,6 +311,9 @@ spec: description: The mode to configure for the new managed database connection pool (session, transaction, statement). type: string + name: + description: The name of the new managed database connection pool. + type: string size: description: The size of the new managed database connection pool. type: number diff --git a/package/crds/database.vultr.upbound.io_dbs.yaml b/package/crds/database.vultr.upbound.io_dbs.yaml index b148d97..5ce4709 100644 --- a/package/crds/database.vultr.upbound.io_dbs.yaml +++ b/package/crds/database.vultr.upbound.io_dbs.yaml @@ -73,6 +73,9 @@ spec: description: The managed database ID you want to attach this logical DB to. type: string + name: + description: The name of the new managed database logical DB. + type: string type: object managementPolicy: default: FullControl @@ -263,6 +266,8 @@ spec: x-kubernetes-validations: - message: databaseId is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.databaseId) + - message: name is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.name) status: description: DBStatus defines the observed state of DB. properties: @@ -274,6 +279,9 @@ spec: type: string id: type: string + name: + description: The name of the new managed database logical DB. + type: string type: object conditions: description: Conditions of the resource. From 6cf62313a4e6d4710617d5748295b7369df060b1 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Mon, 28 Aug 2023 11:21:36 -0400 Subject: [PATCH 07/13] object storage generation fix --- apis/object/v1alpha1/zz_generated.deepcopy.go | 187 ------------------ apis/object/v1alpha1/zz_generated.managed.go | 84 -------- .../v1alpha1/zz_generated.managedlist.go | 17 -- .../v1alpha1/zz_generated_terraformed.go | 88 --------- apis/object/v1alpha1/zz_groupversion_info.go | 32 --- apis/vultr/v1alpha1/zz_generated.deepcopy.go | 173 ++++++++++++++++ apis/vultr/v1alpha1/zz_generated.managed.go | 76 +++++++ .../v1alpha1/zz_generated.managedlist.go | 9 + .../v1alpha1/zz_generated_terraformed.go | 74 +++++++ .../v1alpha1/zz_objectstorage_types.go} | 40 ++-- apis/zz_register.go | 2 - config/external_name.go | 2 +- config/groups.go | 3 +- config/schema.json | 2 +- .../storage.yaml => vultr/objectstorage.yaml} | 6 +- .../objectstorage}/zz_controller.go | 15 +- internal/controller/zz_setup.go | 4 +- ...ultr.vultr.upbound.io_objectstorages.yaml} | 22 +-- 18 files changed, 379 insertions(+), 457 deletions(-) delete mode 100644 apis/object/v1alpha1/zz_generated.deepcopy.go delete mode 100644 apis/object/v1alpha1/zz_generated.managed.go delete mode 100644 apis/object/v1alpha1/zz_generated.managedlist.go delete mode 100755 apis/object/v1alpha1/zz_generated_terraformed.go delete mode 100755 apis/object/v1alpha1/zz_groupversion_info.go rename apis/{object/v1alpha1/zz_storage_types.go => vultr/v1alpha1/zz_objectstorage_types.go} (67%) rename examples-generated/{object/storage.yaml => vultr/objectstorage.yaml} (54%) rename internal/controller/{object/storage => vultr/objectstorage}/zz_controller.go (81%) rename package/crds/{object.vultr.upbound.io_storages.yaml => vultr.vultr.upbound.io_objectstorages.yaml} (96%) diff --git a/apis/object/v1alpha1/zz_generated.deepcopy.go b/apis/object/v1alpha1/zz_generated.deepcopy.go deleted file mode 100644 index 4ff1bd9..0000000 --- a/apis/object/v1alpha1/zz_generated.deepcopy.go +++ /dev/null @@ -1,187 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright 2022 Upbound Inc. -*/ - -// 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 *Storage) DeepCopyInto(out *Storage) { - *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 Storage. -func (in *Storage) DeepCopy() *Storage { - if in == nil { - return nil - } - out := new(Storage) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Storage) 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 *StorageList) DeepCopyInto(out *StorageList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Storage, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageList. -func (in *StorageList) DeepCopy() *StorageList { - if in == nil { - return nil - } - out := new(StorageList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *StorageList) 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 *StorageObservation) DeepCopyInto(out *StorageObservation) { - *out = *in - if in.ClusterID != nil { - in, out := &in.ClusterID, &out.ClusterID - *out = new(float64) - **out = **in - } - if in.DateCreated != nil { - in, out := &in.DateCreated, &out.DateCreated - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.Location != nil { - in, out := &in.Location, &out.Location - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.S3Hostname != nil { - in, out := &in.S3Hostname, &out.S3Hostname - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageObservation. -func (in *StorageObservation) DeepCopy() *StorageObservation { - if in == nil { - return nil - } - out := new(StorageObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StorageParameters) DeepCopyInto(out *StorageParameters) { - *out = *in - if in.ClusterID != nil { - in, out := &in.ClusterID, &out.ClusterID - *out = new(float64) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageParameters. -func (in *StorageParameters) DeepCopy() *StorageParameters { - if in == nil { - return nil - } - out := new(StorageParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StorageSpec) DeepCopyInto(out *StorageSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec. -func (in *StorageSpec) DeepCopy() *StorageSpec { - if in == nil { - return nil - } - out := new(StorageSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StorageStatus) DeepCopyInto(out *StorageStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageStatus. -func (in *StorageStatus) DeepCopy() *StorageStatus { - if in == nil { - return nil - } - out := new(StorageStatus) - in.DeepCopyInto(out) - return out -} diff --git a/apis/object/v1alpha1/zz_generated.managed.go b/apis/object/v1alpha1/zz_generated.managed.go deleted file mode 100644 index fc57644..0000000 --- a/apis/object/v1alpha1/zz_generated.managed.go +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - -// GetCondition of this Storage. -func (mg *Storage) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Storage. -func (mg *Storage) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicy of this Storage. -func (mg *Storage) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy -} - -// GetProviderConfigReference of this Storage. -func (mg *Storage) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -/* -GetProviderReference of this Storage. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Storage) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - -// GetPublishConnectionDetailsTo of this Storage. -func (mg *Storage) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Storage. -func (mg *Storage) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Storage. -func (mg *Storage) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Storage. -func (mg *Storage) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicy of this Storage. -func (mg *Storage) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r -} - -// SetProviderConfigReference of this Storage. -func (mg *Storage) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -/* -SetProviderReference of this Storage. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Storage) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - -// SetPublishConnectionDetailsTo of this Storage. -func (mg *Storage) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Storage. -func (mg *Storage) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} diff --git a/apis/object/v1alpha1/zz_generated.managedlist.go b/apis/object/v1alpha1/zz_generated.managedlist.go deleted file mode 100644 index 0e8d285..0000000 --- a/apis/object/v1alpha1/zz_generated.managedlist.go +++ /dev/null @@ -1,17 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ -// Code generated by angryjet. DO NOT EDIT. - -package v1alpha1 - -import resource "github.com/crossplane/crossplane-runtime/pkg/resource" - -// GetItems of this StorageList. -func (l *StorageList) 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/object/v1alpha1/zz_generated_terraformed.go b/apis/object/v1alpha1/zz_generated_terraformed.go deleted file mode 100755 index 39100cd..0000000 --- a/apis/object/v1alpha1/zz_generated_terraformed.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -package v1alpha1 - -import ( - "github.com/pkg/errors" - - "github.com/upbound/upjet/pkg/resource" - "github.com/upbound/upjet/pkg/resource/json" -) - -// GetTerraformResourceType returns Terraform resource type for this Storage -func (mg *Storage) GetTerraformResourceType() string { - return "vultr_object_storage" -} - -// GetConnectionDetailsMapping for this Storage -func (tr *Storage) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"s3_access_key": "status.atProvider.s3AccessKey", "s3_secret_key": "status.atProvider.s3SecretKey"} -} - -// GetObservation of this Storage -func (tr *Storage) 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 Storage -func (tr *Storage) 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 Storage -func (tr *Storage) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Storage -func (tr *Storage) 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 Storage -func (tr *Storage) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) -} - -// LateInitialize this Storage using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Storage) LateInitialize(attrs []byte) (bool, error) { - params := &StorageParameters{} - 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 *Storage) GetTerraformSchemaVersion() int { - return 0 -} diff --git a/apis/object/v1alpha1/zz_groupversion_info.go b/apis/object/v1alpha1/zz_groupversion_info.go deleted file mode 100755 index 08d3df5..0000000 --- a/apis/object/v1alpha1/zz_groupversion_info.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2022 Upbound Inc. -*/ - -// Code generated by upjet. DO NOT EDIT. - -// +kubebuilder:object:generate=true -// +groupName=object.vultr.upbound.io -// +versionName=v1alpha1 -package v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -// Package type metadata. -const ( - CRDGroup = "object.vultr.upbound.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/vultr/v1alpha1/zz_generated.deepcopy.go b/apis/vultr/v1alpha1/zz_generated.deepcopy.go index 869fc47..57b5381 100644 --- a/apis/vultr/v1alpha1/zz_generated.deepcopy.go +++ b/apis/vultr/v1alpha1/zz_generated.deepcopy.go @@ -2252,6 +2252,179 @@ func (in *NodesParameters) DeepCopy() *NodesParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectStorage) DeepCopyInto(out *ObjectStorage) { + *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 ObjectStorage. +func (in *ObjectStorage) DeepCopy() *ObjectStorage { + if in == nil { + return nil + } + out := new(ObjectStorage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ObjectStorage) 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 *ObjectStorageList) DeepCopyInto(out *ObjectStorageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ObjectStorage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStorageList. +func (in *ObjectStorageList) DeepCopy() *ObjectStorageList { + if in == nil { + return nil + } + out := new(ObjectStorageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ObjectStorageList) 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 *ObjectStorageObservation) DeepCopyInto(out *ObjectStorageObservation) { + *out = *in + if in.ClusterID != nil { + in, out := &in.ClusterID, &out.ClusterID + *out = new(float64) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.S3Hostname != nil { + in, out := &in.S3Hostname, &out.S3Hostname + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStorageObservation. +func (in *ObjectStorageObservation) DeepCopy() *ObjectStorageObservation { + if in == nil { + return nil + } + out := new(ObjectStorageObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectStorageParameters) DeepCopyInto(out *ObjectStorageParameters) { + *out = *in + if in.ClusterID != nil { + in, out := &in.ClusterID, &out.ClusterID + *out = new(float64) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStorageParameters. +func (in *ObjectStorageParameters) DeepCopy() *ObjectStorageParameters { + if in == nil { + return nil + } + out := new(ObjectStorageParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectStorageSpec) DeepCopyInto(out *ObjectStorageSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStorageSpec. +func (in *ObjectStorageSpec) DeepCopy() *ObjectStorageSpec { + if in == nil { + return nil + } + out := new(ObjectStorageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectStorageStatus) DeepCopyInto(out *ObjectStorageStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectStorageStatus. +func (in *ObjectStorageStatus) DeepCopy() *ObjectStorageStatus { + if in == nil { + return nil + } + out := new(ObjectStorageStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ReadReplicasObservation) DeepCopyInto(out *ReadReplicasObservation) { *out = *in diff --git a/apis/vultr/v1alpha1/zz_generated.managed.go b/apis/vultr/v1alpha1/zz_generated.managed.go index 60efa45..6900863 100644 --- a/apis/vultr/v1alpha1/zz_generated.managed.go +++ b/apis/vultr/v1alpha1/zz_generated.managed.go @@ -386,3 +386,79 @@ func (mg *LoadBalancer) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionD func (mg *LoadBalancer) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this ObjectStorage. +func (mg *ObjectStorage) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this ObjectStorage. +func (mg *ObjectStorage) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this ObjectStorage. +func (mg *ObjectStorage) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this ObjectStorage. +func (mg *ObjectStorage) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this ObjectStorage. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *ObjectStorage) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this ObjectStorage. +func (mg *ObjectStorage) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this ObjectStorage. +func (mg *ObjectStorage) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this ObjectStorage. +func (mg *ObjectStorage) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this ObjectStorage. +func (mg *ObjectStorage) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this ObjectStorage. +func (mg *ObjectStorage) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this ObjectStorage. +func (mg *ObjectStorage) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this ObjectStorage. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *ObjectStorage) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this ObjectStorage. +func (mg *ObjectStorage) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this ObjectStorage. +func (mg *ObjectStorage) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/vultr/v1alpha1/zz_generated.managedlist.go b/apis/vultr/v1alpha1/zz_generated.managedlist.go index f96053c..cc0398a 100644 --- a/apis/vultr/v1alpha1/zz_generated.managedlist.go +++ b/apis/vultr/v1alpha1/zz_generated.managedlist.go @@ -51,3 +51,12 @@ func (l *LoadBalancerList) GetItems() []resource.Managed { } return items } + +// GetItems of this ObjectStorageList. +func (l *ObjectStorageList) 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/vultr/v1alpha1/zz_generated_terraformed.go b/apis/vultr/v1alpha1/zz_generated_terraformed.go index 9fe4288..b5b6a8c 100755 --- a/apis/vultr/v1alpha1/zz_generated_terraformed.go +++ b/apis/vultr/v1alpha1/zz_generated_terraformed.go @@ -382,3 +382,77 @@ func (tr *LoadBalancer) LateInitialize(attrs []byte) (bool, error) { func (tr *LoadBalancer) GetTerraformSchemaVersion() int { return 0 } + +// GetTerraformResourceType returns Terraform resource type for this ObjectStorage +func (mg *ObjectStorage) GetTerraformResourceType() string { + return "vultr_object_storage" +} + +// GetConnectionDetailsMapping for this ObjectStorage +func (tr *ObjectStorage) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"s3_access_key": "status.atProvider.s3AccessKey", "s3_secret_key": "status.atProvider.s3SecretKey"} +} + +// GetObservation of this ObjectStorage +func (tr *ObjectStorage) 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 ObjectStorage +func (tr *ObjectStorage) 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 ObjectStorage +func (tr *ObjectStorage) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this ObjectStorage +func (tr *ObjectStorage) 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 ObjectStorage +func (tr *ObjectStorage) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this ObjectStorage using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *ObjectStorage) LateInitialize(attrs []byte) (bool, error) { + params := &ObjectStorageParameters{} + 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 *ObjectStorage) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/object/v1alpha1/zz_storage_types.go b/apis/vultr/v1alpha1/zz_objectstorage_types.go similarity index 67% rename from apis/object/v1alpha1/zz_storage_types.go rename to apis/vultr/v1alpha1/zz_objectstorage_types.go index 19ad426..763a225 100755 --- a/apis/object/v1alpha1/zz_storage_types.go +++ b/apis/vultr/v1alpha1/zz_objectstorage_types.go @@ -13,7 +13,7 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type StorageObservation struct { +type ObjectStorageObservation struct { // The region ID that you want the network to be created in. ClusterID *float64 `json:"clusterId,omitempty" tf:"cluster_id,omitempty"` @@ -40,7 +40,7 @@ type StorageObservation struct { Status *string `json:"status,omitempty" tf:"status,omitempty"` } -type StorageParameters struct { +type ObjectStorageParameters struct { // The region ID that you want the network to be created in. // +kubebuilder:validation:Optional @@ -51,52 +51,52 @@ type StorageParameters struct { Label *string `json:"label,omitempty" tf:"label,omitempty"` } -// StorageSpec defines the desired state of Storage -type StorageSpec struct { +// ObjectStorageSpec defines the desired state of ObjectStorage +type ObjectStorageSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider StorageParameters `json:"forProvider"` + ForProvider ObjectStorageParameters `json:"forProvider"` } -// StorageStatus defines the observed state of Storage. -type StorageStatus struct { +// ObjectStorageStatus defines the observed state of ObjectStorage. +type ObjectStorageStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider StorageObservation `json:"atProvider,omitempty"` + AtProvider ObjectStorageObservation `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true -// Storage is the Schema for the Storages API. Provides a Vultr private object storage resource. This can be used to create, read, update and delete object storage resources on your Vultr account. +// ObjectStorage is the Schema for the ObjectStorages API. Provides a Vultr private object storage resource. This can be used to create, read, update and delete object storage resources on your Vultr account. // +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" // +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" // +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" // +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" // +kubebuilder:subresource:status // +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} -type Storage struct { +type ObjectStorage struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.clusterId)",message="clusterId is a required parameter" - Spec StorageSpec `json:"spec"` - Status StorageStatus `json:"status,omitempty"` + Spec ObjectStorageSpec `json:"spec"` + Status ObjectStorageStatus `json:"status,omitempty"` } // +kubebuilder:object:root=true -// StorageList contains a list of Storages -type StorageList struct { +// ObjectStorageList contains a list of ObjectStorages +type ObjectStorageList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []Storage `json:"items"` + Items []ObjectStorage `json:"items"` } // Repository type metadata. var ( - Storage_Kind = "Storage" - Storage_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Storage_Kind}.String() - Storage_KindAPIVersion = Storage_Kind + "." + CRDGroupVersion.String() - Storage_GroupVersionKind = CRDGroupVersion.WithKind(Storage_Kind) + ObjectStorage_Kind = "ObjectStorage" + ObjectStorage_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: ObjectStorage_Kind}.String() + ObjectStorage_KindAPIVersion = ObjectStorage_Kind + "." + CRDGroupVersion.String() + ObjectStorage_GroupVersionKind = CRDGroupVersion.WithKind(ObjectStorage_Kind) ) func init() { - SchemeBuilder.Register(&Storage{}, &StorageList{}) + SchemeBuilder.Register(&ObjectStorage{}, &ObjectStorageList{}) } diff --git a/apis/zz_register.go b/apis/zz_register.go index 2c798d3..a64cacb 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -12,7 +12,6 @@ import ( v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" v1alpha1kubernetes "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" - v1alpha1object "github.com/crossplane-contrib/provider-vultr/apis/object/v1alpha1" v1alpha1apis "github.com/crossplane-contrib/provider-vultr/apis/v1alpha1" v1beta1 "github.com/crossplane-contrib/provider-vultr/apis/v1beta1" v1alpha1vultr "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" @@ -23,7 +22,6 @@ func init() { AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, v1alpha1kubernetes.SchemeBuilder.AddToScheme, - v1alpha1object.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, v1alpha1vultr.SchemeBuilder.AddToScheme, diff --git a/config/external_name.go b/config/external_name.go index 39d591e..d48cacd 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -13,7 +13,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "null_resource": config.IdentifierFromProvider, "vultr_kubernetes": config.IdentifierFromProvider, "vultr_kubernetes_node_pools": config.IdentifierFromProvider, - "vultr_object_storage": config.NameAsIdentifier, + "vultr_object_storage": config.IdentifierFromProvider, "vultr_instance": config.IdentifierFromProvider, "vultr_load_balancer": config.IdentifierFromProvider, "vultr_database": config.IdentifierFromProvider, diff --git a/config/groups.go b/config/groups.go index df2fc5c..3bc6887 100644 --- a/config/groups.go +++ b/config/groups.go @@ -41,6 +41,7 @@ var GroupMap = map[string]GroupKindCalculator{ //"aws_alb_listener_certificate": ReplaceGroupWords("elbv2", 0), "vultr_load_balancer": ReplaceGroupWords("vultr", 0), "vultr_bare_metal_server": ReplaceGroupWords("vultr", 0), + "vultr_object_storage": ReplaceGroupWords("vultr", 0), } @@ -49,6 +50,6 @@ var GroupMap = map[string]GroupKindCalculator{ var KindMap = map[string]string{ "vultr_load_balancer": "loadbalancer", "vultr_bare_metal_server": "baremetal", - + "vultr_object_storage": "object", } \ No newline at end of file diff --git a/config/schema.json b/config/schema.json index 53a8404..85683fd 100644 --- a/config/schema.json +++ b/config/schema.json @@ -1 +1 @@ -{"format_version":"1.0","provider_schemas":{"registry.terraform.io/vultr/vultr":{"provider":{"version":0,"block":{"attributes":{"api_key":{"type":"string","description":"The API Key that allows interaction with the API","description_kind":"plain","required":true},"rate_limit":{"type":"number","description":"Allows users to set the speed of API calls to work with the Vultr Rate Limit","description_kind":"plain","optional":true},"retry_limit":{"type":"number","description":"Allows users to set the maximum number of retries allowed for a failed API call.","description_kind":"plain","optional":true}},"description_kind":"plain"}},"resource_schemas":{"vultr_bare_metal_server":{"version":0,"block":{"attributes":{"activation_email":{"type":"bool","description_kind":"plain","optional":true},"app_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"cpu_count":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"default_password":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"disk":{"type":"string","description_kind":"plain","computed":true},"enable_ipv6":{"type":"bool","description_kind":"plain","optional":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"mac_address":{"type":"number","description_kind":"plain","computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"ram":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","required":true},"reserved_ipv4":{"type":"string","description_kind":"plain","optional":true,"computed":true},"script_id":{"type":"string","description_kind":"plain","optional":true},"snapshot_id":{"type":"string","description_kind":"plain","optional":true},"ssh_key_ids":{"type":["list","string"],"description_kind":"plain","optional":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","optional":true},"user_data":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_block_storage":{"version":0,"block":{"attributes":{"attached_to_instance":{"type":"string","description_kind":"plain","optional":true},"block_type":{"type":"string","description_kind":"plain","optional":true,"computed":true},"cost":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"live":{"type":"bool","description_kind":"plain","optional":true},"mount_id":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","required":true},"size_gb":{"type":"number","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_database":{"version":0,"block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","optional":true},"database_engine":{"type":"string","description_kind":"plain","required":true},"database_engine_version":{"type":"string","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","required":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","optional":true},"maintenance_time":{"type":"string","description_kind":"plain","optional":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","optional":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","optional":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","optional":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","optional":true},"password":{"type":"string","description_kind":"plain","optional":true,"computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"plan_disk":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","optional":true},"user":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"read_replicas":{"nesting_mode":"set","block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","computed":true},"database_engine":{"type":"string","description_kind":"plain","computed":true},"database_engine_version":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","computed":true},"maintenance_time":{"type":"string","description_kind":"plain","computed":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","optional":true,"computed":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"password":{"type":"string","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"plan_disk":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true,"computed":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"user":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_database_connection_pool":{"version":0,"block":{"attributes":{"database":{"type":"string","description_kind":"plain","required":true},"database_id":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"mode":{"type":"string","description_kind":"plain","required":true},"name":{"type":"string","description_kind":"plain","required":true},"size":{"type":"number","description_kind":"plain","required":true},"username":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_database_db":{"version":0,"block":{"attributes":{"database_id":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_database_replica":{"version":0,"block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","computed":true},"database_engine":{"type":"string","description_kind":"plain","computed":true},"database_engine_version":{"type":"string","description_kind":"plain","computed":true},"database_id":{"type":"string","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","computed":true},"maintenance_time":{"type":"string","description_kind":"plain","computed":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","optional":true,"computed":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"password":{"type":"string","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"plan_disk":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true,"computed":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"user":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_database_user":{"version":0,"block":{"attributes":{"database_id":{"type":"string","description_kind":"plain","required":true},"encryption":{"type":"string","description_kind":"plain","optional":true,"computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"password":{"type":"string","description_kind":"plain","optional":true,"computed":true},"username":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_dns_domain":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"dns_sec":{"type":"string","description_kind":"plain","optional":true},"domain":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}},"vultr_dns_record":{"version":0,"block":{"attributes":{"data":{"type":"string","description_kind":"plain","required":true},"domain":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"priority":{"type":"number","description_kind":"plain","optional":true},"ttl":{"type":"number","description_kind":"plain","optional":true},"type":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_firewall_group":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_count":{"type":"number","description_kind":"plain","computed":true},"max_rule_count":{"type":"number","description_kind":"plain","computed":true},"rule_count":{"type":"number","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_firewall_rule":{"version":0,"block":{"attributes":{"firewall_group_id":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip_type":{"type":"string","description_kind":"plain","required":true},"notes":{"type":"string","description_kind":"plain","optional":true},"port":{"type":"string","description_kind":"plain","optional":true},"protocol":{"type":"string","description_kind":"plain","required":true},"source":{"type":"string","description_kind":"plain","optional":true},"subnet":{"type":"string","description_kind":"plain","required":true},"subnet_size":{"type":"number","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_instance":{"version":0,"block":{"attributes":{"activation_email":{"type":"bool","description_kind":"plain","optional":true},"allowed_bandwidth":{"type":"number","description_kind":"plain","computed":true},"app_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"backups":{"type":"string","description_kind":"plain","optional":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"ddos_protection":{"type":"bool","description_kind":"plain","optional":true},"default_password":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"disk":{"type":"number","description_kind":"plain","computed":true},"enable_ipv6":{"type":"bool","description_kind":"plain","optional":true},"features":{"type":["list","string"],"description_kind":"plain","computed":true},"firewall_group_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description":"The hostname of the instance. Updating the hostname will cause a force new. This behavior is in place to prevent accidental reinstalls. Issuing an update to the hostname on UI or API issues a reinstall of the OS.","description_kind":"plain","optional":true,"computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"internal_ip":{"type":"string","description_kind":"plain","computed":true},"iso_id":{"type":"string","description_kind":"plain","optional":true},"kvm":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","optional":true,"computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"power_status":{"type":"string","description_kind":"plain","computed":true},"private_network_ids":{"type":["set","string"],"description_kind":"plain","deprecated":true,"optional":true,"computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","required":true},"reserved_ip_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"script_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"server_status":{"type":"string","description_kind":"plain","computed":true},"snapshot_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ssh_key_ids":{"type":["list","string"],"description_kind":"plain","optional":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","optional":true},"user_data":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true},"vcpu_count":{"type":"number","description_kind":"plain","computed":true},"vpc_ids":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true}},"block_types":{"backups_schedule":{"nesting_mode":"list","block":{"attributes":{"dom":{"type":"number","description_kind":"plain","optional":true,"computed":true},"dow":{"type":"number","description_kind":"plain","optional":true,"computed":true},"hour":{"type":"number","description_kind":"plain","optional":true,"computed":true},"type":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"},"max_items":1},"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_instance_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"ip":{"type":"string","description_kind":"plain","computed":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reboot":{"type":"bool","description_kind":"plain","optional":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_iso_private":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"filename":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"md5sum":{"type":"string","description_kind":"plain","computed":true},"sha512sum":{"type":"string","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"url":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_kubernetes":{"version":0,"block":{"attributes":{"client_certificate":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"client_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"cluster_ca_certificate":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"cluster_subnet":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"endpoint":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"kube_config":{"type":"string","description":"Base64 encoded KubeConfig","description_kind":"plain","computed":true,"sensitive":true},"label":{"type":"string","description_kind":"plain","required":true},"region":{"type":"string","description_kind":"plain","required":true},"service_subnet":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"version":{"type":"string","description_kind":"plain","required":true}},"block_types":{"node_pools":{"nesting_mode":"list","block":{"attributes":{"auto_scaler":{"type":"bool","description_kind":"plain","optional":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"date_updated":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"max_nodes":{"type":"number","description_kind":"plain","optional":true},"min_nodes":{"type":"number","description_kind":"plain","optional":true},"node_quantity":{"type":"number","description_kind":"plain","required":true},"nodes":{"type":["list",["object",{"date_created":"string","id":"string","label":"string","status":"string"}]],"description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"},"max_items":1}},"description_kind":"plain"}},"vultr_kubernetes_node_pools":{"version":0,"block":{"attributes":{"auto_scaler":{"type":"bool","description_kind":"plain","optional":true},"cluster_id":{"type":"string","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"date_updated":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"max_nodes":{"type":"number","description_kind":"plain","optional":true},"min_nodes":{"type":"number","description_kind":"plain","optional":true},"node_quantity":{"type":"number","description_kind":"plain","required":true},"nodes":{"type":["list",["object",{"date_created":"string","id":"string","label":"string","status":"string"}]],"description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}},"vultr_load_balancer":{"version":0,"block":{"attributes":{"attached_instances":{"type":["list","string"],"description_kind":"plain","optional":true,"computed":true},"balancing_algorithm":{"type":"string","description_kind":"plain","optional":true,"computed":true},"cookie_name":{"type":"string","description_kind":"plain","optional":true},"has_ssl":{"type":"bool","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ipv4":{"type":"string","description_kind":"plain","computed":true},"ipv6":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"private_network":{"type":"string","description_kind":"plain","deprecated":true,"optional":true},"proxy_protocol":{"type":"bool","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","required":true},"ssl_redirect":{"type":"bool","description_kind":"plain","optional":true},"status":{"type":"string","description_kind":"plain","computed":true},"vpc":{"type":"string","description_kind":"plain","optional":true}},"block_types":{"firewall_rules":{"nesting_mode":"set","block":{"attributes":{"id":{"type":"string","description_kind":"plain","computed":true},"ip_type":{"type":"string","description_kind":"plain","required":true},"port":{"type":"number","description_kind":"plain","required":true},"source":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"forwarding_rules":{"nesting_mode":"set","block":{"attributes":{"backend_port":{"type":"number","description_kind":"plain","required":true},"backend_protocol":{"type":"string","description_kind":"plain","required":true},"frontend_port":{"type":"number","description_kind":"plain","required":true},"frontend_protocol":{"type":"string","description_kind":"plain","required":true},"rule_id":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"},"min_items":1},"health_check":{"nesting_mode":"list","block":{"attributes":{"check_interval":{"type":"number","description_kind":"plain","required":true},"healthy_threshold":{"type":"number","description_kind":"plain","required":true},"path":{"type":"string","description_kind":"plain","optional":true},"port":{"type":"number","description_kind":"plain","required":true},"protocol":{"type":"string","description_kind":"plain","required":true},"response_timeout":{"type":"number","description_kind":"plain","required":true},"unhealthy_threshold":{"type":"number","description_kind":"plain","required":true}},"description_kind":"plain"},"max_items":1},"ssl":{"nesting_mode":"set","block":{"attributes":{"certificate":{"type":"string","description_kind":"plain","required":true},"chain":{"type":"string","description_kind":"plain","optional":true},"private_key":{"type":"string","description_kind":"plain","required":true,"sensitive":true}},"description_kind":"plain"},"max_items":1}},"description_kind":"plain"}},"vultr_object_storage":{"version":0,"block":{"attributes":{"cluster_id":{"type":"number","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"location":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"s3_access_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"s3_hostname":{"type":"string","description_kind":"plain","computed":true},"s3_secret_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"status":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_private_network":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"v4_subnet":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","optional":true,"computed":true}},"description_kind":"plain","deprecated":true}},"vultr_reserved_ip":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip_type":{"type":"string","description_kind":"plain","required":true},"label":{"type":"string","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","required":true},"subnet":{"type":"string","description_kind":"plain","computed":true},"subnet_size":{"type":"number","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_reverse_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"ip":{"type":"string","description_kind":"plain","required":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_reverse_ipv6":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"ip":{"type":"string","description_kind":"plain","required":true},"reverse":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_snapshot":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_snapshot_from_url":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"url":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_ssh_key":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"ssh_key":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_startup_script":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"script":{"type":"string","description_kind":"plain","required":true},"type":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}},"vultr_user":{"version":0,"block":{"attributes":{"acl":{"type":["list","string"],"description_kind":"plain","optional":true},"api_enabled":{"type":"bool","description_kind":"plain","optional":true},"api_key":{"type":"string","description_kind":"plain","computed":true},"email":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"password":{"type":"string","description_kind":"plain","required":true,"sensitive":true}},"description_kind":"plain"}},"vultr_vpc":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"v4_subnet":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","optional":true,"computed":true}},"description_kind":"plain"}}},"data_source_schemas":{"vultr_account":{"version":0,"block":{"attributes":{"acl":{"type":["list","string"],"description_kind":"plain","computed":true},"balance":{"type":"number","description_kind":"plain","computed":true},"email":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"last_payment_amount":{"type":"number","description_kind":"plain","computed":true},"last_payment_date":{"type":"string","description_kind":"plain","computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"pending_charges":{"type":"number","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_application":{"version":0,"block":{"attributes":{"deploy_name":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"short_name":{"type":"string","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true},"vendor":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_backup":{"version":0,"block":{"attributes":{"backups":{"type":["list",["map","string"]],"description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_bare_metal_plan":{"version":0,"block":{"attributes":{"bandwidth":{"type":"number","description_kind":"plain","computed":true},"cpu_count":{"type":"number","description_kind":"plain","computed":true},"cpu_model":{"type":"string","description_kind":"plain","computed":true},"cpu_threads":{"type":"number","description_kind":"plain","computed":true},"disk":{"type":"number","description_kind":"plain","computed":true},"disk_count":{"type":"number","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"locations":{"type":["list","string"],"description_kind":"plain","computed":true},"monthly_cost":{"type":"number","description_kind":"plain","computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_bare_metal_server":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"cpu_count":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"disk":{"type":"string","description_kind":"plain","computed":true},"features":{"type":["list","string"],"description_kind":"plain","computed":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"mac_address":{"type":"number","description_kind":"plain","computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"ram":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_block_storage":{"version":0,"block":{"attributes":{"attached_to_instance":{"type":"string","description_kind":"plain","computed":true},"block_type":{"type":"string","description_kind":"plain","computed":true},"cost":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"mount_id":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"size_gb":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_database":{"version":0,"block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","computed":true},"database_engine":{"type":"string","description_kind":"plain","computed":true},"database_engine_version":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","computed":true},"maintenance_time":{"type":"string","description_kind":"plain","computed":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","computed":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","computed":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","computed":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","computed":true},"password":{"type":"string","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"plan_disk":{"type":"number","description_kind":"plain","computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"read_replicas":{"type":["list",["object",{"cluster_time_zone":"string","database_engine":"string","database_engine_version":"string","date_created":"string","dbname":"string","host":"string","id":"string","label":"string","latest_backup":"string","maintenance_dow":"string","maintenance_time":"string","mysql_long_query_time":"number","mysql_require_primary_key":"bool","mysql_slow_query_log":"bool","mysql_sql_modes":["set","string"],"password":"string","plan":"string","plan_disk":"number","plan_ram":"number","plan_replicas":"number","plan_vcpus":"number","port":"string","redis_eviction_policy":"string","region":"string","status":"string","tag":"string","trusted_ips":["set","string"],"user":"string"}]],"description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","computed":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","computed":true},"user":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_dns_domain":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"dns_sec":{"type":"string","description_kind":"plain","computed":true},"domain":{"type":"string","description":"name of the domain","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true}},"description_kind":"plain"}},"vultr_firewall_group":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_count":{"type":"number","description_kind":"plain","computed":true},"max_rule_count":{"type":"number","description_kind":"plain","computed":true},"rule_count":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_instance":{"version":0,"block":{"attributes":{"allowed_bandwidth":{"type":"number","description_kind":"plain","computed":true},"app_id":{"type":"number","description_kind":"plain","computed":true},"backups":{"type":"string","description_kind":"plain","computed":true},"backups_schedule":{"type":["map","string"],"description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"disk":{"type":"number","description_kind":"plain","computed":true},"features":{"type":["list","string"],"description_kind":"plain","computed":true},"firewall_group_id":{"type":"string","description_kind":"plain","computed":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","computed":true},"internal_ip":{"type":"string","description_kind":"plain","computed":true},"kvm":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"location":{"type":"string","description_kind":"plain","computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"power_status":{"type":"string","description_kind":"plain","computed":true},"private_network_ids":{"type":["list","string"],"description_kind":"plain","computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"server_status":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true},"vcpu_count":{"type":"number","description_kind":"plain","computed":true},"vpc_ids":{"type":["list","string"],"description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_instance_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_iso_private":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"filename":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"md5sum":{"type":"string","description_kind":"plain","computed":true},"sha512sum":{"type":"string","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_iso_public":{"version":0,"block":{"attributes":{"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"md5sum":{"type":"string","description_kind":"plain","computed":true},"name":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_kubernetes":{"version":0,"block":{"attributes":{"client_certificate":{"type":"string","description_kind":"plain","computed":true},"client_key":{"type":"string","description_kind":"plain","computed":true},"cluster_ca_certificate":{"type":"string","description_kind":"plain","computed":true},"cluster_subnet":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"endpoint":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"kube_config":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"node_pools":{"type":["list",["object",{"auto_scaler":"bool","date_created":"string","date_updated":"string","id":"string","label":"string","max_nodes":"number","min_nodes":"number","node_quantity":"number","nodes":["list",["object",{"date_created":"string","id":"string","label":"string","status":"string"}]],"plan":"string","status":"string","tag":"string"}]],"description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"service_subnet":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"version":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_load_balancer":{"version":0,"block":{"attributes":{"attached_instances":{"type":["list","string"],"description_kind":"plain","computed":true},"balancing_algorithm":{"type":"string","description_kind":"plain","computed":true},"cookie_name":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"firewall_rules":{"type":["list",["map","string"]],"description_kind":"plain","computed":true},"forwarding_rules":{"type":["list",["map","string"]],"description_kind":"plain","computed":true},"has_ssl":{"type":"bool","description_kind":"plain","computed":true},"health_check":{"type":["map","string"],"description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ipv4":{"type":"string","description_kind":"plain","computed":true},"ipv6":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"private_network":{"type":"string","description_kind":"plain","computed":true},"proxy_protocol":{"type":"bool","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","computed":true},"ssl":{"type":["map","string"],"description_kind":"plain","computed":true},"ssl_redirect":{"type":"bool","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_object_storage":{"version":0,"block":{"attributes":{"cluster_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"location":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"s3_access_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"s3_hostname":{"type":"string","description_kind":"plain","computed":true},"s3_secret_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_object_storage_cluster":{"version":0,"block":{"attributes":{"deploy":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"number","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_os":{"version":0,"block":{"attributes":{"arch":{"type":"string","description_kind":"plain","computed":true},"family":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_plan":{"version":0,"block":{"attributes":{"bandwidth":{"type":"number","description_kind":"plain","computed":true},"disk":{"type":"number","description_kind":"plain","computed":true},"disk_count":{"type":"number","description_kind":"plain","computed":true},"gpu_type":{"type":"string","description_kind":"plain","computed":true},"gpu_vram":{"type":"number","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"locations":{"type":["list","string"],"description_kind":"plain","computed":true},"monthly_cost":{"type":"number","description_kind":"plain","computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true},"vcpu_count":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_private_network":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"v4_subnet":{"type":"string","description_kind":"plain","computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain","deprecated":true}},"vultr_region":{"version":0,"block":{"attributes":{"city":{"type":"string","description_kind":"plain","computed":true},"continent":{"type":"string","description_kind":"plain","computed":true},"country":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"options":{"type":["list","string"],"description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_reserved_ip":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip_type":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"subnet":{"type":"string","description_kind":"plain","computed":true},"subnet_size":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_reverse_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_reverse_ipv6":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_snapshot":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_ssh_key":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"ssh_key":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_startup_script":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"script":{"type":"string","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_user":{"version":0,"block":{"attributes":{"acl":{"type":["list","string"],"description_kind":"plain","computed":true},"api_enabled":{"type":"bool","description_kind":"plain","computed":true},"email":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_vpc":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"v4_subnet":{"type":"string","description_kind":"plain","computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}}}}}} +{"format_version":"1.0","provider_schemas":{"registry.terraform.io/vultr/vultr":{"provider":{"version":0,"block":{"attributes":{"api_key":{"type":"string","description":"The API Key that allows interaction with the API","description_kind":"plain","optional":true},"rate_limit":{"type":"number","description":"Allows users to set the speed of API calls to work with the Vultr Rate Limit","description_kind":"plain","optional":true},"retry_limit":{"type":"number","description":"Allows users to set the maximum number of retries allowed for a failed API call.","description_kind":"plain","optional":true}},"description_kind":"plain"}},"resource_schemas":{"vultr_bare_metal_server":{"version":0,"block":{"attributes":{"activation_email":{"type":"bool","description_kind":"plain","optional":true},"app_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"cpu_count":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"default_password":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"disk":{"type":"string","description_kind":"plain","computed":true},"enable_ipv6":{"type":"bool","description_kind":"plain","optional":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"mac_address":{"type":"number","description_kind":"plain","computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"ram":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","required":true},"reserved_ipv4":{"type":"string","description_kind":"plain","optional":true,"computed":true},"script_id":{"type":"string","description_kind":"plain","optional":true},"snapshot_id":{"type":"string","description_kind":"plain","optional":true},"ssh_key_ids":{"type":["list","string"],"description_kind":"plain","optional":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","optional":true},"user_data":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_block_storage":{"version":0,"block":{"attributes":{"attached_to_instance":{"type":"string","description_kind":"plain","optional":true},"block_type":{"type":"string","description_kind":"plain","optional":true,"computed":true},"cost":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"live":{"type":"bool","description_kind":"plain","optional":true},"mount_id":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","required":true},"size_gb":{"type":"number","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_database":{"version":0,"block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","optional":true},"database_engine":{"type":"string","description_kind":"plain","required":true},"database_engine_version":{"type":"string","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","required":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","optional":true},"maintenance_time":{"type":"string","description_kind":"plain","optional":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","optional":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","optional":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","optional":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","optional":true},"password":{"type":"string","description_kind":"plain","optional":true,"computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"plan_disk":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","optional":true},"user":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"read_replicas":{"nesting_mode":"set","block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","computed":true},"database_engine":{"type":"string","description_kind":"plain","computed":true},"database_engine_version":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","computed":true},"maintenance_time":{"type":"string","description_kind":"plain","computed":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","optional":true,"computed":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"password":{"type":"string","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"plan_disk":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true,"computed":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"user":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_database_connection_pool":{"version":0,"block":{"attributes":{"database":{"type":"string","description_kind":"plain","required":true},"database_id":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"mode":{"type":"string","description_kind":"plain","required":true},"name":{"type":"string","description_kind":"plain","required":true},"size":{"type":"number","description_kind":"plain","required":true},"username":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_database_db":{"version":0,"block":{"attributes":{"database_id":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_database_replica":{"version":0,"block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","computed":true},"database_engine":{"type":"string","description_kind":"plain","computed":true},"database_engine_version":{"type":"string","description_kind":"plain","computed":true},"database_id":{"type":"string","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","computed":true},"maintenance_time":{"type":"string","description_kind":"plain","computed":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","optional":true,"computed":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","optional":true,"computed":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"password":{"type":"string","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"plan_disk":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true,"computed":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true},"user":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_database_user":{"version":0,"block":{"attributes":{"database_id":{"type":"string","description_kind":"plain","required":true},"encryption":{"type":"string","description_kind":"plain","optional":true,"computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"password":{"type":"string","description_kind":"plain","optional":true,"computed":true},"username":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_dns_domain":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"dns_sec":{"type":"string","description_kind":"plain","optional":true},"domain":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}},"vultr_dns_record":{"version":0,"block":{"attributes":{"data":{"type":"string","description_kind":"plain","required":true},"domain":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"priority":{"type":"number","description_kind":"plain","optional":true},"ttl":{"type":"number","description_kind":"plain","optional":true},"type":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_firewall_group":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_count":{"type":"number","description_kind":"plain","computed":true},"max_rule_count":{"type":"number","description_kind":"plain","computed":true},"rule_count":{"type":"number","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_firewall_rule":{"version":0,"block":{"attributes":{"firewall_group_id":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip_type":{"type":"string","description_kind":"plain","required":true},"notes":{"type":"string","description_kind":"plain","optional":true},"port":{"type":"string","description_kind":"plain","optional":true},"protocol":{"type":"string","description_kind":"plain","required":true},"source":{"type":"string","description_kind":"plain","optional":true},"subnet":{"type":"string","description_kind":"plain","required":true},"subnet_size":{"type":"number","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_instance":{"version":0,"block":{"attributes":{"activation_email":{"type":"bool","description_kind":"plain","optional":true},"allowed_bandwidth":{"type":"number","description_kind":"plain","computed":true},"app_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"backups":{"type":"string","description_kind":"plain","optional":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"ddos_protection":{"type":"bool","description_kind":"plain","optional":true},"default_password":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"disk":{"type":"number","description_kind":"plain","computed":true},"enable_ipv6":{"type":"bool","description_kind":"plain","optional":true},"features":{"type":["list","string"],"description_kind":"plain","computed":true},"firewall_group_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description":"The hostname of the instance. Updating the hostname will cause a force new. This behavior is in place to prevent accidental reinstalls. Issuing an update to the hostname on UI or API issues a reinstall of the OS.","description_kind":"plain","optional":true,"computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"internal_ip":{"type":"string","description_kind":"plain","computed":true},"iso_id":{"type":"string","description_kind":"plain","optional":true},"kvm":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","optional":true,"computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","optional":true,"computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"power_status":{"type":"string","description_kind":"plain","computed":true},"private_network_ids":{"type":["set","string"],"description_kind":"plain","deprecated":true,"optional":true,"computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","required":true},"reserved_ip_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"script_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"server_status":{"type":"string","description_kind":"plain","computed":true},"snapshot_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ssh_key_ids":{"type":["list","string"],"description_kind":"plain","optional":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","optional":true},"user_data":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true},"vcpu_count":{"type":"number","description_kind":"plain","computed":true},"vpc_ids":{"type":["set","string"],"description_kind":"plain","optional":true,"computed":true}},"block_types":{"backups_schedule":{"nesting_mode":"list","block":{"attributes":{"dom":{"type":"number","description_kind":"plain","optional":true,"computed":true},"dow":{"type":"number","description_kind":"plain","optional":true,"computed":true},"hour":{"type":"number","description_kind":"plain","optional":true,"computed":true},"type":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"},"max_items":1},"timeouts":{"nesting_mode":"single","block":{"attributes":{"create":{"type":"string","description_kind":"plain","optional":true},"update":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_instance_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"ip":{"type":"string","description_kind":"plain","computed":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reboot":{"type":"bool","description_kind":"plain","optional":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_iso_private":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"filename":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"md5sum":{"type":"string","description_kind":"plain","computed":true},"sha512sum":{"type":"string","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"url":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_kubernetes":{"version":0,"block":{"attributes":{"client_certificate":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"client_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"cluster_ca_certificate":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"cluster_subnet":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"endpoint":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"kube_config":{"type":"string","description":"Base64 encoded KubeConfig","description_kind":"plain","computed":true,"sensitive":true},"label":{"type":"string","description_kind":"plain","required":true},"region":{"type":"string","description_kind":"plain","required":true},"service_subnet":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"version":{"type":"string","description_kind":"plain","required":true}},"block_types":{"node_pools":{"nesting_mode":"list","block":{"attributes":{"auto_scaler":{"type":"bool","description_kind":"plain","optional":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"date_updated":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"max_nodes":{"type":"number","description_kind":"plain","optional":true},"min_nodes":{"type":"number","description_kind":"plain","optional":true},"node_quantity":{"type":"number","description_kind":"plain","required":true},"nodes":{"type":["list",["object",{"date_created":"string","id":"string","label":"string","status":"string"}]],"description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"},"max_items":1}},"description_kind":"plain"}},"vultr_kubernetes_node_pools":{"version":0,"block":{"attributes":{"auto_scaler":{"type":"bool","description_kind":"plain","optional":true},"cluster_id":{"type":"string","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"date_updated":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","required":true},"max_nodes":{"type":"number","description_kind":"plain","optional":true},"min_nodes":{"type":"number","description_kind":"plain","optional":true},"node_quantity":{"type":"number","description_kind":"plain","required":true},"nodes":{"type":["list",["object",{"date_created":"string","id":"string","label":"string","status":"string"}]],"description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","required":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}},"vultr_load_balancer":{"version":0,"block":{"attributes":{"attached_instances":{"type":["list","string"],"description_kind":"plain","optional":true,"computed":true},"balancing_algorithm":{"type":"string","description_kind":"plain","optional":true,"computed":true},"cookie_name":{"type":"string","description_kind":"plain","optional":true},"has_ssl":{"type":"bool","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ipv4":{"type":"string","description_kind":"plain","computed":true},"ipv6":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"private_network":{"type":"string","description_kind":"plain","deprecated":true,"optional":true},"proxy_protocol":{"type":"bool","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","required":true},"ssl_redirect":{"type":"bool","description_kind":"plain","optional":true},"status":{"type":"string","description_kind":"plain","computed":true},"vpc":{"type":"string","description_kind":"plain","optional":true}},"block_types":{"firewall_rules":{"nesting_mode":"set","block":{"attributes":{"id":{"type":"string","description_kind":"plain","computed":true},"ip_type":{"type":"string","description_kind":"plain","required":true},"port":{"type":"number","description_kind":"plain","required":true},"source":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"forwarding_rules":{"nesting_mode":"set","block":{"attributes":{"backend_port":{"type":"number","description_kind":"plain","required":true},"backend_protocol":{"type":"string","description_kind":"plain","required":true},"frontend_port":{"type":"number","description_kind":"plain","required":true},"frontend_protocol":{"type":"string","description_kind":"plain","required":true},"rule_id":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"},"min_items":1},"health_check":{"nesting_mode":"list","block":{"attributes":{"check_interval":{"type":"number","description_kind":"plain","required":true},"healthy_threshold":{"type":"number","description_kind":"plain","required":true},"path":{"type":"string","description_kind":"plain","optional":true},"port":{"type":"number","description_kind":"plain","required":true},"protocol":{"type":"string","description_kind":"plain","required":true},"response_timeout":{"type":"number","description_kind":"plain","required":true},"unhealthy_threshold":{"type":"number","description_kind":"plain","required":true}},"description_kind":"plain"},"max_items":1},"ssl":{"nesting_mode":"set","block":{"attributes":{"certificate":{"type":"string","description_kind":"plain","required":true},"chain":{"type":"string","description_kind":"plain","optional":true},"private_key":{"type":"string","description_kind":"plain","required":true,"sensitive":true}},"description_kind":"plain"},"max_items":1}},"description_kind":"plain"}},"vultr_object_storage":{"version":0,"block":{"attributes":{"cluster_id":{"type":"number","description_kind":"plain","required":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","optional":true},"location":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"s3_access_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"s3_hostname":{"type":"string","description_kind":"plain","computed":true},"s3_secret_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"status":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_private_network":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"v4_subnet":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","optional":true,"computed":true}},"description_kind":"plain","deprecated":true}},"vultr_reserved_ip":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ip_type":{"type":"string","description_kind":"plain","required":true},"label":{"type":"string","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","required":true},"subnet":{"type":"string","description_kind":"plain","computed":true},"subnet_size":{"type":"number","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_reverse_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"ip":{"type":"string","description_kind":"plain","required":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_reverse_ipv6":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"ip":{"type":"string","description_kind":"plain","required":true},"reverse":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_snapshot":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","required":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_snapshot_from_url":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"url":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_ssh_key":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"ssh_key":{"type":"string","description_kind":"plain","required":true}},"description_kind":"plain"}},"vultr_startup_script":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"script":{"type":"string","description_kind":"plain","required":true},"type":{"type":"string","description_kind":"plain","optional":true}},"description_kind":"plain"}},"vultr_user":{"version":0,"block":{"attributes":{"acl":{"type":["list","string"],"description_kind":"plain","optional":true},"api_enabled":{"type":"bool","description_kind":"plain","optional":true},"api_key":{"type":"string","description_kind":"plain","computed":true},"email":{"type":"string","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","required":true},"password":{"type":"string","description_kind":"plain","required":true,"sensitive":true}},"description_kind":"plain"}},"vultr_vpc":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","optional":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","required":true},"v4_subnet":{"type":"string","description_kind":"plain","optional":true,"computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","optional":true,"computed":true}},"description_kind":"plain"}}},"data_source_schemas":{"vultr_account":{"version":0,"block":{"attributes":{"acl":{"type":["list","string"],"description_kind":"plain","computed":true},"balance":{"type":"number","description_kind":"plain","computed":true},"email":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"last_payment_amount":{"type":"number","description_kind":"plain","computed":true},"last_payment_date":{"type":"string","description_kind":"plain","computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"pending_charges":{"type":"number","description_kind":"plain","computed":true}},"description_kind":"plain"}},"vultr_application":{"version":0,"block":{"attributes":{"deploy_name":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"short_name":{"type":"string","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true},"vendor":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_backup":{"version":0,"block":{"attributes":{"backups":{"type":["list",["map","string"]],"description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_bare_metal_plan":{"version":0,"block":{"attributes":{"bandwidth":{"type":"number","description_kind":"plain","computed":true},"cpu_count":{"type":"number","description_kind":"plain","computed":true},"cpu_model":{"type":"string","description_kind":"plain","computed":true},"cpu_threads":{"type":"number","description_kind":"plain","computed":true},"disk":{"type":"number","description_kind":"plain","computed":true},"disk_count":{"type":"number","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"locations":{"type":["list","string"],"description_kind":"plain","computed":true},"monthly_cost":{"type":"number","description_kind":"plain","computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_bare_metal_server":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"cpu_count":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"disk":{"type":"string","description_kind":"plain","computed":true},"features":{"type":["list","string"],"description_kind":"plain","computed":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"mac_address":{"type":"number","description_kind":"plain","computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"ram":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_block_storage":{"version":0,"block":{"attributes":{"attached_to_instance":{"type":"string","description_kind":"plain","computed":true},"block_type":{"type":"string","description_kind":"plain","computed":true},"cost":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"mount_id":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"size_gb":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_database":{"version":0,"block":{"attributes":{"cluster_time_zone":{"type":"string","description_kind":"plain","computed":true},"database_engine":{"type":"string","description_kind":"plain","computed":true},"database_engine_version":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"dbname":{"type":"string","description_kind":"plain","computed":true},"host":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"latest_backup":{"type":"string","description_kind":"plain","computed":true},"maintenance_dow":{"type":"string","description_kind":"plain","computed":true},"maintenance_time":{"type":"string","description_kind":"plain","computed":true},"mysql_long_query_time":{"type":"number","description_kind":"plain","computed":true},"mysql_require_primary_key":{"type":"bool","description_kind":"plain","computed":true},"mysql_slow_query_log":{"type":"bool","description_kind":"plain","computed":true},"mysql_sql_modes":{"type":["set","string"],"description_kind":"plain","computed":true},"password":{"type":"string","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"plan_disk":{"type":"number","description_kind":"plain","computed":true},"plan_ram":{"type":"number","description_kind":"plain","computed":true},"plan_replicas":{"type":"number","description_kind":"plain","computed":true},"plan_vcpus":{"type":"number","description_kind":"plain","computed":true},"port":{"type":"string","description_kind":"plain","computed":true},"read_replicas":{"type":["list",["object",{"cluster_time_zone":"string","database_engine":"string","database_engine_version":"string","date_created":"string","dbname":"string","host":"string","id":"string","label":"string","latest_backup":"string","maintenance_dow":"string","maintenance_time":"string","mysql_long_query_time":"number","mysql_require_primary_key":"bool","mysql_slow_query_log":"bool","mysql_sql_modes":["set","string"],"password":"string","plan":"string","plan_disk":"number","plan_ram":"number","plan_replicas":"number","plan_vcpus":"number","port":"string","redis_eviction_policy":"string","region":"string","status":"string","tag":"string","trusted_ips":["set","string"],"user":"string"}]],"description_kind":"plain","computed":true},"redis_eviction_policy":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"tag":{"type":"string","description_kind":"plain","computed":true},"trusted_ips":{"type":["set","string"],"description_kind":"plain","computed":true},"user":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_dns_domain":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"dns_sec":{"type":"string","description_kind":"plain","computed":true},"domain":{"type":"string","description":"name of the domain","description_kind":"plain","required":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true}},"description_kind":"plain"}},"vultr_firewall_group":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_count":{"type":"number","description_kind":"plain","computed":true},"max_rule_count":{"type":"number","description_kind":"plain","computed":true},"rule_count":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_instance":{"version":0,"block":{"attributes":{"allowed_bandwidth":{"type":"number","description_kind":"plain","computed":true},"app_id":{"type":"number","description_kind":"plain","computed":true},"backups":{"type":"string","description_kind":"plain","computed":true},"backups_schedule":{"type":["map","string"],"description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"disk":{"type":"number","description_kind":"plain","computed":true},"features":{"type":["list","string"],"description_kind":"plain","computed":true},"firewall_group_id":{"type":"string","description_kind":"plain","computed":true},"gateway_v4":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"image_id":{"type":"string","description_kind":"plain","computed":true},"internal_ip":{"type":"string","description_kind":"plain","computed":true},"kvm":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"location":{"type":"string","description_kind":"plain","computed":true},"main_ip":{"type":"string","description_kind":"plain","computed":true},"netmask_v4":{"type":"string","description_kind":"plain","computed":true},"os":{"type":"string","description_kind":"plain","computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"plan":{"type":"string","description_kind":"plain","computed":true},"power_status":{"type":"string","description_kind":"plain","computed":true},"private_network_ids":{"type":["list","string"],"description_kind":"plain","computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"server_status":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"tags":{"type":["set","string"],"description_kind":"plain","computed":true},"v6_main_ip":{"type":"string","description_kind":"plain","computed":true},"v6_network":{"type":"string","description_kind":"plain","computed":true},"v6_network_size":{"type":"number","description_kind":"plain","computed":true},"vcpu_count":{"type":"number","description_kind":"plain","computed":true},"vpc_ids":{"type":["list","string"],"description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_instance_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_iso_private":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"filename":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"md5sum":{"type":"string","description_kind":"plain","computed":true},"sha512sum":{"type":"string","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_iso_public":{"version":0,"block":{"attributes":{"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"md5sum":{"type":"string","description_kind":"plain","computed":true},"name":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_kubernetes":{"version":0,"block":{"attributes":{"client_certificate":{"type":"string","description_kind":"plain","computed":true},"client_key":{"type":"string","description_kind":"plain","computed":true},"cluster_ca_certificate":{"type":"string","description_kind":"plain","computed":true},"cluster_subnet":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"endpoint":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"kube_config":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"node_pools":{"type":["list",["object",{"auto_scaler":"bool","date_created":"string","date_updated":"string","id":"string","label":"string","max_nodes":"number","min_nodes":"number","node_quantity":"number","nodes":["list",["object",{"date_created":"string","id":"string","label":"string","status":"string"}]],"plan":"string","status":"string","tag":"string"}]],"description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"service_subnet":{"type":"string","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true},"version":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_load_balancer":{"version":0,"block":{"attributes":{"attached_instances":{"type":["list","string"],"description_kind":"plain","computed":true},"balancing_algorithm":{"type":"string","description_kind":"plain","computed":true},"cookie_name":{"type":"string","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"firewall_rules":{"type":["list",["map","string"]],"description_kind":"plain","computed":true},"forwarding_rules":{"type":["list",["map","string"]],"description_kind":"plain","computed":true},"has_ssl":{"type":"bool","description_kind":"plain","computed":true},"health_check":{"type":["map","string"],"description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"ipv4":{"type":"string","description_kind":"plain","computed":true},"ipv6":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"private_network":{"type":"string","description_kind":"plain","computed":true},"proxy_protocol":{"type":"bool","description_kind":"plain","optional":true},"region":{"type":"string","description_kind":"plain","computed":true},"ssl":{"type":["map","string"],"description_kind":"plain","computed":true},"ssl_redirect":{"type":"bool","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_object_storage":{"version":0,"block":{"attributes":{"cluster_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"location":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"s3_access_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"s3_hostname":{"type":"string","description_kind":"plain","computed":true},"s3_secret_key":{"type":"string","description_kind":"plain","computed":true,"sensitive":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_object_storage_cluster":{"version":0,"block":{"attributes":{"deploy":{"type":"string","description_kind":"plain","computed":true},"hostname":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"number","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_os":{"version":0,"block":{"attributes":{"arch":{"type":"string","description_kind":"plain","computed":true},"family":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_plan":{"version":0,"block":{"attributes":{"bandwidth":{"type":"number","description_kind":"plain","computed":true},"disk":{"type":"number","description_kind":"plain","computed":true},"disk_count":{"type":"number","description_kind":"plain","computed":true},"gpu_type":{"type":"string","description_kind":"plain","computed":true},"gpu_vram":{"type":"number","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"locations":{"type":["list","string"],"description_kind":"plain","computed":true},"monthly_cost":{"type":"number","description_kind":"plain","computed":true},"ram":{"type":"number","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true},"vcpu_count":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_private_network":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"v4_subnet":{"type":"string","description_kind":"plain","computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain","deprecated":true}},"vultr_region":{"version":0,"block":{"attributes":{"city":{"type":"string","description_kind":"plain","computed":true},"continent":{"type":"string","description_kind":"plain","computed":true},"country":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"options":{"type":["list","string"],"description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_reserved_ip":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip_type":{"type":"string","description_kind":"plain","computed":true},"label":{"type":"string","description_kind":"plain","computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"subnet":{"type":"string","description_kind":"plain","computed":true},"subnet_size":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_reverse_ipv4":{"version":0,"block":{"attributes":{"gateway":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"netmask":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_reverse_ipv6":{"version":0,"block":{"attributes":{"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"instance_id":{"type":"string","description_kind":"plain","computed":true},"ip":{"type":"string","description_kind":"plain","computed":true},"reverse":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_snapshot":{"version":0,"block":{"attributes":{"app_id":{"type":"number","description_kind":"plain","computed":true},"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"os_id":{"type":"number","description_kind":"plain","computed":true},"size":{"type":"number","description_kind":"plain","computed":true},"status":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_ssh_key":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"ssh_key":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_startup_script":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"date_modified":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true},"script":{"type":"string","description_kind":"plain","computed":true},"type":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_user":{"version":0,"block":{"attributes":{"acl":{"type":["list","string"],"description_kind":"plain","computed":true},"api_enabled":{"type":"bool","description_kind":"plain","computed":true},"email":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"name":{"type":"string","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}},"vultr_vpc":{"version":0,"block":{"attributes":{"date_created":{"type":"string","description_kind":"plain","computed":true},"description":{"type":"string","description_kind":"plain","computed":true},"id":{"type":"string","description_kind":"plain","optional":true,"computed":true},"region":{"type":"string","description_kind":"plain","computed":true},"v4_subnet":{"type":"string","description_kind":"plain","computed":true},"v4_subnet_mask":{"type":"number","description_kind":"plain","computed":true}},"block_types":{"filter":{"nesting_mode":"set","block":{"attributes":{"name":{"type":"string","description_kind":"plain","required":true},"values":{"type":["list","string"],"description_kind":"plain","required":true}},"description_kind":"plain"}}},"description_kind":"plain"}}}}}} diff --git a/examples-generated/object/storage.yaml b/examples-generated/vultr/objectstorage.yaml similarity index 54% rename from examples-generated/object/storage.yaml rename to examples-generated/vultr/objectstorage.yaml index e40125f..0785ca2 100644 --- a/examples-generated/object/storage.yaml +++ b/examples-generated/vultr/objectstorage.yaml @@ -1,8 +1,8 @@ -apiVersion: object.vultr.upbound.io/v1alpha1 -kind: Storage +apiVersion: vultr.vultr.upbound.io/v1alpha1 +kind: ObjectStorage metadata: annotations: - meta.upbound.io/example-id: object/v1alpha1/storage + meta.upbound.io/example-id: vultr/v1alpha1/objectstorage labels: testing.upbound.io/example-name: tf name: tf diff --git a/internal/controller/object/storage/zz_controller.go b/internal/controller/vultr/objectstorage/zz_controller.go similarity index 81% rename from internal/controller/object/storage/zz_controller.go rename to internal/controller/vultr/objectstorage/zz_controller.go index 44e81ab..06c612c 100755 --- a/internal/controller/object/storage/zz_controller.go +++ b/internal/controller/vultr/objectstorage/zz_controller.go @@ -4,7 +4,7 @@ Copyright 2022 Upbound Inc. // Code generated by upjet. DO NOT EDIT. -package storage +package objectstorage import ( "time" @@ -18,22 +18,21 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/object/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" features "github.com/crossplane-contrib/provider-vultr/internal/features" ) -// Setup adds a controller that reconciles Storage managed resources. +// Setup adds a controller that reconciles ObjectStorage managed resources. func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { - name := managed.ControllerName(v1alpha1.Storage_GroupVersionKind.String()) + name := managed.ControllerName(v1alpha1.ObjectStorage_GroupVersionKind.String()) var initializers managed.InitializerChain - initializers = append(initializers, managed.NewNameAsExternalName(mgr.GetClient())) cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} if o.SecretStoreConfigGVK != nil { cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK)) } opts := []managed.ReconcilerOption{ managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_object_storage"], tjcontroller.WithLogger(o.Logger), - tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Storage_GroupVersionKind))), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.ObjectStorage_GroupVersionKind))), )), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), @@ -46,11 +45,11 @@ func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { if o.Features.Enabled(features.EnableAlphaManagementPolicies) { opts = append(opts, managed.WithManagementPolicies()) } - r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Storage_GroupVersionKind), opts...) + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.ObjectStorage_GroupVersionKind), opts...) return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(o.ForControllerRuntime()). - For(&v1alpha1.Storage{}). + For(&v1alpha1.ObjectStorage{}). Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) } diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index e7d2058..b486141 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -14,13 +14,13 @@ import ( replica "github.com/crossplane-contrib/provider-vultr/internal/controller/database/replica" user "github.com/crossplane-contrib/provider-vultr/internal/controller/database/user" nodepools "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/nodepools" - storage "github.com/crossplane-contrib/provider-vultr/internal/controller/object/storage" providerconfig "github.com/crossplane-contrib/provider-vultr/internal/controller/providerconfig" baremetalserver "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/baremetalserver" database "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/database" instance "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/instance" kubernetes "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/kubernetes" loadbalancer "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/loadbalancer" + objectstorage "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/objectstorage" ) // Setup creates all controllers with the supplied logger and adds them to @@ -32,13 +32,13 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { replica.Setup, user.Setup, nodepools.Setup, - storage.Setup, providerconfig.Setup, baremetalserver.Setup, database.Setup, instance.Setup, kubernetes.Setup, loadbalancer.Setup, + objectstorage.Setup, } { if err := setup(mgr, o); err != nil { return err diff --git a/package/crds/object.vultr.upbound.io_storages.yaml b/package/crds/vultr.vultr.upbound.io_objectstorages.yaml similarity index 96% rename from package/crds/object.vultr.upbound.io_storages.yaml rename to package/crds/vultr.vultr.upbound.io_objectstorages.yaml index 2bfe309..093a004 100644 --- a/package/crds/object.vultr.upbound.io_storages.yaml +++ b/package/crds/vultr.vultr.upbound.io_objectstorages.yaml @@ -5,18 +5,18 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: storages.object.vultr.upbound.io + name: objectstorages.vultr.vultr.upbound.io spec: - group: object.vultr.upbound.io + group: vultr.vultr.upbound.io names: categories: - crossplane - managed - vultr - kind: Storage - listKind: StorageList - plural: storages - singular: storage + kind: ObjectStorage + listKind: ObjectStorageList + plural: objectstorages + singular: objectstorage scope: Cluster versions: - additionalPrinterColumns: @@ -35,9 +35,9 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: Storage is the Schema for the Storages API. Provides a Vultr - private object storage resource. This can be used to create, read, update - and delete object storage resources on your Vultr account. + description: ObjectStorage is the Schema for the ObjectStorages API. Provides + a Vultr private object storage resource. This can be used to create, read, + update and delete object storage resources on your Vultr account. properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -52,7 +52,7 @@ spec: metadata: type: object spec: - description: StorageSpec defines the desired state of Storage + description: ObjectStorageSpec defines the desired state of ObjectStorage properties: deletionPolicy: default: Delete @@ -267,7 +267,7 @@ spec: - message: clusterId is a required parameter rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.clusterId) status: - description: StorageStatus defines the observed state of Storage. + description: ObjectStorageStatus defines the observed state of ObjectStorage. properties: atProvider: properties: From 2f4844cfcf4e06bdf6f64160fdb33856551f1fa5 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Thu, 31 Aug 2023 15:01:03 -0400 Subject: [PATCH 08/13] update README --- README.md | 90 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 274bab0..f317cf1 100644 --- a/README.md +++ b/README.md @@ -5,56 +5,68 @@ is built using [Upjet](https://github.com/upbound/upjet) code generation tools and exposes XRM-conformant managed resources for the Vultr API. -## Getting Started +## Overview -Install the provider by using the following command after changing the image tag -to the [latest release](https://marketplace.upbound.io/providers/crossplane-contrib/provider-vultr): -``` -up ctp provider install crossplane-contrib/provider-vultr:v0.1.0 -``` +This `provider-vultr` repository is the Crossplane infrastructure provider for +[vultr](https://vultr.com/). The provider that is built from +the source code in this repository can be installed into a Crossplane control +plane and adds the following new functionality: -Alternatively, you can use declarative installation: -``` -cat < Date: Thu, 31 Aug 2023 15:02:39 -0400 Subject: [PATCH 09/13] Add INSTALL.md --- INSTALL.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 INSTALL.md diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 0000000..723f832 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,96 @@ +# Building and Installing the Crossplane Vultr Provider + +`provider-vultr` is composed of a golang project and can be built directly with standard `golang` tools. We currently support two different platforms for building: + +* Linux: most modern distros should work although most testing has been done on Ubuntu +* Mac: macOS 10.6+ is supported + +## Build Requirements + +An Intel-based machine (recommend 2+ cores, 2+ GB of memory and 128GB of SSD). Inside your build environment (Docker for Mac or a VM), 6+ GB memory is also recommended. + +The following tools are need on the host: + +* curl +* docker (1.12+) or Docker for Mac (17+) +* git +* make +* golang +* rsync (if you're using the build container on mac) +* helm (v2.8.2+) +* kubebuilder (v1.0.4+) + +## Build +You can build the Crossplane Vultr Provider for the host platform by simply running the command below. +Building in parallel with the `-j` option is recommended. + +```console +make -j4 +``` + +The first time `make` is run, the build submodule will be synced and +updated. After initial setup, it can be updated by running `make submodules`. + +Run `make help` for more options. + +## Building inside the cross container + +Official Crossplane builds are done inside a build container. This ensures that we get a consistent build, test and release environment. To run the build inside the cross container run: + +```console +build/run make -j4 +``` + +The first run of `build/run` will build the container itself and could take a few minutes to complete, but subsequent builds should go much faster. + +## Install Crossplane in Your Cluster +Once your Cluster is up and running, you'll need to install Crossplane. + +We recommend using Helm to install Crossplane. You can find the [official documentation here](https://crossplane.io/docs/v1.5/getting-started/install-configure.html#install-crossplane). These are the commands: + +```console +kubectl create namespace crossplane-system + +helm repo add crossplane-stable https://charts.crossplane.io/stable +helm repo update + +helm install crossplane --namespace crossplane-system crossplane-stable/crossplane +``` + +## Getting started + +Next install this Vultr Crossplane provider: +```bash +# clone this repo +git clone git@github.com:vultr/crossplane-provider-vultr.git +cd provider-vultr + +# install the crds +kubectl apply -f package/crds +``` + +Run the provider: +```bash +make run +``` + +Configure the provider: +```bash +# change the examples/secret.yaml to use your VULTR_API_KEY +kubectl apply -f examples/providerconfig/secret.yaml +kubectl apply -f examples/providerconfig/providerconfig.yaml +``` + + +## Provision Vultr Resources + +Go to the [examples-generated](./examples-generated) directory in this repo, find the Vultr product you'd like to deploy, make any needed changes to the yaml file, and then create the resource. + +For example, if you'd like to spin up a VKE Cluster, run the command + +```console +kubectl apply -f examples-generated/vultr/kubernetes.yaml +# wait a bit +kubectl get managed +``` +and check your Vultr account to see if the resource has been created. \ No newline at end of file From 5300e776644eca14b1e74ee279ef584b66da04c2 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Thu, 31 Aug 2023 15:03:12 -0400 Subject: [PATCH 10/13] add block storage resource --- apis/block/v1alpha1/zz_generated.deepcopy.go | 222 +++++++++++ apis/block/v1alpha1/zz_generated.managed.go | 84 ++++ .../v1alpha1/zz_generated.managedlist.go | 17 + .../v1alpha1/zz_generated_terraformed.go | 88 +++++ apis/block/v1alpha1/zz_groupversion_info.go | 32 ++ apis/block/v1alpha1/zz_storage_types.go | 128 ++++++ apis/zz_register.go | 4 +- config/block/config.go | 8 + config/external_name.go | 1 + config/provider.go | 2 + examples-generated/block/storage.yaml | 15 + .../controller/block/storage/zz_controller.go | 55 +++ internal/controller/zz_setup.go | 2 + .../crds/block.vultr.upbound.io_storages.yaml | 368 ++++++++++++++++++ 14 files changed, 1025 insertions(+), 1 deletion(-) create mode 100644 apis/block/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/block/v1alpha1/zz_generated.managed.go create mode 100644 apis/block/v1alpha1/zz_generated.managedlist.go create mode 100755 apis/block/v1alpha1/zz_generated_terraformed.go create mode 100755 apis/block/v1alpha1/zz_groupversion_info.go create mode 100755 apis/block/v1alpha1/zz_storage_types.go create mode 100644 config/block/config.go create mode 100644 examples-generated/block/storage.yaml create mode 100755 internal/controller/block/storage/zz_controller.go create mode 100644 package/crds/block.vultr.upbound.io_storages.yaml diff --git a/apis/block/v1alpha1/zz_generated.deepcopy.go b/apis/block/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..6b3f278 --- /dev/null +++ b/apis/block/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,222 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// 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 *Storage) DeepCopyInto(out *Storage) { + *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 Storage. +func (in *Storage) DeepCopy() *Storage { + if in == nil { + return nil + } + out := new(Storage) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Storage) 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 *StorageList) DeepCopyInto(out *StorageList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Storage, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageList. +func (in *StorageList) DeepCopy() *StorageList { + if in == nil { + return nil + } + out := new(StorageList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *StorageList) 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 *StorageObservation) DeepCopyInto(out *StorageObservation) { + *out = *in + if in.AttachedToInstance != nil { + in, out := &in.AttachedToInstance, &out.AttachedToInstance + *out = new(string) + **out = **in + } + if in.BlockType != nil { + in, out := &in.BlockType, &out.BlockType + *out = new(string) + **out = **in + } + if in.Cost != nil { + in, out := &in.Cost, &out.Cost + *out = new(float64) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Live != nil { + in, out := &in.Live, &out.Live + *out = new(bool) + **out = **in + } + if in.MountID != nil { + in, out := &in.MountID, &out.MountID + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SizeGb != nil { + in, out := &in.SizeGb, &out.SizeGb + *out = new(float64) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageObservation. +func (in *StorageObservation) DeepCopy() *StorageObservation { + if in == nil { + return nil + } + out := new(StorageObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageParameters) DeepCopyInto(out *StorageParameters) { + *out = *in + if in.AttachedToInstance != nil { + in, out := &in.AttachedToInstance, &out.AttachedToInstance + *out = new(string) + **out = **in + } + if in.BlockType != nil { + in, out := &in.BlockType, &out.BlockType + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Live != nil { + in, out := &in.Live, &out.Live + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SizeGb != nil { + in, out := &in.SizeGb, &out.SizeGb + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageParameters. +func (in *StorageParameters) DeepCopy() *StorageParameters { + if in == nil { + return nil + } + out := new(StorageParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageSpec) DeepCopyInto(out *StorageSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageSpec. +func (in *StorageSpec) DeepCopy() *StorageSpec { + if in == nil { + return nil + } + out := new(StorageSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StorageStatus) DeepCopyInto(out *StorageStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageStatus. +func (in *StorageStatus) DeepCopy() *StorageStatus { + if in == nil { + return nil + } + out := new(StorageStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/block/v1alpha1/zz_generated.managed.go b/apis/block/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..fc57644 --- /dev/null +++ b/apis/block/v1alpha1/zz_generated.managed.go @@ -0,0 +1,84 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + +// GetCondition of this Storage. +func (mg *Storage) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Storage. +func (mg *Storage) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Storage. +func (mg *Storage) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Storage. +func (mg *Storage) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Storage. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Storage) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Storage. +func (mg *Storage) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Storage. +func (mg *Storage) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Storage. +func (mg *Storage) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Storage. +func (mg *Storage) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Storage. +func (mg *Storage) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Storage. +func (mg *Storage) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Storage. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Storage) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Storage. +func (mg *Storage) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Storage. +func (mg *Storage) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/block/v1alpha1/zz_generated.managedlist.go b/apis/block/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..0e8d285 --- /dev/null +++ b/apis/block/v1alpha1/zz_generated.managedlist.go @@ -0,0 +1,17 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import resource "github.com/crossplane/crossplane-runtime/pkg/resource" + +// GetItems of this StorageList. +func (l *StorageList) 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/block/v1alpha1/zz_generated_terraformed.go b/apis/block/v1alpha1/zz_generated_terraformed.go new file mode 100755 index 0000000..7d122d8 --- /dev/null +++ b/apis/block/v1alpha1/zz_generated_terraformed.go @@ -0,0 +1,88 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/pkg/errors" + + "github.com/upbound/upjet/pkg/resource" + "github.com/upbound/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this Storage +func (mg *Storage) GetTerraformResourceType() string { + return "vultr_block_storage" +} + +// GetConnectionDetailsMapping for this Storage +func (tr *Storage) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Storage +func (tr *Storage) 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 Storage +func (tr *Storage) 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 Storage +func (tr *Storage) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Storage +func (tr *Storage) 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 Storage +func (tr *Storage) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Storage using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Storage) LateInitialize(attrs []byte) (bool, error) { + params := &StorageParameters{} + 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 *Storage) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/block/v1alpha1/zz_groupversion_info.go b/apis/block/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..50d02fc --- /dev/null +++ b/apis/block/v1alpha1/zz_groupversion_info.go @@ -0,0 +1,32 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +// +kubebuilder:object:generate=true +// +groupName=block.vultr.upbound.io +// +versionName=v1alpha1 +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +// Package type metadata. +const ( + CRDGroup = "block.vultr.upbound.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/block/v1alpha1/zz_storage_types.go b/apis/block/v1alpha1/zz_storage_types.go new file mode 100755 index 0000000..be4058f --- /dev/null +++ b/apis/block/v1alpha1/zz_storage_types.go @@ -0,0 +1,128 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +) + +type StorageObservation struct { + + // VPS ID that is attached to this block storage. + AttachedToInstance *string `json:"attachedToInstance,omitempty" tf:"attached_to_instance,omitempty"` + + // The type of block storage volume. Values are high_perf or storage_opt. + BlockType *string `json:"blockType,omitempty" tf:"block_type,omitempty"` + + // The monthly cost of this block storage. + Cost *float64 `json:"cost,omitempty" tf:"cost,omitempty"` + + // The date this block storage was created. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // The ID for this block storage. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // Label that is given to your block storage. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // Flag which will determine if a volume should be attached with a restart or not. + Live *bool `json:"live,omitempty" tf:"live,omitempty"` + + // An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio. + MountID *string `json:"mountId,omitempty" tf:"mount_id,omitempty"` + + // Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr") + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The size of the given block storage. + SizeGb *float64 `json:"sizeGb,omitempty" tf:"size_gb,omitempty"` + + // Current status of your block storage. + Status *string `json:"status,omitempty" tf:"status,omitempty"` +} + +type StorageParameters struct { + + // VPS ID that is attached to this block storage. + // +kubebuilder:validation:Optional + AttachedToInstance *string `json:"attachedToInstance,omitempty" tf:"attached_to_instance,omitempty"` + + // The type of block storage volume. Values are high_perf or storage_opt. + // +kubebuilder:validation:Optional + BlockType *string `json:"blockType,omitempty" tf:"block_type,omitempty"` + + // Label that is given to your block storage. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // Flag which will determine if a volume should be attached with a restart or not. + // +kubebuilder:validation:Optional + Live *bool `json:"live,omitempty" tf:"live,omitempty"` + + // Region in which this block storage will reside in. (Currently only NJ/NY supported region "ewr") + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The size of the given block storage. + // +kubebuilder:validation:Optional + SizeGb *float64 `json:"sizeGb,omitempty" tf:"size_gb,omitempty"` +} + +// StorageSpec defines the desired state of Storage +type StorageSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider StorageParameters `json:"forProvider"` +} + +// StorageStatus defines the observed state of Storage. +type StorageStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider StorageObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true + +// Storage is the Schema for the Storages API. Provides a Vultr Block Storage resource. This can be used to create, read, modify, and delete Block Storage. +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,vultr} +type Storage struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region)",message="region is a required parameter" + // +kubebuilder:validation:XValidation:rule="self.managementPolicy == 'ObserveOnly' || has(self.forProvider.sizeGb)",message="sizeGb is a required parameter" + Spec StorageSpec `json:"spec"` + Status StorageStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// StorageList contains a list of Storages +type StorageList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Storage `json:"items"` +} + +// Repository type metadata. +var ( + Storage_Kind = "Storage" + Storage_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: Storage_Kind}.String() + Storage_KindAPIVersion = Storage_Kind + "." + CRDGroupVersion.String() + Storage_GroupVersionKind = CRDGroupVersion.WithKind(Storage_Kind) +) + +func init() { + SchemeBuilder.Register(&Storage{}, &StorageList{}) +} diff --git a/apis/zz_register.go b/apis/zz_register.go index a64cacb..218e1b5 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -10,7 +10,8 @@ package apis import ( "k8s.io/apimachinery/pkg/runtime" - v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/block/v1alpha1" + v1alpha1database "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" v1alpha1kubernetes "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" v1alpha1apis "github.com/crossplane-contrib/provider-vultr/apis/v1alpha1" v1beta1 "github.com/crossplane-contrib/provider-vultr/apis/v1beta1" @@ -21,6 +22,7 @@ func init() { // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme, + v1alpha1database.SchemeBuilder.AddToScheme, v1alpha1kubernetes.SchemeBuilder.AddToScheme, v1alpha1apis.SchemeBuilder.AddToScheme, v1beta1.SchemeBuilder.AddToScheme, diff --git a/config/block/config.go b/config/block/config.go new file mode 100644 index 0000000..c31f4df --- /dev/null +++ b/config/block/config.go @@ -0,0 +1,8 @@ +package block + +import "github.com/upbound/upjet/pkg/config" + +func Configure(p *config.Provider) { + p.AddResourceConfigurator("vultr_block_storage", func(r *config.Resource) { + }) +} diff --git a/config/external_name.go b/config/external_name.go index d48cacd..0de33c6 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -22,6 +22,7 @@ var ExternalNameConfigs = map[string]config.ExternalName{ "vultr_database_replica": config.IdentifierFromProvider, "vultr_database_user": config.IdentifierFromProvider, "vultr_bare_metal_server": config.IdentifierFromProvider, + "vultr_block_storage": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/provider.go b/config/provider.go index 241c331..1c54bc6 100644 --- a/config/provider.go +++ b/config/provider.go @@ -11,6 +11,7 @@ import ( ujconfig "github.com/upbound/upjet/pkg/config" "github.com/crossplane-contrib/provider-vultr/config/baremetal" + "github.com/crossplane-contrib/provider-vultr/config/block" "github.com/crossplane-contrib/provider-vultr/config/compute" "github.com/crossplane-contrib/provider-vultr/config/database" "github.com/crossplane-contrib/provider-vultr/config/kubernetes" @@ -51,6 +52,7 @@ func GetProvider() *ujconfig.Provider { loadbalancer.Configure, database.Configure, baremetal.Configure, + block.Configure, } { diff --git a/examples-generated/block/storage.yaml b/examples-generated/block/storage.yaml new file mode 100644 index 0000000..573b245 --- /dev/null +++ b/examples-generated/block/storage.yaml @@ -0,0 +1,15 @@ +apiVersion: block.vultr.upbound.io/v1alpha1 +kind: Storage +metadata: + annotations: + meta.upbound.io/example-id: block/v1alpha1/storage + labels: + testing.upbound.io/example-name: my_blockstorage + name: my-blockstorage +spec: + forProvider: + region: ewr + sizeGb: 10 + +--- + diff --git a/internal/controller/block/storage/zz_controller.go b/internal/controller/block/storage/zz_controller.go new file mode 100755 index 0000000..cce3246 --- /dev/null +++ b/internal/controller/block/storage/zz_controller.go @@ -0,0 +1,55 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package storage + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + tjcontroller "github.com/upbound/upjet/pkg/controller" + "github.com/upbound/upjet/pkg/terraform" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/block/v1alpha1" + features "github.com/crossplane-contrib/provider-vultr/internal/features" +) + +// Setup adds a controller that reconciles Storage managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.Storage_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)) + } + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter(tjcontroller.NewConnector(mgr.GetClient(), o.WorkspaceStore, o.SetupFn, o.Provider.Resources["vultr_block_storage"], tjcontroller.WithLogger(o.Logger), + tjcontroller.WithCallbackProvider(tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.Storage_GroupVersionKind))), + )), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(terraform.NewWorkspaceFinalizer(o.WorkspaceStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.Features.Enabled(features.EnableAlphaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.Storage_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + For(&v1alpha1.Storage{}). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index b486141..fcc4b68 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -9,6 +9,7 @@ import ( "github.com/upbound/upjet/pkg/controller" + storage "github.com/crossplane-contrib/provider-vultr/internal/controller/block/storage" connectionpool "github.com/crossplane-contrib/provider-vultr/internal/controller/database/connectionpool" db "github.com/crossplane-contrib/provider-vultr/internal/controller/database/db" replica "github.com/crossplane-contrib/provider-vultr/internal/controller/database/replica" @@ -27,6 +28,7 @@ import ( // the supplied manager. func Setup(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ + storage.Setup, connectionpool.Setup, db.Setup, replica.Setup, diff --git a/package/crds/block.vultr.upbound.io_storages.yaml b/package/crds/block.vultr.upbound.io_storages.yaml new file mode 100644 index 0000000..ca0c27f --- /dev/null +++ b/package/crds/block.vultr.upbound.io_storages.yaml @@ -0,0 +1,368 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + creationTimestamp: null + name: storages.block.vultr.upbound.io +spec: + group: block.vultr.upbound.io + names: + categories: + - crossplane + - managed + - vultr + kind: Storage + listKind: StorageList + plural: storages + singular: storage + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: Storage is the Schema for the Storages API. Provides a Vultr + Block Storage resource. This can be used to create, read, modify, and delete + Block Storage. + 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: StorageSpec defines the desired state of Storage + 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 ManagementPolicy 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: + attachedToInstance: + description: VPS ID that is attached to this block storage. + type: string + blockType: + description: The type of block storage volume. Values are high_perf + or storage_opt. + type: string + label: + description: Label that is given to your block storage. + type: string + live: + description: Flag which will determine if a volume should be attached + with a restart or not. + type: boolean + region: + description: Region in which this block storage will reside in. + (Currently only NJ/NY supported region "ewr") + type: string + sizeGb: + description: The size of the given block storage. + type: number + type: object + managementPolicy: + default: FullControl + description: 'THIS IS AN ALPHA FIELD. Do not use it in production. + It is not honored unless the relevant Crossplane feature flag is + enabled, and may be changed or removed without notice. ManagementPolicy + specifies the level of control Crossplane has over the managed external + resource. 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. + 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: + - FullControl + - ObserveOnly + - OrphanOnDelete + type: string + providerConfigRef: + default: + name: default + description: ProviderConfigReference specifies how the provider that + will be used to create, observe, update, and delete this managed + resource should be configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + providerRef: + description: 'ProviderReference specifies the provider that will be + used to create, observe, update, and delete this managed resource. + Deprecated: Please use ProviderConfigReference, i.e. `providerConfigRef`' + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of this + reference is required. The default is 'Required', which + means the reconcile will fail if the reference cannot be + resolved. 'Optional' means this reference will be a no-op + if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will attempt + to resolve the reference only when the corresponding field + is not present. Use 'Always' to resolve the reference on + every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: PublishConnectionDetailsTo specifies the connection secret + config which contains a name, metadata and a reference to secret + store config to which any connection details for this managed resource + should be written. Connection details frequently include the endpoint, + username, and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: SecretStoreConfigRef specifies which secret store + config should be used for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: Resolution specifies whether resolution of + this reference is required. The default is 'Required', + which means the reconcile will fail if the reference + cannot be resolved. 'Optional' means this reference + will be a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: Resolve specifies when this reference should + be resolved. The default is 'IfNotPresent', which will + attempt to resolve the reference only when the corresponding + field is not present. Use 'Always' to resolve the reference + on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: Annotations are the annotations to be added to + connection secret. - For Kubernetes secrets, this will be + used as "metadata.annotations". - It is up to Secret Store + implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: Labels are the labels/tags to be added to connection + secret. - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store + types. + type: object + type: + description: Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: WriteConnectionSecretToReference specifies the namespace + and name of a Secret to which any connection details for this managed + resource should be written. Connection details frequently include + the endpoint, username, and password required to connect to the + managed resource. This field is planned to be replaced in a future + release in favor of PublishConnectionDetailsTo. Currently, both + could be set independently and connection details would be published + to both without affecting each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: region is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.region) + - message: sizeGb is a required parameter + rule: self.managementPolicy == 'ObserveOnly' || has(self.forProvider.sizeGb) + status: + description: StorageStatus defines the observed state of Storage. + properties: + atProvider: + properties: + attachedToInstance: + description: VPS ID that is attached to this block storage. + type: string + blockType: + description: The type of block storage volume. Values are high_perf + or storage_opt. + type: string + cost: + description: The monthly cost of this block storage. + type: number + dateCreated: + description: The date this block storage was created. + type: string + id: + description: The ID for this block storage. + type: string + label: + description: Label that is given to your block storage. + type: string + live: + description: Flag which will determine if a volume should be attached + with a restart or not. + type: boolean + mountId: + description: An ID associated with the instance, when mounted + the ID can be found in /dev/disk/by-id prefixed with virtio. + type: string + region: + description: Region in which this block storage will reside in. + (Currently only NJ/NY supported region "ewr") + type: string + sizeGb: + description: The size of the given block storage. + type: number + status: + description: Current status of your block storage. + type: string + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: LastTransitionTime is the last time this condition + transitioned from one status to another. + format: date-time + type: string + message: + description: A Message containing details about this condition's + last transition from one status to another, if any. + type: string + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: Type of this condition. At most one of each condition + type may apply to a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} From a96175d8ae3b740da4a6e222d07c1999a6288b25 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Thu, 7 Sep 2023 12:36:32 -0400 Subject: [PATCH 11/13] add ShortGroup to package resources --- .../v1alpha1/zz_database_types.go | 0 .../v1alpha1/zz_generated.deepcopy.go | 630 ++++++++ .../database/v1alpha1/zz_generated.managed.go | 76 + .../v1alpha1/zz_generated.managedlist.go | 9 + .../v1alpha1/zz_generated_terraformed.go | 74 + .../v1alpha1/zz_generated.deepcopy.go | 386 ++++- .../v1alpha1/zz_generated.managed.go | 76 + .../v1alpha1/zz_generated.managedlist.go | 9 + .../v1alpha1/zz_generated_terraformed.go | 76 +- .../v1alpha1/zz_kubernetes_types.go | 0 .../kubernetes/v1alpha1/zz_nodepools_types.go | 46 +- apis/vultr/v1alpha1/zz_generated.deepcopy.go | 1282 ++--------------- apis/vultr/v1alpha1/zz_generated.managed.go | 152 -- .../v1alpha1/zz_generated.managedlist.go | 18 - .../v1alpha1/zz_generated_terraformed.go | 148 -- config/database/config.go | 2 + config/groups.go | 3 +- config/kubernetes/config.go | 1 + .../{vultr => database}/database.yaml | 4 +- .../{vultr => kubernetes}/kubernetes.yaml | 4 +- .../database/zz_controller.go | 2 +- .../kubernetes/zz_controller.go | 2 +- internal/controller/zz_setup.go | 8 +- ... database.vultr.upbound.io_databases.yaml} | 4 +- ...bernetes.vultr.upbound.io_kubernetes.yaml} | 4 +- 25 files changed, 1509 insertions(+), 1507 deletions(-) rename apis/{vultr => database}/v1alpha1/zz_database_types.go (100%) rename apis/{vultr => kubernetes}/v1alpha1/zz_kubernetes_types.go (100%) rename examples-generated/{vultr => database}/database.yaml (72%) rename examples-generated/{vultr => kubernetes}/kubernetes.yaml (74%) rename internal/controller/{vultr => database}/database/zz_controller.go (96%) rename internal/controller/{vultr => kubernetes}/kubernetes/zz_controller.go (96%) rename package/crds/{vultr.vultr.upbound.io_databases.yaml => database.vultr.upbound.io_databases.yaml} (99%) rename package/crds/{vultr.vultr.upbound.io_kubernetes.yaml => kubernetes.vultr.upbound.io_kubernetes.yaml} (99%) diff --git a/apis/vultr/v1alpha1/zz_database_types.go b/apis/database/v1alpha1/zz_database_types.go similarity index 100% rename from apis/vultr/v1alpha1/zz_database_types.go rename to apis/database/v1alpha1/zz_database_types.go diff --git a/apis/database/v1alpha1/zz_generated.deepcopy.go b/apis/database/v1alpha1/zz_generated.deepcopy.go index 96280de..774596e 100644 --- a/apis/database/v1alpha1/zz_generated.deepcopy.go +++ b/apis/database/v1alpha1/zz_generated.deepcopy.go @@ -349,6 +349,636 @@ func (in *DBStatus) DeepCopy() *DBStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Database) DeepCopyInto(out *Database) { + *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 Database. +func (in *Database) DeepCopy() *Database { + if in == nil { + return nil + } + out := new(Database) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Database) 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 *DatabaseList) DeepCopyInto(out *DatabaseList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Database, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseList. +func (in *DatabaseList) DeepCopy() *DatabaseList { + if in == nil { + return nil + } + out := new(DatabaseList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *DatabaseList) 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 *DatabaseObservation) DeepCopyInto(out *DatabaseObservation) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Dbname != nil { + in, out := &in.Dbname, &out.Dbname + *out = new(string) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LatestBackup != nil { + in, out := &in.LatestBackup, &out.LatestBackup + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.PlanRAM != nil { + in, out := &in.PlanRAM, &out.PlanRAM + *out = new(float64) + **out = **in + } + if in.PlanReplicas != nil { + in, out := &in.PlanReplicas, &out.PlanReplicas + *out = new(float64) + **out = **in + } + if in.PlanVcpus != nil { + in, out := &in.PlanVcpus, &out.PlanVcpus + *out = new(float64) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.ReadReplicas != nil { + in, out := &in.ReadReplicas, &out.ReadReplicas + *out = make([]ReadReplicasObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *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.User != nil { + in, out := &in.User, &out.User + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObservation. +func (in *DatabaseObservation) DeepCopy() *DatabaseObservation { + if in == nil { + return nil + } + out := new(DatabaseObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseParameters) DeepCopyInto(out *DatabaseParameters) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.ReadReplicas != nil { + in, out := &in.ReadReplicas, &out.ReadReplicas + *out = make([]ReadReplicasParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseParameters. +func (in *DatabaseParameters) DeepCopy() *DatabaseParameters { + if in == nil { + return nil + } + out := new(DatabaseParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec. +func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { + if in == nil { + return nil + } + out := new(DatabaseSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. +func (in *DatabaseStatus) DeepCopy() *DatabaseStatus { + if in == nil { + return nil + } + out := new(DatabaseStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReadReplicasObservation) DeepCopyInto(out *ReadReplicasObservation) { + *out = *in + if in.ClusterTimeZone != nil { + in, out := &in.ClusterTimeZone, &out.ClusterTimeZone + *out = new(string) + **out = **in + } + if in.DatabaseEngine != nil { + in, out := &in.DatabaseEngine, &out.DatabaseEngine + *out = new(string) + **out = **in + } + if in.DatabaseEngineVersion != nil { + in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion + *out = new(string) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Dbname != nil { + in, out := &in.Dbname, &out.Dbname + *out = new(string) + **out = **in + } + if in.Host != nil { + in, out := &in.Host, &out.Host + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.LatestBackup != nil { + in, out := &in.LatestBackup, &out.LatestBackup + *out = new(string) + **out = **in + } + if in.MaintenanceDow != nil { + in, out := &in.MaintenanceDow, &out.MaintenanceDow + *out = new(string) + **out = **in + } + if in.MaintenanceTime != nil { + in, out := &in.MaintenanceTime, &out.MaintenanceTime + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.Password != nil { + in, out := &in.Password, &out.Password + *out = new(string) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.PlanRAM != nil { + in, out := &in.PlanRAM, &out.PlanRAM + *out = new(float64) + **out = **in + } + if in.PlanReplicas != nil { + in, out := &in.PlanReplicas, &out.PlanReplicas + *out = new(float64) + **out = **in + } + if in.PlanVcpus != nil { + in, out := &in.PlanVcpus, &out.PlanVcpus + *out = new(float64) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(string) + **out = **in + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *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.User != nil { + in, out := &in.User, &out.User + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadReplicasObservation. +func (in *ReadReplicasObservation) DeepCopy() *ReadReplicasObservation { + if in == nil { + return nil + } + out := new(ReadReplicasObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReadReplicasParameters) DeepCopyInto(out *ReadReplicasParameters) { + *out = *in + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MySQLLongQueryTime != nil { + in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime + *out = new(float64) + **out = **in + } + if in.MySQLRequirePrimaryKey != nil { + in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey + *out = new(bool) + **out = **in + } + if in.MySQLSQLModes != nil { + in, out := &in.MySQLSQLModes, &out.MySQLSQLModes + *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.MySQLSlowQueryLog != nil { + in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog + *out = new(bool) + **out = **in + } + if in.PlanDisk != nil { + in, out := &in.PlanDisk, &out.PlanDisk + *out = new(float64) + **out = **in + } + if in.RedisEvictionPolicy != nil { + in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } + if in.TrustedIps != nil { + in, out := &in.TrustedIps, &out.TrustedIps + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadReplicasParameters. +func (in *ReadReplicasParameters) DeepCopy() *ReadReplicasParameters { + if in == nil { + return nil + } + out := new(ReadReplicasParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Replica) DeepCopyInto(out *Replica) { *out = *in diff --git a/apis/database/v1alpha1/zz_generated.managed.go b/apis/database/v1alpha1/zz_generated.managed.go index 7fc2717..a345aeb 100644 --- a/apis/database/v1alpha1/zz_generated.managed.go +++ b/apis/database/v1alpha1/zz_generated.managed.go @@ -159,6 +159,82 @@ func (mg *DB) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this Database. +func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Database. +func (mg *Database) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Database. +func (mg *Database) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Database. +func (mg *Database) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Database. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Database) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Database. +func (mg *Database) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Database. +func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Database. +func (mg *Database) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Database. +func (mg *Database) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Database. +func (mg *Database) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Database. +func (mg *Database) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Database. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Database) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Database. +func (mg *Database) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Database. +func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this Replica. func (mg *Replica) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/database/v1alpha1/zz_generated.managedlist.go b/apis/database/v1alpha1/zz_generated.managedlist.go index 15533bd..f55c08f 100644 --- a/apis/database/v1alpha1/zz_generated.managedlist.go +++ b/apis/database/v1alpha1/zz_generated.managedlist.go @@ -25,6 +25,15 @@ func (l *DBList) GetItems() []resource.Managed { return items } +// GetItems of this DatabaseList. +func (l *DatabaseList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this ReplicaList. func (l *ReplicaList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/database/v1alpha1/zz_generated_terraformed.go b/apis/database/v1alpha1/zz_generated_terraformed.go index 6d97d90..1847f19 100755 --- a/apis/database/v1alpha1/zz_generated_terraformed.go +++ b/apis/database/v1alpha1/zz_generated_terraformed.go @@ -13,6 +13,80 @@ import ( "github.com/upbound/upjet/pkg/resource/json" ) +// GetTerraformResourceType returns Terraform resource type for this Database +func (mg *Database) GetTerraformResourceType() string { + return "vultr_database" +} + +// GetConnectionDetailsMapping for this Database +func (tr *Database) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this Database +func (tr *Database) 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 Database +func (tr *Database) 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 Database +func (tr *Database) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Database +func (tr *Database) 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 Database +func (tr *Database) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Database using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Database) LateInitialize(attrs []byte) (bool, error) { + params := &DatabaseParameters{} + 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 *Database) GetTerraformSchemaVersion() int { + return 0 +} + // GetTerraformResourceType returns Terraform resource type for this ConnectionPool func (mg *ConnectionPool) GetTerraformResourceType() string { return "vultr_database_connection_pool" diff --git a/apis/kubernetes/v1alpha1/zz_generated.deepcopy.go b/apis/kubernetes/v1alpha1/zz_generated.deepcopy.go index fdd556a..d2613a3 100644 --- a/apis/kubernetes/v1alpha1/zz_generated.deepcopy.go +++ b/apis/kubernetes/v1alpha1/zz_generated.deepcopy.go @@ -13,6 +13,208 @@ 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 *Kubernetes) DeepCopyInto(out *Kubernetes) { + *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 Kubernetes. +func (in *Kubernetes) DeepCopy() *Kubernetes { + if in == nil { + return nil + } + out := new(Kubernetes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Kubernetes) 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 *KubernetesList) DeepCopyInto(out *KubernetesList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Kubernetes, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesList. +func (in *KubernetesList) DeepCopy() *KubernetesList { + if in == nil { + return nil + } + out := new(KubernetesList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *KubernetesList) 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 *KubernetesObservation) DeepCopyInto(out *KubernetesObservation) { + *out = *in + if in.ClusterSubnet != nil { + in, out := &in.ClusterSubnet, &out.ClusterSubnet + *out = new(string) + **out = **in + } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.Endpoint != nil { + in, out := &in.Endpoint, &out.Endpoint + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.IP != nil { + in, out := &in.IP, &out.IP + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.NodePools != nil { + in, out := &in.NodePools, &out.NodePools + *out = make([]NodePoolsObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ServiceSubnet != nil { + in, out := &in.ServiceSubnet, &out.ServiceSubnet + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesObservation. +func (in *KubernetesObservation) DeepCopy() *KubernetesObservation { + if in == nil { + return nil + } + out := new(KubernetesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubernetesParameters) DeepCopyInto(out *KubernetesParameters) { + *out = *in + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.NodePools != nil { + in, out := &in.NodePools, &out.NodePools + *out = make([]NodePoolsParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesParameters. +func (in *KubernetesParameters) DeepCopy() *KubernetesParameters { + if in == nil { + return nil + } + out := new(KubernetesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubernetesSpec) DeepCopyInto(out *KubernetesSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesSpec. +func (in *KubernetesSpec) DeepCopy() *KubernetesSpec { + if in == nil { + return nil + } + out := new(KubernetesSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubernetesStatus) DeepCopyInto(out *KubernetesStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesStatus. +func (in *KubernetesStatus) DeepCopy() *KubernetesStatus { + if in == nil { + return nil + } + out := new(KubernetesStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePools) DeepCopyInto(out *NodePools) { *out = *in @@ -72,6 +274,56 @@ func (in *NodePoolsList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePoolsNodesObservation) DeepCopyInto(out *NodePoolsNodesObservation) { + *out = *in + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsNodesObservation. +func (in *NodePoolsNodesObservation) DeepCopy() *NodePoolsNodesObservation { + if in == nil { + return nil + } + out := new(NodePoolsNodesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePoolsNodesParameters) DeepCopyInto(out *NodePoolsNodesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsNodesParameters. +func (in *NodePoolsNodesParameters) DeepCopy() *NodePoolsNodesParameters { + if in == nil { + return nil + } + out := new(NodePoolsNodesParameters) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePoolsObservation) DeepCopyInto(out *NodePoolsObservation) { *out = *in @@ -80,11 +332,6 @@ func (in *NodePoolsObservation) DeepCopyInto(out *NodePoolsObservation) { *out = new(bool) **out = **in } - if in.ClusterID != nil { - in, out := &in.ClusterID, &out.ClusterID - *out = new(string) - **out = **in - } if in.DateCreated != nil { in, out := &in.DateCreated, &out.DateCreated *out = new(string) @@ -155,7 +402,7 @@ func (in *NodePoolsObservation) DeepCopy() *NodePoolsObservation { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodePoolsParameters) DeepCopyInto(out *NodePoolsParameters) { +func (in *NodePoolsObservation_2) DeepCopyInto(out *NodePoolsObservation_2) { *out = *in if in.AutoScaler != nil { in, out := &in.AutoScaler, &out.AutoScaler @@ -167,6 +414,21 @@ func (in *NodePoolsParameters) DeepCopyInto(out *NodePoolsParameters) { *out = new(string) **out = **in } + if in.DateCreated != nil { + in, out := &in.DateCreated, &out.DateCreated + *out = new(string) + **out = **in + } + if in.DateUpdated != nil { + in, out := &in.DateUpdated, &out.DateUpdated + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } if in.Label != nil { in, out := &in.Label, &out.Label *out = new(string) @@ -187,11 +449,23 @@ func (in *NodePoolsParameters) DeepCopyInto(out *NodePoolsParameters) { *out = new(float64) **out = **in } + if in.Nodes != nil { + in, out := &in.Nodes, &out.Nodes + *out = make([]NodePoolsNodesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } if in.Plan != nil { in, out := &in.Plan, &out.Plan *out = new(string) **out = **in } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } if in.Tag != nil { in, out := &in.Tag, &out.Tag *out = new(string) @@ -199,6 +473,51 @@ func (in *NodePoolsParameters) DeepCopyInto(out *NodePoolsParameters) { } } +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsObservation_2. +func (in *NodePoolsObservation_2) DeepCopy() *NodePoolsObservation_2 { + if in == nil { + return nil + } + out := new(NodePoolsObservation_2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePoolsParameters) DeepCopyInto(out *NodePoolsParameters) { + *out = *in + if in.AutoScaler != nil { + in, out := &in.AutoScaler, &out.AutoScaler + *out = new(bool) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MaxNodes != nil { + in, out := &in.MaxNodes, &out.MaxNodes + *out = new(float64) + **out = **in + } + if in.MinNodes != nil { + in, out := &in.MinNodes, &out.MinNodes + *out = new(float64) + **out = **in + } + if in.NodeQuantity != nil { + in, out := &in.NodeQuantity, &out.NodeQuantity + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } +} + // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsParameters. func (in *NodePoolsParameters) DeepCopy() *NodePoolsParameters { if in == nil { @@ -209,6 +528,61 @@ func (in *NodePoolsParameters) DeepCopy() *NodePoolsParameters { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePoolsParameters_2) DeepCopyInto(out *NodePoolsParameters_2) { + *out = *in + if in.AutoScaler != nil { + in, out := &in.AutoScaler, &out.AutoScaler + *out = new(bool) + **out = **in + } + if in.ClusterID != nil { + in, out := &in.ClusterID, &out.ClusterID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.MaxNodes != nil { + in, out := &in.MaxNodes, &out.MaxNodes + *out = new(float64) + **out = **in + } + if in.MinNodes != nil { + in, out := &in.MinNodes, &out.MinNodes + *out = new(float64) + **out = **in + } + if in.NodeQuantity != nil { + in, out := &in.NodeQuantity, &out.NodeQuantity + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsParameters_2. +func (in *NodePoolsParameters_2) DeepCopy() *NodePoolsParameters_2 { + if in == nil { + return nil + } + out := new(NodePoolsParameters_2) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodePoolsSpec) DeepCopyInto(out *NodePoolsSpec) { *out = *in diff --git a/apis/kubernetes/v1alpha1/zz_generated.managed.go b/apis/kubernetes/v1alpha1/zz_generated.managed.go index 788d693..c9d7319 100644 --- a/apis/kubernetes/v1alpha1/zz_generated.managed.go +++ b/apis/kubernetes/v1alpha1/zz_generated.managed.go @@ -7,6 +7,82 @@ package v1alpha1 import xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" +// GetCondition of this Kubernetes. +func (mg *Kubernetes) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this Kubernetes. +func (mg *Kubernetes) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicy of this Kubernetes. +func (mg *Kubernetes) GetManagementPolicy() xpv1.ManagementPolicy { + return mg.Spec.ManagementPolicy +} + +// GetProviderConfigReference of this Kubernetes. +func (mg *Kubernetes) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +/* +GetProviderReference of this Kubernetes. +Deprecated: Use GetProviderConfigReference. +*/ +func (mg *Kubernetes) GetProviderReference() *xpv1.Reference { + return mg.Spec.ProviderReference +} + +// GetPublishConnectionDetailsTo of this Kubernetes. +func (mg *Kubernetes) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this Kubernetes. +func (mg *Kubernetes) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this Kubernetes. +func (mg *Kubernetes) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this Kubernetes. +func (mg *Kubernetes) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicy of this Kubernetes. +func (mg *Kubernetes) SetManagementPolicy(r xpv1.ManagementPolicy) { + mg.Spec.ManagementPolicy = r +} + +// SetProviderConfigReference of this Kubernetes. +func (mg *Kubernetes) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +/* +SetProviderReference of this Kubernetes. +Deprecated: Use SetProviderConfigReference. +*/ +func (mg *Kubernetes) SetProviderReference(r *xpv1.Reference) { + mg.Spec.ProviderReference = r +} + +// SetPublishConnectionDetailsTo of this Kubernetes. +func (mg *Kubernetes) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this Kubernetes. +func (mg *Kubernetes) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this NodePools. func (mg *NodePools) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/kubernetes/v1alpha1/zz_generated.managedlist.go b/apis/kubernetes/v1alpha1/zz_generated.managedlist.go index bf73441..bd75918 100644 --- a/apis/kubernetes/v1alpha1/zz_generated.managedlist.go +++ b/apis/kubernetes/v1alpha1/zz_generated.managedlist.go @@ -7,6 +7,15 @@ package v1alpha1 import resource "github.com/crossplane/crossplane-runtime/pkg/resource" +// GetItems of this KubernetesList. +func (l *KubernetesList) GetItems() []resource.Managed { + items := make([]resource.Managed, len(l.Items)) + for i := range l.Items { + items[i] = &l.Items[i] + } + return items +} + // GetItems of this NodePoolsList. func (l *NodePoolsList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/kubernetes/v1alpha1/zz_generated_terraformed.go b/apis/kubernetes/v1alpha1/zz_generated_terraformed.go index 77bc400..eabb453 100755 --- a/apis/kubernetes/v1alpha1/zz_generated_terraformed.go +++ b/apis/kubernetes/v1alpha1/zz_generated_terraformed.go @@ -13,6 +13,80 @@ import ( "github.com/upbound/upjet/pkg/resource/json" ) +// GetTerraformResourceType returns Terraform resource type for this Kubernetes +func (mg *Kubernetes) GetTerraformResourceType() string { + return "vultr_kubernetes" +} + +// GetConnectionDetailsMapping for this Kubernetes +func (tr *Kubernetes) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"client_certificate": "status.atProvider.clientCertificate", "client_key": "status.atProvider.clientKey", "cluster_ca_certificate": "status.atProvider.clusterCaCertificate", "kube_config": "status.atProvider.kubeConfig"} +} + +// GetObservation of this Kubernetes +func (tr *Kubernetes) 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 Kubernetes +func (tr *Kubernetes) 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 Kubernetes +func (tr *Kubernetes) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this Kubernetes +func (tr *Kubernetes) 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 Kubernetes +func (tr *Kubernetes) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// LateInitialize this Kubernetes using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *Kubernetes) LateInitialize(attrs []byte) (bool, error) { + params := &KubernetesParameters{} + 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 *Kubernetes) GetTerraformSchemaVersion() int { + return 0 +} + // GetTerraformResourceType returns Terraform resource type for this NodePools func (mg *NodePools) GetTerraformResourceType() string { return "vultr_kubernetes_node_pools" @@ -72,7 +146,7 @@ func (tr *NodePools) SetParameters(params map[string]any) error { // LateInitialize this NodePools using its observed tfState. // returns True if there are any spec changes for the resource. func (tr *NodePools) LateInitialize(attrs []byte) (bool, error) { - params := &NodePoolsParameters{} + params := &NodePoolsParameters_2{} if err := json.TFParser.Unmarshal(attrs, params); err != nil { return false, errors.Wrap(err, "failed to unmarshal Terraform state parameters for late-initialization") } diff --git a/apis/vultr/v1alpha1/zz_kubernetes_types.go b/apis/kubernetes/v1alpha1/zz_kubernetes_types.go similarity index 100% rename from apis/vultr/v1alpha1/zz_kubernetes_types.go rename to apis/kubernetes/v1alpha1/zz_kubernetes_types.go diff --git a/apis/kubernetes/v1alpha1/zz_nodepools_types.go b/apis/kubernetes/v1alpha1/zz_nodepools_types.go index a7a16d7..247cf60 100755 --- a/apis/kubernetes/v1alpha1/zz_nodepools_types.go +++ b/apis/kubernetes/v1alpha1/zz_nodepools_types.go @@ -13,7 +13,25 @@ import ( v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) -type NodePoolsObservation struct { +type NodePoolsNodesObservation struct { + + // Date of node pool creation. + DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` + + // The Nodepool ID. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The label to be used as a prefix for nodes in this node pool. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // Status of node pool. + Status *string `json:"status,omitempty" tf:"status,omitempty"` +} + +type NodePoolsNodesParameters struct { +} + +type NodePoolsObservation_2 struct { // Enable the auto scaler for the default node pool. AutoScaler *bool `json:"autoScaler,omitempty" tf:"auto_scaler,omitempty"` @@ -43,7 +61,7 @@ type NodePoolsObservation struct { NodeQuantity *float64 `json:"nodeQuantity,omitempty" tf:"node_quantity,omitempty"` // Array that contains information about nodes within this node pool. - Nodes []NodesObservation `json:"nodes,omitempty" tf:"nodes,omitempty"` + Nodes []NodePoolsNodesObservation `json:"nodes,omitempty" tf:"nodes,omitempty"` // The plan to be used in this node pool. See Plans List Note the minimum plan requirements must have at least 1 core and 2 gbs of memory. Plan *string `json:"plan,omitempty" tf:"plan,omitempty"` @@ -55,7 +73,7 @@ type NodePoolsObservation struct { Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` } -type NodePoolsParameters struct { +type NodePoolsParameters_2 struct { // Enable the auto scaler for the default node pool. // +kubebuilder:validation:Optional @@ -90,34 +108,16 @@ type NodePoolsParameters struct { Tag *string `json:"tag,omitempty" tf:"tag,omitempty"` } -type NodesObservation struct { - - // Date of node pool creation. - DateCreated *string `json:"dateCreated,omitempty" tf:"date_created,omitempty"` - - // The Nodepool ID. - ID *string `json:"id,omitempty" tf:"id,omitempty"` - - // The label to be used as a prefix for nodes in this node pool. - Label *string `json:"label,omitempty" tf:"label,omitempty"` - - // Status of node pool. - Status *string `json:"status,omitempty" tf:"status,omitempty"` -} - -type NodesParameters struct { -} - // NodePoolsSpec defines the desired state of NodePools type NodePoolsSpec struct { v1.ResourceSpec `json:",inline"` - ForProvider NodePoolsParameters `json:"forProvider"` + ForProvider NodePoolsParameters_2 `json:"forProvider"` } // NodePoolsStatus defines the observed state of NodePools. type NodePoolsStatus struct { v1.ResourceStatus `json:",inline"` - AtProvider NodePoolsObservation `json:"atProvider,omitempty"` + AtProvider NodePoolsObservation_2 `json:"atProvider,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/vultr/v1alpha1/zz_generated.deepcopy.go b/apis/vultr/v1alpha1/zz_generated.deepcopy.go index 57b5381..beb3098 100644 --- a/apis/vultr/v1alpha1/zz_generated.deepcopy.go +++ b/apis/vultr/v1alpha1/zz_generated.deepcopy.go @@ -450,392 +450,6 @@ func (in *BareMetalServerStatus) DeepCopy() *BareMetalServerStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Database) DeepCopyInto(out *Database) { - *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 Database. -func (in *Database) DeepCopy() *Database { - if in == nil { - return nil - } - out := new(Database) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Database) 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 *DatabaseList) DeepCopyInto(out *DatabaseList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Database, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseList. -func (in *DatabaseList) DeepCopy() *DatabaseList { - if in == nil { - return nil - } - out := new(DatabaseList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DatabaseList) 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 *DatabaseObservation) DeepCopyInto(out *DatabaseObservation) { - *out = *in - if in.ClusterTimeZone != nil { - in, out := &in.ClusterTimeZone, &out.ClusterTimeZone - *out = new(string) - **out = **in - } - if in.DatabaseEngine != nil { - in, out := &in.DatabaseEngine, &out.DatabaseEngine - *out = new(string) - **out = **in - } - if in.DatabaseEngineVersion != nil { - in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion - *out = new(string) - **out = **in - } - if in.DateCreated != nil { - in, out := &in.DateCreated, &out.DateCreated - *out = new(string) - **out = **in - } - if in.Dbname != nil { - in, out := &in.Dbname, &out.Dbname - *out = new(string) - **out = **in - } - if in.Host != nil { - in, out := &in.Host, &out.Host - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.LatestBackup != nil { - in, out := &in.LatestBackup, &out.LatestBackup - *out = new(string) - **out = **in - } - if in.MaintenanceDow != nil { - in, out := &in.MaintenanceDow, &out.MaintenanceDow - *out = new(string) - **out = **in - } - if in.MaintenanceTime != nil { - in, out := &in.MaintenanceTime, &out.MaintenanceTime - *out = new(string) - **out = **in - } - if in.MySQLLongQueryTime != nil { - in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime - *out = new(float64) - **out = **in - } - if in.MySQLRequirePrimaryKey != nil { - in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey - *out = new(bool) - **out = **in - } - if in.MySQLSQLModes != nil { - in, out := &in.MySQLSQLModes, &out.MySQLSQLModes - *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.MySQLSlowQueryLog != nil { - in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog - *out = new(bool) - **out = **in - } - if in.Password != nil { - in, out := &in.Password, &out.Password - *out = new(string) - **out = **in - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = new(string) - **out = **in - } - if in.PlanDisk != nil { - in, out := &in.PlanDisk, &out.PlanDisk - *out = new(float64) - **out = **in - } - if in.PlanRAM != nil { - in, out := &in.PlanRAM, &out.PlanRAM - *out = new(float64) - **out = **in - } - if in.PlanReplicas != nil { - in, out := &in.PlanReplicas, &out.PlanReplicas - *out = new(float64) - **out = **in - } - if in.PlanVcpus != nil { - in, out := &in.PlanVcpus, &out.PlanVcpus - *out = new(float64) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(string) - **out = **in - } - if in.ReadReplicas != nil { - in, out := &in.ReadReplicas, &out.ReadReplicas - *out = make([]ReadReplicasObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RedisEvictionPolicy != nil { - in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } - if in.Tag != nil { - in, out := &in.Tag, &out.Tag - *out = new(string) - **out = **in - } - if in.TrustedIps != nil { - in, out := &in.TrustedIps, &out.TrustedIps - *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.User != nil { - in, out := &in.User, &out.User - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseObservation. -func (in *DatabaseObservation) DeepCopy() *DatabaseObservation { - if in == nil { - return nil - } - out := new(DatabaseObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DatabaseParameters) DeepCopyInto(out *DatabaseParameters) { - *out = *in - if in.ClusterTimeZone != nil { - in, out := &in.ClusterTimeZone, &out.ClusterTimeZone - *out = new(string) - **out = **in - } - if in.DatabaseEngine != nil { - in, out := &in.DatabaseEngine, &out.DatabaseEngine - *out = new(string) - **out = **in - } - if in.DatabaseEngineVersion != nil { - in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.MaintenanceDow != nil { - in, out := &in.MaintenanceDow, &out.MaintenanceDow - *out = new(string) - **out = **in - } - if in.MaintenanceTime != nil { - in, out := &in.MaintenanceTime, &out.MaintenanceTime - *out = new(string) - **out = **in - } - if in.MySQLLongQueryTime != nil { - in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime - *out = new(float64) - **out = **in - } - if in.MySQLRequirePrimaryKey != nil { - in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey - *out = new(bool) - **out = **in - } - if in.MySQLSQLModes != nil { - in, out := &in.MySQLSQLModes, &out.MySQLSQLModes - *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.MySQLSlowQueryLog != nil { - in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog - *out = new(bool) - **out = **in - } - if in.Password != nil { - in, out := &in.Password, &out.Password - *out = new(string) - **out = **in - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = new(string) - **out = **in - } - if in.PlanDisk != nil { - in, out := &in.PlanDisk, &out.PlanDisk - *out = new(float64) - **out = **in - } - if in.ReadReplicas != nil { - in, out := &in.ReadReplicas, &out.ReadReplicas - *out = make([]ReadReplicasParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.RedisEvictionPolicy != nil { - in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Tag != nil { - in, out := &in.Tag, &out.Tag - *out = new(string) - **out = **in - } - if in.TrustedIps != nil { - in, out := &in.TrustedIps, &out.TrustedIps - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseParameters. -func (in *DatabaseParameters) DeepCopy() *DatabaseParameters { - if in == nil { - return nil - } - out := new(DatabaseParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseSpec. -func (in *DatabaseSpec) DeepCopy() *DatabaseSpec { - if in == nil { - return nil - } - out := new(DatabaseSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DatabaseStatus. -func (in *DatabaseStatus) DeepCopy() *DatabaseStatus { - if in == nil { - return nil - } - out := new(DatabaseStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *FirewallRulesObservation) DeepCopyInto(out *FirewallRulesObservation) { *out = *in @@ -1384,278 +998,61 @@ func (in *InstanceObservation) DeepCopy() *InstanceObservation { } out := new(InstanceObservation) in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstanceParameters) DeepCopyInto(out *InstanceParameters) { - *out = *in - if in.ActivationEmail != nil { - in, out := &in.ActivationEmail, &out.ActivationEmail - *out = new(bool) - **out = **in - } - if in.AppID != nil { - in, out := &in.AppID, &out.AppID - *out = new(float64) - **out = **in - } - if in.Backups != nil { - in, out := &in.Backups, &out.Backups - *out = new(string) - **out = **in - } - if in.BackupsSchedule != nil { - in, out := &in.BackupsSchedule, &out.BackupsSchedule - *out = make([]BackupsScheduleParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DdosProtection != nil { - in, out := &in.DdosProtection, &out.DdosProtection - *out = new(bool) - **out = **in - } - if in.EnableIPv6 != nil { - in, out := &in.EnableIPv6, &out.EnableIPv6 - *out = new(bool) - **out = **in - } - if in.FirewallGroupID != nil { - in, out := &in.FirewallGroupID, &out.FirewallGroupID - *out = new(string) - **out = **in - } - if in.Hostname != nil { - in, out := &in.Hostname, &out.Hostname - *out = new(string) - **out = **in - } - if in.ImageID != nil { - in, out := &in.ImageID, &out.ImageID - *out = new(string) - **out = **in - } - if in.IsoID != nil { - in, out := &in.IsoID, &out.IsoID - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.OsID != nil { - in, out := &in.OsID, &out.OsID - *out = new(float64) - **out = **in - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = new(string) - **out = **in - } - if in.PrivateNetworkIds != nil { - in, out := &in.PrivateNetworkIds, &out.PrivateNetworkIds - *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.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.ReservedIPID != nil { - in, out := &in.ReservedIPID, &out.ReservedIPID - *out = new(string) - **out = **in - } - if in.SSHKeyIds != nil { - in, out := &in.SSHKeyIds, &out.SSHKeyIds - *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.ScriptID != nil { - in, out := &in.ScriptID, &out.ScriptID - *out = new(string) - **out = **in - } - if in.SnapshotID != nil { - in, out := &in.SnapshotID, &out.SnapshotID - *out = new(string) - **out = **in - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *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.UserData != nil { - in, out := &in.UserData, &out.UserData - *out = new(string) - **out = **in - } - if in.VPCIds != nil { - in, out := &in.VPCIds, &out.VPCIds - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceParameters. -func (in *InstanceParameters) DeepCopy() *InstanceParameters { - if in == nil { - return nil - } - out := new(InstanceParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. -func (in *InstanceSpec) DeepCopy() *InstanceSpec { - if in == nil { - return nil - } - out := new(InstanceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus. -func (in *InstanceStatus) DeepCopy() *InstanceStatus { - if in == nil { - return nil - } - out := new(InstanceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Kubernetes) DeepCopyInto(out *Kubernetes) { - *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 Kubernetes. -func (in *Kubernetes) DeepCopy() *Kubernetes { - if in == nil { - return nil - } - out := new(Kubernetes) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Kubernetes) 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 *KubernetesList) DeepCopyInto(out *KubernetesList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Kubernetes, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesList. -func (in *KubernetesList) DeepCopy() *KubernetesList { - if in == nil { - return nil - } - out := new(KubernetesList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubernetesList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil + return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubernetesObservation) DeepCopyInto(out *KubernetesObservation) { +func (in *InstanceParameters) DeepCopyInto(out *InstanceParameters) { *out = *in - if in.ClusterSubnet != nil { - in, out := &in.ClusterSubnet, &out.ClusterSubnet + if in.ActivationEmail != nil { + in, out := &in.ActivationEmail, &out.ActivationEmail + *out = new(bool) + **out = **in + } + if in.AppID != nil { + in, out := &in.AppID, &out.AppID + *out = new(float64) + **out = **in + } + if in.Backups != nil { + in, out := &in.Backups, &out.Backups *out = new(string) **out = **in } - if in.DateCreated != nil { - in, out := &in.DateCreated, &out.DateCreated + if in.BackupsSchedule != nil { + in, out := &in.BackupsSchedule, &out.BackupsSchedule + *out = make([]BackupsScheduleParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.DdosProtection != nil { + in, out := &in.DdosProtection, &out.DdosProtection + *out = new(bool) + **out = **in + } + if in.EnableIPv6 != nil { + in, out := &in.EnableIPv6, &out.EnableIPv6 + *out = new(bool) + **out = **in + } + if in.FirewallGroupID != nil { + in, out := &in.FirewallGroupID, &out.FirewallGroupID *out = new(string) **out = **in } - if in.Endpoint != nil { - in, out := &in.Endpoint, &out.Endpoint + if in.Hostname != nil { + in, out := &in.Hostname, &out.Hostname *out = new(string) **out = **in } - if in.ID != nil { - in, out := &in.ID, &out.ID + if in.ImageID != nil { + in, out := &in.ImageID, &out.ImageID *out = new(string) **out = **in } - if in.IP != nil { - in, out := &in.IP, &out.IP + if in.IsoID != nil { + in, out := &in.IsoID, &out.IsoID *out = new(string) **out = **in } @@ -1664,11 +1061,25 @@ func (in *KubernetesObservation) DeepCopyInto(out *KubernetesObservation) { *out = new(string) **out = **in } - if in.NodePools != nil { - in, out := &in.NodePools, &out.NodePools - *out = make([]NodePoolsObservation, len(*in)) + if in.OsID != nil { + in, out := &in.OsID, &out.OsID + *out = new(float64) + **out = **in + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = new(string) + **out = **in + } + if in.PrivateNetworkIds != nil { + in, out := &in.PrivateNetworkIds, &out.PrivateNetworkIds + *out = make([]*string, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } } } if in.Region != nil { @@ -1676,100 +1087,101 @@ func (in *KubernetesObservation) DeepCopyInto(out *KubernetesObservation) { *out = new(string) **out = **in } - if in.ServiceSubnet != nil { - in, out := &in.ServiceSubnet, &out.ServiceSubnet + if in.ReservedIPID != nil { + in, out := &in.ReservedIPID, &out.ReservedIPID *out = new(string) **out = **in } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in + if in.SSHKeyIds != nil { + in, out := &in.SSHKeyIds, &out.SSHKeyIds + *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.Version != nil { - in, out := &in.Version, &out.Version + if in.ScriptID != nil { + in, out := &in.ScriptID, &out.ScriptID *out = new(string) **out = **in } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesObservation. -func (in *KubernetesObservation) DeepCopy() *KubernetesObservation { - if in == nil { - return nil - } - out := new(KubernetesObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubernetesParameters) DeepCopyInto(out *KubernetesParameters) { - *out = *in - if in.Label != nil { - in, out := &in.Label, &out.Label + if in.SnapshotID != nil { + in, out := &in.SnapshotID, &out.SnapshotID *out = new(string) **out = **in } - if in.NodePools != nil { - in, out := &in.NodePools, &out.NodePools - *out = make([]NodePoolsParameters, len(*in)) + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]*string, len(*in)) for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } } } - if in.Region != nil { - in, out := &in.Region, &out.Region + if in.UserData != nil { + in, out := &in.UserData, &out.UserData *out = new(string) **out = **in } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in + if in.VPCIds != nil { + in, out := &in.VPCIds, &out.VPCIds + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesParameters. -func (in *KubernetesParameters) DeepCopy() *KubernetesParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceParameters. +func (in *InstanceParameters) DeepCopy() *InstanceParameters { if in == nil { return nil } - out := new(KubernetesParameters) + out := new(InstanceParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubernetesSpec) DeepCopyInto(out *KubernetesSpec) { +func (in *InstanceSpec) DeepCopyInto(out *InstanceSpec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesSpec. -func (in *KubernetesSpec) DeepCopy() *KubernetesSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceSpec. +func (in *InstanceSpec) DeepCopy() *InstanceSpec { if in == nil { return nil } - out := new(KubernetesSpec) + out := new(InstanceSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubernetesStatus) DeepCopyInto(out *KubernetesStatus) { +func (in *InstanceStatus) DeepCopyInto(out *InstanceStatus) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesStatus. -func (in *KubernetesStatus) DeepCopy() *KubernetesStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstanceStatus. +func (in *InstanceStatus) DeepCopy() *InstanceStatus { if in == nil { return nil } - out := new(KubernetesStatus) + out := new(InstanceStatus) in.DeepCopyInto(out) return out } @@ -1995,259 +1407,87 @@ func (in *LoadBalancerParameters) DeepCopyInto(out *LoadBalancerParameters) { *out = make([]HealthCheckParameters, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.PrivateNetwork != nil { - in, out := &in.PrivateNetwork, &out.PrivateNetwork - *out = new(string) - **out = **in - } - if in.ProxyProtocol != nil { - in, out := &in.ProxyProtocol, &out.ProxyProtocol - *out = new(bool) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.SSL != nil { - in, out := &in.SSL, &out.SSL - *out = make([]SSLParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.SSLRedirect != nil { - in, out := &in.SSLRedirect, &out.SSLRedirect - *out = new(bool) - **out = **in - } - if in.VPC != nil { - in, out := &in.VPC, &out.VPC - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerParameters. -func (in *LoadBalancerParameters) DeepCopy() *LoadBalancerParameters { - if in == nil { - return nil - } - out := new(LoadBalancerParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { - *out = *in - in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) - in.ForProvider.DeepCopyInto(&out.ForProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec. -func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { - if in == nil { - return nil - } - out := new(LoadBalancerSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LoadBalancerStatus) DeepCopyInto(out *LoadBalancerStatus) { - *out = *in - in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) - in.AtProvider.DeepCopyInto(&out.AtProvider) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerStatus. -func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus { - if in == nil { - return nil - } - out := new(LoadBalancerStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodePoolsObservation) DeepCopyInto(out *NodePoolsObservation) { - *out = *in - if in.AutoScaler != nil { - in, out := &in.AutoScaler, &out.AutoScaler - *out = new(bool) - **out = **in - } - if in.DateCreated != nil { - in, out := &in.DateCreated, &out.DateCreated - *out = new(string) - **out = **in - } - if in.DateUpdated != nil { - in, out := &in.DateUpdated, &out.DateUpdated - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.MaxNodes != nil { - in, out := &in.MaxNodes, &out.MaxNodes - *out = new(float64) - **out = **in - } - if in.MinNodes != nil { - in, out := &in.MinNodes, &out.MinNodes - *out = new(float64) - **out = **in - } - if in.NodeQuantity != nil { - in, out := &in.NodeQuantity, &out.NodeQuantity - *out = new(float64) - **out = **in - } - if in.Nodes != nil { - in, out := &in.Nodes, &out.Nodes - *out = make([]NodesObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = new(string) - **out = **in + } } - if in.Status != nil { - in, out := &in.Status, &out.Status + if in.Label != nil { + in, out := &in.Label, &out.Label *out = new(string) **out = **in } - if in.Tag != nil { - in, out := &in.Tag, &out.Tag + if in.PrivateNetwork != nil { + in, out := &in.PrivateNetwork, &out.PrivateNetwork *out = new(string) **out = **in } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsObservation. -func (in *NodePoolsObservation) DeepCopy() *NodePoolsObservation { - if in == nil { - return nil - } - out := new(NodePoolsObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodePoolsParameters) DeepCopyInto(out *NodePoolsParameters) { - *out = *in - if in.AutoScaler != nil { - in, out := &in.AutoScaler, &out.AutoScaler + if in.ProxyProtocol != nil { + in, out := &in.ProxyProtocol, &out.ProxyProtocol *out = new(bool) **out = **in } - if in.Label != nil { - in, out := &in.Label, &out.Label + if in.Region != nil { + in, out := &in.Region, &out.Region *out = new(string) **out = **in } - if in.MaxNodes != nil { - in, out := &in.MaxNodes, &out.MaxNodes - *out = new(float64) - **out = **in - } - if in.MinNodes != nil { - in, out := &in.MinNodes, &out.MinNodes - *out = new(float64) - **out = **in + if in.SSL != nil { + in, out := &in.SSL, &out.SSL + *out = make([]SSLParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } - if in.NodeQuantity != nil { - in, out := &in.NodeQuantity, &out.NodeQuantity - *out = new(float64) + if in.SSLRedirect != nil { + in, out := &in.SSLRedirect, &out.SSLRedirect + *out = new(bool) **out = **in } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan + if in.VPC != nil { + in, out := &in.VPC, &out.VPC *out = new(string) **out = **in } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolsParameters. -func (in *NodePoolsParameters) DeepCopy() *NodePoolsParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerParameters. +func (in *LoadBalancerParameters) DeepCopy() *LoadBalancerParameters { if in == nil { return nil } - out := new(NodePoolsParameters) + out := new(LoadBalancerParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodesObservation) DeepCopyInto(out *NodesObservation) { +func (in *LoadBalancerSpec) DeepCopyInto(out *LoadBalancerSpec) { *out = *in - if in.DateCreated != nil { - in, out := &in.DateCreated, &out.DateCreated - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesObservation. -func (in *NodesObservation) DeepCopy() *NodesObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSpec. +func (in *LoadBalancerSpec) DeepCopy() *LoadBalancerSpec { if in == nil { return nil } - out := new(NodesObservation) + out := new(LoadBalancerSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodesParameters) DeepCopyInto(out *NodesParameters) { +func (in *LoadBalancerStatus) DeepCopyInto(out *LoadBalancerStatus) { *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesParameters. -func (in *NodesParameters) DeepCopy() *NodesParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerStatus. +func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus { if in == nil { return nil } - out := new(NodesParameters) + out := new(LoadBalancerStatus) in.DeepCopyInto(out) return out } @@ -2425,250 +1665,6 @@ func (in *ObjectStorageStatus) DeepCopy() *ObjectStorageStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReadReplicasObservation) DeepCopyInto(out *ReadReplicasObservation) { - *out = *in - if in.ClusterTimeZone != nil { - in, out := &in.ClusterTimeZone, &out.ClusterTimeZone - *out = new(string) - **out = **in - } - if in.DatabaseEngine != nil { - in, out := &in.DatabaseEngine, &out.DatabaseEngine - *out = new(string) - **out = **in - } - if in.DatabaseEngineVersion != nil { - in, out := &in.DatabaseEngineVersion, &out.DatabaseEngineVersion - *out = new(string) - **out = **in - } - if in.DateCreated != nil { - in, out := &in.DateCreated, &out.DateCreated - *out = new(string) - **out = **in - } - if in.Dbname != nil { - in, out := &in.Dbname, &out.Dbname - *out = new(string) - **out = **in - } - if in.Host != nil { - in, out := &in.Host, &out.Host - *out = new(string) - **out = **in - } - if in.ID != nil { - in, out := &in.ID, &out.ID - *out = new(string) - **out = **in - } - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.LatestBackup != nil { - in, out := &in.LatestBackup, &out.LatestBackup - *out = new(string) - **out = **in - } - if in.MaintenanceDow != nil { - in, out := &in.MaintenanceDow, &out.MaintenanceDow - *out = new(string) - **out = **in - } - if in.MaintenanceTime != nil { - in, out := &in.MaintenanceTime, &out.MaintenanceTime - *out = new(string) - **out = **in - } - if in.MySQLLongQueryTime != nil { - in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime - *out = new(float64) - **out = **in - } - if in.MySQLRequirePrimaryKey != nil { - in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey - *out = new(bool) - **out = **in - } - if in.MySQLSQLModes != nil { - in, out := &in.MySQLSQLModes, &out.MySQLSQLModes - *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.MySQLSlowQueryLog != nil { - in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog - *out = new(bool) - **out = **in - } - if in.Password != nil { - in, out := &in.Password, &out.Password - *out = new(string) - **out = **in - } - if in.Plan != nil { - in, out := &in.Plan, &out.Plan - *out = new(string) - **out = **in - } - if in.PlanDisk != nil { - in, out := &in.PlanDisk, &out.PlanDisk - *out = new(float64) - **out = **in - } - if in.PlanRAM != nil { - in, out := &in.PlanRAM, &out.PlanRAM - *out = new(float64) - **out = **in - } - if in.PlanReplicas != nil { - in, out := &in.PlanReplicas, &out.PlanReplicas - *out = new(float64) - **out = **in - } - if in.PlanVcpus != nil { - in, out := &in.PlanVcpus, &out.PlanVcpus - *out = new(float64) - **out = **in - } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(string) - **out = **in - } - if in.RedisEvictionPolicy != nil { - in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Status != nil { - in, out := &in.Status, &out.Status - *out = new(string) - **out = **in - } - if in.Tag != nil { - in, out := &in.Tag, &out.Tag - *out = new(string) - **out = **in - } - if in.TrustedIps != nil { - in, out := &in.TrustedIps, &out.TrustedIps - *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.User != nil { - in, out := &in.User, &out.User - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadReplicasObservation. -func (in *ReadReplicasObservation) DeepCopy() *ReadReplicasObservation { - if in == nil { - return nil - } - out := new(ReadReplicasObservation) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ReadReplicasParameters) DeepCopyInto(out *ReadReplicasParameters) { - *out = *in - if in.Label != nil { - in, out := &in.Label, &out.Label - *out = new(string) - **out = **in - } - if in.MySQLLongQueryTime != nil { - in, out := &in.MySQLLongQueryTime, &out.MySQLLongQueryTime - *out = new(float64) - **out = **in - } - if in.MySQLRequirePrimaryKey != nil { - in, out := &in.MySQLRequirePrimaryKey, &out.MySQLRequirePrimaryKey - *out = new(bool) - **out = **in - } - if in.MySQLSQLModes != nil { - in, out := &in.MySQLSQLModes, &out.MySQLSQLModes - *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.MySQLSlowQueryLog != nil { - in, out := &in.MySQLSlowQueryLog, &out.MySQLSlowQueryLog - *out = new(bool) - **out = **in - } - if in.PlanDisk != nil { - in, out := &in.PlanDisk, &out.PlanDisk - *out = new(float64) - **out = **in - } - if in.RedisEvictionPolicy != nil { - in, out := &in.RedisEvictionPolicy, &out.RedisEvictionPolicy - *out = new(string) - **out = **in - } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) - **out = **in - } - if in.Tag != nil { - in, out := &in.Tag, &out.Tag - *out = new(string) - **out = **in - } - if in.TrustedIps != nil { - in, out := &in.TrustedIps, &out.TrustedIps - *out = make([]*string, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(string) - **out = **in - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadReplicasParameters. -func (in *ReadReplicasParameters) DeepCopy() *ReadReplicasParameters { - if in == nil { - return nil - } - out := new(ReadReplicasParameters) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SSLObservation) DeepCopyInto(out *SSLObservation) { *out = *in diff --git a/apis/vultr/v1alpha1/zz_generated.managed.go b/apis/vultr/v1alpha1/zz_generated.managed.go index 6900863..328dbe9 100644 --- a/apis/vultr/v1alpha1/zz_generated.managed.go +++ b/apis/vultr/v1alpha1/zz_generated.managed.go @@ -83,82 +83,6 @@ func (mg *BareMetalServer) SetWriteConnectionSecretToReference(r *xpv1.SecretRef mg.Spec.WriteConnectionSecretToReference = r } -// GetCondition of this Database. -func (mg *Database) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Database. -func (mg *Database) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicy of this Database. -func (mg *Database) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy -} - -// GetProviderConfigReference of this Database. -func (mg *Database) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -/* -GetProviderReference of this Database. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Database) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - -// GetPublishConnectionDetailsTo of this Database. -func (mg *Database) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Database. -func (mg *Database) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Database. -func (mg *Database) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Database. -func (mg *Database) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicy of this Database. -func (mg *Database) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r -} - -// SetProviderConfigReference of this Database. -func (mg *Database) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -/* -SetProviderReference of this Database. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Database) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - -// SetPublishConnectionDetailsTo of this Database. -func (mg *Database) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Database. -func (mg *Database) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} - // GetCondition of this Instance. func (mg *Instance) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) @@ -235,82 +159,6 @@ func (mg *Instance) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) mg.Spec.WriteConnectionSecretToReference = r } -// GetCondition of this Kubernetes. -func (mg *Kubernetes) GetCondition(ct xpv1.ConditionType) xpv1.Condition { - return mg.Status.GetCondition(ct) -} - -// GetDeletionPolicy of this Kubernetes. -func (mg *Kubernetes) GetDeletionPolicy() xpv1.DeletionPolicy { - return mg.Spec.DeletionPolicy -} - -// GetManagementPolicy of this Kubernetes. -func (mg *Kubernetes) GetManagementPolicy() xpv1.ManagementPolicy { - return mg.Spec.ManagementPolicy -} - -// GetProviderConfigReference of this Kubernetes. -func (mg *Kubernetes) GetProviderConfigReference() *xpv1.Reference { - return mg.Spec.ProviderConfigReference -} - -/* -GetProviderReference of this Kubernetes. -Deprecated: Use GetProviderConfigReference. -*/ -func (mg *Kubernetes) GetProviderReference() *xpv1.Reference { - return mg.Spec.ProviderReference -} - -// GetPublishConnectionDetailsTo of this Kubernetes. -func (mg *Kubernetes) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { - return mg.Spec.PublishConnectionDetailsTo -} - -// GetWriteConnectionSecretToReference of this Kubernetes. -func (mg *Kubernetes) GetWriteConnectionSecretToReference() *xpv1.SecretReference { - return mg.Spec.WriteConnectionSecretToReference -} - -// SetConditions of this Kubernetes. -func (mg *Kubernetes) SetConditions(c ...xpv1.Condition) { - mg.Status.SetConditions(c...) -} - -// SetDeletionPolicy of this Kubernetes. -func (mg *Kubernetes) SetDeletionPolicy(r xpv1.DeletionPolicy) { - mg.Spec.DeletionPolicy = r -} - -// SetManagementPolicy of this Kubernetes. -func (mg *Kubernetes) SetManagementPolicy(r xpv1.ManagementPolicy) { - mg.Spec.ManagementPolicy = r -} - -// SetProviderConfigReference of this Kubernetes. -func (mg *Kubernetes) SetProviderConfigReference(r *xpv1.Reference) { - mg.Spec.ProviderConfigReference = r -} - -/* -SetProviderReference of this Kubernetes. -Deprecated: Use SetProviderConfigReference. -*/ -func (mg *Kubernetes) SetProviderReference(r *xpv1.Reference) { - mg.Spec.ProviderReference = r -} - -// SetPublishConnectionDetailsTo of this Kubernetes. -func (mg *Kubernetes) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { - mg.Spec.PublishConnectionDetailsTo = r -} - -// SetWriteConnectionSecretToReference of this Kubernetes. -func (mg *Kubernetes) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { - mg.Spec.WriteConnectionSecretToReference = r -} - // GetCondition of this LoadBalancer. func (mg *LoadBalancer) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) diff --git a/apis/vultr/v1alpha1/zz_generated.managedlist.go b/apis/vultr/v1alpha1/zz_generated.managedlist.go index cc0398a..3774c3e 100644 --- a/apis/vultr/v1alpha1/zz_generated.managedlist.go +++ b/apis/vultr/v1alpha1/zz_generated.managedlist.go @@ -16,15 +16,6 @@ func (l *BareMetalServerList) GetItems() []resource.Managed { return items } -// GetItems of this DatabaseList. -func (l *DatabaseList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} - // GetItems of this InstanceList. func (l *InstanceList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) @@ -34,15 +25,6 @@ func (l *InstanceList) GetItems() []resource.Managed { return items } -// GetItems of this KubernetesList. -func (l *KubernetesList) GetItems() []resource.Managed { - items := make([]resource.Managed, len(l.Items)) - for i := range l.Items { - items[i] = &l.Items[i] - } - return items -} - // GetItems of this LoadBalancerList. func (l *LoadBalancerList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) diff --git a/apis/vultr/v1alpha1/zz_generated_terraformed.go b/apis/vultr/v1alpha1/zz_generated_terraformed.go index b5b6a8c..7d693b6 100755 --- a/apis/vultr/v1alpha1/zz_generated_terraformed.go +++ b/apis/vultr/v1alpha1/zz_generated_terraformed.go @@ -87,80 +87,6 @@ func (tr *BareMetalServer) GetTerraformSchemaVersion() int { return 0 } -// GetTerraformResourceType returns Terraform resource type for this Database -func (mg *Database) GetTerraformResourceType() string { - return "vultr_database" -} - -// GetConnectionDetailsMapping for this Database -func (tr *Database) GetConnectionDetailsMapping() map[string]string { - return nil -} - -// GetObservation of this Database -func (tr *Database) 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 Database -func (tr *Database) 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 Database -func (tr *Database) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Database -func (tr *Database) 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 Database -func (tr *Database) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) -} - -// LateInitialize this Database using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Database) LateInitialize(attrs []byte) (bool, error) { - params := &DatabaseParameters{} - 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 *Database) GetTerraformSchemaVersion() int { - return 0 -} - // GetTerraformResourceType returns Terraform resource type for this Instance func (mg *Instance) GetTerraformResourceType() string { return "vultr_instance" @@ -235,80 +161,6 @@ func (tr *Instance) GetTerraformSchemaVersion() int { return 0 } -// GetTerraformResourceType returns Terraform resource type for this Kubernetes -func (mg *Kubernetes) GetTerraformResourceType() string { - return "vultr_kubernetes" -} - -// GetConnectionDetailsMapping for this Kubernetes -func (tr *Kubernetes) GetConnectionDetailsMapping() map[string]string { - return map[string]string{"client_certificate": "status.atProvider.clientCertificate", "client_key": "status.atProvider.clientKey", "cluster_ca_certificate": "status.atProvider.clusterCaCertificate", "kube_config": "status.atProvider.kubeConfig"} -} - -// GetObservation of this Kubernetes -func (tr *Kubernetes) 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 Kubernetes -func (tr *Kubernetes) 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 Kubernetes -func (tr *Kubernetes) GetID() string { - if tr.Status.AtProvider.ID == nil { - return "" - } - return *tr.Status.AtProvider.ID -} - -// GetParameters of this Kubernetes -func (tr *Kubernetes) 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 Kubernetes -func (tr *Kubernetes) SetParameters(params map[string]any) error { - p, err := json.TFParser.Marshal(params) - if err != nil { - return err - } - return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) -} - -// LateInitialize this Kubernetes using its observed tfState. -// returns True if there are any spec changes for the resource. -func (tr *Kubernetes) LateInitialize(attrs []byte) (bool, error) { - params := &KubernetesParameters{} - 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 *Kubernetes) GetTerraformSchemaVersion() int { - return 0 -} - // GetTerraformResourceType returns Terraform resource type for this LoadBalancer func (mg *LoadBalancer) GetTerraformResourceType() string { return "vultr_load_balancer" diff --git a/config/database/config.go b/config/database/config.go index 45e867a..244a1b8 100644 --- a/config/database/config.go +++ b/config/database/config.go @@ -4,7 +4,9 @@ import "github.com/upbound/upjet/pkg/config" func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_database", func(r *config.Resource) { + r.ShortGroup = "database" }) + p.AddResourceConfigurator("vultr_database_connection_pool", func(r *config.Resource) { }) p.AddResourceConfigurator("vultr_database_db", func(r *config.Resource) { diff --git a/config/groups.go b/config/groups.go index 3bc6887..90bf9e4 100644 --- a/config/groups.go +++ b/config/groups.go @@ -37,8 +37,7 @@ func ReplaceGroupWords(group string, count int) GroupKindCalculator { } -var GroupMap = map[string]GroupKindCalculator{ - //"aws_alb_listener_certificate": ReplaceGroupWords("elbv2", 0), +var GroupMap = map[string]GroupKindCalculator{ "vultr_load_balancer": ReplaceGroupWords("vultr", 0), "vultr_bare_metal_server": ReplaceGroupWords("vultr", 0), "vultr_object_storage": ReplaceGroupWords("vultr", 0), diff --git a/config/kubernetes/config.go b/config/kubernetes/config.go index 35c5bf8..ac6eb59 100644 --- a/config/kubernetes/config.go +++ b/config/kubernetes/config.go @@ -4,6 +4,7 @@ import "github.com/upbound/upjet/pkg/config" func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_kubernetes", func(r *config.Resource) { + r.ShortGroup = "kubernetes" }) p.AddResourceConfigurator("vultr_kubernetes_node_pools", func(r *config.Resource) { diff --git a/examples-generated/vultr/database.yaml b/examples-generated/database/database.yaml similarity index 72% rename from examples-generated/vultr/database.yaml rename to examples-generated/database/database.yaml index 9048131..f6a9bf9 100644 --- a/examples-generated/vultr/database.yaml +++ b/examples-generated/database/database.yaml @@ -1,8 +1,8 @@ -apiVersion: vultr.vultr.upbound.io/v1alpha1 +apiVersion: database.vultr.upbound.io/v1alpha1 kind: Database metadata: annotations: - meta.upbound.io/example-id: vultr/v1alpha1/database + meta.upbound.io/example-id: database/v1alpha1/database labels: testing.upbound.io/example-name: my_database name: my-database diff --git a/examples-generated/vultr/kubernetes.yaml b/examples-generated/kubernetes/kubernetes.yaml similarity index 74% rename from examples-generated/vultr/kubernetes.yaml rename to examples-generated/kubernetes/kubernetes.yaml index b4e6a4b..298608b 100644 --- a/examples-generated/vultr/kubernetes.yaml +++ b/examples-generated/kubernetes/kubernetes.yaml @@ -1,8 +1,8 @@ -apiVersion: vultr.vultr.upbound.io/v1alpha1 +apiVersion: kubernetes.vultr.upbound.io/v1alpha1 kind: Kubernetes metadata: annotations: - meta.upbound.io/example-id: vultr/v1alpha1/kubernetes + meta.upbound.io/example-id: kubernetes/v1alpha1/kubernetes labels: testing.upbound.io/example-name: k8 name: k8 diff --git a/internal/controller/vultr/database/zz_controller.go b/internal/controller/database/database/zz_controller.go similarity index 96% rename from internal/controller/vultr/database/zz_controller.go rename to internal/controller/database/database/zz_controller.go index 829ea45..b3bf430 100755 --- a/internal/controller/vultr/database/zz_controller.go +++ b/internal/controller/database/database/zz_controller.go @@ -18,7 +18,7 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/database/v1alpha1" features "github.com/crossplane-contrib/provider-vultr/internal/features" ) diff --git a/internal/controller/vultr/kubernetes/zz_controller.go b/internal/controller/kubernetes/kubernetes/zz_controller.go similarity index 96% rename from internal/controller/vultr/kubernetes/zz_controller.go rename to internal/controller/kubernetes/kubernetes/zz_controller.go index f9e631f..8005d24 100755 --- a/internal/controller/vultr/kubernetes/zz_controller.go +++ b/internal/controller/kubernetes/kubernetes/zz_controller.go @@ -18,7 +18,7 @@ import ( "github.com/upbound/upjet/pkg/terraform" ctrl "sigs.k8s.io/controller-runtime" - v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/vultr/v1alpha1" + v1alpha1 "github.com/crossplane-contrib/provider-vultr/apis/kubernetes/v1alpha1" features "github.com/crossplane-contrib/provider-vultr/internal/features" ) diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index fcc4b68..6f6cd7e 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -11,15 +11,15 @@ import ( storage "github.com/crossplane-contrib/provider-vultr/internal/controller/block/storage" connectionpool "github.com/crossplane-contrib/provider-vultr/internal/controller/database/connectionpool" + database "github.com/crossplane-contrib/provider-vultr/internal/controller/database/database" db "github.com/crossplane-contrib/provider-vultr/internal/controller/database/db" replica "github.com/crossplane-contrib/provider-vultr/internal/controller/database/replica" user "github.com/crossplane-contrib/provider-vultr/internal/controller/database/user" + kubernetes "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/kubernetes" nodepools "github.com/crossplane-contrib/provider-vultr/internal/controller/kubernetes/nodepools" providerconfig "github.com/crossplane-contrib/provider-vultr/internal/controller/providerconfig" baremetalserver "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/baremetalserver" - database "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/database" instance "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/instance" - kubernetes "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/kubernetes" loadbalancer "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/loadbalancer" objectstorage "github.com/crossplane-contrib/provider-vultr/internal/controller/vultr/objectstorage" ) @@ -30,15 +30,15 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { for _, setup := range []func(ctrl.Manager, controller.Options) error{ storage.Setup, connectionpool.Setup, + database.Setup, db.Setup, replica.Setup, user.Setup, + kubernetes.Setup, nodepools.Setup, providerconfig.Setup, baremetalserver.Setup, - database.Setup, instance.Setup, - kubernetes.Setup, loadbalancer.Setup, objectstorage.Setup, } { diff --git a/package/crds/vultr.vultr.upbound.io_databases.yaml b/package/crds/database.vultr.upbound.io_databases.yaml similarity index 99% rename from package/crds/vultr.vultr.upbound.io_databases.yaml rename to package/crds/database.vultr.upbound.io_databases.yaml index c8364d0..7f7d3de 100644 --- a/package/crds/vultr.vultr.upbound.io_databases.yaml +++ b/package/crds/database.vultr.upbound.io_databases.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: databases.vultr.vultr.upbound.io + name: databases.database.vultr.upbound.io spec: - group: vultr.vultr.upbound.io + group: database.vultr.upbound.io names: categories: - crossplane diff --git a/package/crds/vultr.vultr.upbound.io_kubernetes.yaml b/package/crds/kubernetes.vultr.upbound.io_kubernetes.yaml similarity index 99% rename from package/crds/vultr.vultr.upbound.io_kubernetes.yaml rename to package/crds/kubernetes.vultr.upbound.io_kubernetes.yaml index e871b2b..697edfa 100644 --- a/package/crds/vultr.vultr.upbound.io_kubernetes.yaml +++ b/package/crds/kubernetes.vultr.upbound.io_kubernetes.yaml @@ -5,9 +5,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.11.3 creationTimestamp: null - name: kubernetes.vultr.vultr.upbound.io + name: kubernetes.kubernetes.vultr.upbound.io spec: - group: vultr.vultr.upbound.io + group: kubernetes.vultr.upbound.io names: categories: - crossplane From cff15ecaea7ea4d4654c6455b4e8a146f181f027 Mon Sep 17 00:00:00 2001 From: cmondragon Date: Thu, 21 Sep 2023 08:48:02 -0400 Subject: [PATCH 12/13] format code --- config/baremetal/config.go | 3 +-- config/database/config.go | 4 ++-- config/external_name.go | 26 +++++++++++++------------- config/groups.go | 21 ++++++++------------- config/loadbalancer/config.go | 1 - config/provider.go | 9 ++------- 6 files changed, 26 insertions(+), 38 deletions(-) diff --git a/config/baremetal/config.go b/config/baremetal/config.go index 9dc9bdf..c8c7b38 100644 --- a/config/baremetal/config.go +++ b/config/baremetal/config.go @@ -4,6 +4,5 @@ import "github.com/upbound/upjet/pkg/config" func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_bare_metal_server", func(r *config.Resource) { - //r.ShortGroup = "baremetal" }) -} \ No newline at end of file +} diff --git a/config/database/config.go b/config/database/config.go index 244a1b8..b62ae25 100644 --- a/config/database/config.go +++ b/config/database/config.go @@ -6,7 +6,7 @@ func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_database", func(r *config.Resource) { r.ShortGroup = "database" }) - + p.AddResourceConfigurator("vultr_database_connection_pool", func(r *config.Resource) { }) p.AddResourceConfigurator("vultr_database_db", func(r *config.Resource) { @@ -15,4 +15,4 @@ func Configure(p *config.Provider) { }) p.AddResourceConfigurator("vultr_database_user", func(r *config.Resource) { }) -} \ No newline at end of file +} diff --git a/config/external_name.go b/config/external_name.go index 0de33c6..1c4ec3f 100644 --- a/config/external_name.go +++ b/config/external_name.go @@ -10,19 +10,19 @@ import "github.com/upbound/upjet/pkg/config" // provider. var ExternalNameConfigs = map[string]config.ExternalName{ // Import requires using a randomly generated ID from provider: nl-2e21sda - "null_resource": config.IdentifierFromProvider, - "vultr_kubernetes": config.IdentifierFromProvider, - "vultr_kubernetes_node_pools": config.IdentifierFromProvider, - "vultr_object_storage": config.IdentifierFromProvider, - "vultr_instance": config.IdentifierFromProvider, - "vultr_load_balancer": config.IdentifierFromProvider, - "vultr_database": config.IdentifierFromProvider, - "vultr_database_connection_pool": config.IdentifierFromProvider, - "vultr_database_db": config.IdentifierFromProvider, - "vultr_database_replica": config.IdentifierFromProvider, - "vultr_database_user": config.IdentifierFromProvider, - "vultr_bare_metal_server": config.IdentifierFromProvider, - "vultr_block_storage": config.IdentifierFromProvider, + "null_resource": config.IdentifierFromProvider, + "vultr_kubernetes": config.IdentifierFromProvider, + "vultr_kubernetes_node_pools": config.IdentifierFromProvider, + "vultr_object_storage": config.IdentifierFromProvider, + "vultr_instance": config.IdentifierFromProvider, + "vultr_load_balancer": config.IdentifierFromProvider, + "vultr_database": config.IdentifierFromProvider, + "vultr_database_connection_pool": config.IdentifierFromProvider, + "vultr_database_db": config.IdentifierFromProvider, + "vultr_database_replica": config.IdentifierFromProvider, + "vultr_database_user": config.IdentifierFromProvider, + "vultr_bare_metal_server": config.IdentifierFromProvider, + "vultr_block_storage": config.IdentifierFromProvider, } // ExternalNameConfigurations applies all external name configs listed in the diff --git a/config/groups.go b/config/groups.go index 90bf9e4..a760a82 100644 --- a/config/groups.go +++ b/config/groups.go @@ -21,7 +21,6 @@ func GroupKindOverrides() config.ResourceOption { } } - // GroupKindCalculator returns the correct group and kind name for given TF // resource. type GroupKindCalculator func(resource string) (string, string) @@ -36,19 +35,15 @@ func ReplaceGroupWords(group string, count int) GroupKindCalculator { } } - -var GroupMap = map[string]GroupKindCalculator{ - "vultr_load_balancer": ReplaceGroupWords("vultr", 0), - "vultr_bare_metal_server": ReplaceGroupWords("vultr", 0), - "vultr_object_storage": ReplaceGroupWords("vultr", 0), - - +var GroupMap = map[string]GroupKindCalculator{ + "vultr_load_balancer": ReplaceGroupWords("vultr", 0), + "vultr_bare_metal_server": ReplaceGroupWords("vultr", 0), + "vultr_object_storage": ReplaceGroupWords("vultr", 0), } // KindMap contains kind string overrides. var KindMap = map[string]string{ - "vultr_load_balancer": "loadbalancer", - "vultr_bare_metal_server": "baremetal", - "vultr_object_storage": "object", - -} \ No newline at end of file + "vultr_load_balancer": "loadbalancer", + "vultr_bare_metal_server": "baremetal", + "vultr_object_storage": "object", +} diff --git a/config/loadbalancer/config.go b/config/loadbalancer/config.go index a11d354..bdb7d87 100644 --- a/config/loadbalancer/config.go +++ b/config/loadbalancer/config.go @@ -4,6 +4,5 @@ import "github.com/upbound/upjet/pkg/config" func Configure(p *config.Provider) { p.AddResourceConfigurator("vultr_load_balancer", func(r *config.Resource) { - //r.ShortGroup = "loadbalancer" }) } diff --git a/config/provider.go b/config/provider.go index 1c54bc6..a3e2301 100644 --- a/config/provider.go +++ b/config/provider.go @@ -30,19 +30,16 @@ var providerSchema string //go:embed provider-metadata.yaml var providerMetadata string - // GetProvider returns provider configuration func GetProvider() *ujconfig.Provider { pc := ujconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), - //ujconfig.WithShortName("vultr"), - //ujconfig.WithRootGroup("vultr.upbound.io"), + //ujconfig.WithShortName("vultr"), + //ujconfig.WithRootGroup("vultr.upbound.io"), ujconfig.WithIncludeList(ExternalNameConfigured()), ujconfig.WithFeaturesPackage("internal/features"), ujconfig.WithDefaultResourceOptions( ExternalNameConfigurations(), GroupKindOverrides(), - - )) for _, configure := range []func(provider *ujconfig.Provider){ @@ -53,8 +50,6 @@ func GetProvider() *ujconfig.Provider { database.Configure, baremetal.Configure, block.Configure, - - } { configure(pc) } From 9c8ece1d0ec0c98834cce7c8c7ab0410c572c21b Mon Sep 17 00:00:00 2001 From: cmondragon Date: Thu, 21 Sep 2023 09:29:14 -0400 Subject: [PATCH 13/13] bump golangci-lint --- .golangci.yml | 1 - Makefile | 2 +- config/provider.go | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1ae4aa4..c0e5d7a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -112,7 +112,6 @@ linters: - goimports - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - revive - unconvert - misspell - nakedret diff --git a/Makefile b/Makefile index 7a33c50..5f18a54 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ NPROCS ?= 1 GO_TEST_PARALLEL := $(shell echo $$(( $(NPROCS) / 2 ))) GO_REQUIRED_VERSION ?= 1.20 -GOLANGCILINT_VERSION ?= 1.50.0 +GOLANGCILINT_VERSION ?= 1.54.2 GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider $(GO_PROJECT)/cmd/generator GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.Version=$(VERSION) GO_SUBDIRS += cmd internal apis diff --git a/config/provider.go b/config/provider.go index a3e2301..616b8c2 100644 --- a/config/provider.go +++ b/config/provider.go @@ -33,8 +33,6 @@ var providerMetadata string // GetProvider returns provider configuration func GetProvider() *ujconfig.Provider { pc := ujconfig.NewProvider([]byte(providerSchema), resourcePrefix, modulePath, []byte(providerMetadata), - //ujconfig.WithShortName("vultr"), - //ujconfig.WithRootGroup("vultr.upbound.io"), ujconfig.WithIncludeList(ExternalNameConfigured()), ujconfig.WithFeaturesPackage("internal/features"), ujconfig.WithDefaultResourceOptions(