From 5f730ff3714952d7658243aa6006084ae3981595 Mon Sep 17 00:00:00 2001 From: Tarun Chinmai Sekar Date: Thu, 10 Apr 2025 14:33:45 -0700 Subject: [PATCH 1/2] use fork --- go.mod | 5 ++++- go.sum | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4534077..ee2d3fb 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,10 @@ go 1.23.0 toolchain go1.24.2 -replace github.com/crossplane/crossplane-runtime => github.com/guilhem/crossplane-runtime v1.16.1-0.20250116161626-a92ea4102aa4 +replace ( + github.com/crossplane/crossplane-runtime => github.com/guilhem/crossplane-runtime v1.16.1-0.20250116161626-a92ea4102aa4 + github.com/linode/terraform-provider-linode/v2 => github.com/tchinmai7/terraform-provider-linode/v2 v2.37.1-0.20250410211733-1b24dfd5b938 +) require ( dario.cat/mergo v1.0.0 diff --git a/go.sum b/go.sum index bbcba54..b7d5546 100644 --- a/go.sum +++ b/go.sum @@ -238,8 +238,6 @@ github.com/linode/linodego v1.49.0 h1:MNd3qwvQzbXB5mCpvdCqlUIu1RPA9oC+50LyB9kK+G github.com/linode/linodego v1.49.0/go.mod h1:B+HAM3//4w1wOS0BwdaQBKwBxlfe6kYJ7bSC6jJ/xtc= github.com/linode/linodego/k8s v1.25.2 h1:PY6S0sAD3xANVvM9WY38bz9GqMTjIbytC8IJJ9Cv23o= github.com/linode/linodego/k8s v1.25.2/go.mod h1:DC1XCSRZRGsmaa/ggpDPSDUmOM6aK1bhSIP6+f9Cwhc= -github.com/linode/terraform-provider-linode/v2 v2.37.0 h1:mVADbhJ9s9fGfQJFXEeVheTjg64Se0waZ78Qu8A09as= -github.com/linode/terraform-provider-linode/v2 v2.37.0/go.mod h1:Th2/ECI4q9Ivq3OeQXR0Wui1E5JEPcZNGZRbxNb0GPE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -321,6 +319,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/tchinmai7/terraform-provider-linode/v2 v2.37.1-0.20250410211733-1b24dfd5b938 h1:CbRKtIBHeYc9a6Ko1lxRLtUi/F9XCHcSZR8C1xA/xBI= +github.com/tchinmai7/terraform-provider-linode/v2 v2.37.1-0.20250410211733-1b24dfd5b938/go.mod h1:Th2/ECI4q9Ivq3OeQXR0Wui1E5JEPcZNGZRbxNb0GPE= github.com/tmccombs/hcl2json v0.3.3 h1:+DLNYqpWE0CsOQiEZu+OZm5ZBImake3wtITYxQ8uLFQ= github.com/tmccombs/hcl2json v0.3.3/go.mod h1:Y2chtz2x9bAeRTvSibVRVgbLJhLJXKlUeIvjeVdnm4w= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= From 4fd85a219e142f224dc867a43ff3c06151da7659 Mon Sep 17 00:00:00 2001 From: Tarun Chinmai Sekar Date: Thu, 10 Apr 2025 15:39:52 -0700 Subject: [PATCH 2/2] Add all new resources + use fork --- .../v1alpha1/zz_generated.conversion_hubs.go | 6 + .../v1alpha1/zz_generated.deepcopy.go | 1226 +++++++++++++++-- .../database/v1alpha1/zz_generated.managed.go | 120 ++ .../v1alpha1/zz_generated.managedlist.go | 18 + .../v1alpha1/zz_mysqlv2_terraformed.go | 129 ++ apis/database/v1alpha1/zz_mysqlv2_types.go | 294 ++++ .../v1alpha1/zz_postgresqlv2_terraformed.go | 129 ++ .../v1alpha1/zz_postgresqlv2_types.go | 294 ++++ .../v1alpha1/zz_generated.conversion_hubs.go | 10 + .../v1alpha1/zz_generated.deepcopy.go | 285 ++++ .../v1alpha1/zz_generated.managed.go | 68 + .../v1alpha1/zz_generated.managedlist.go | 17 + .../v1alpha1/zz_generated.resolvers.go | 56 + .../v1alpha1/zz_groupversion_info.go | 32 + apis/networking/v1alpha1/zz_ip_terraformed.go | 129 ++ apis/networking/v1alpha1/zz_ip_types.go | 194 +++ .../v1alpha1/zz_generated.conversion_hubs.go | 10 + .../v1alpha1/zz_generated.deepcopy.go | 370 +++++ .../reserved/v1alpha1/zz_generated.managed.go | 68 + .../v1alpha1/zz_generated.managedlist.go | 17 + .../v1alpha1/zz_generated.resolvers.go | 89 ++ .../reserved/v1alpha1/zz_groupversion_info.go | 32 + .../v1alpha1/zz_ipassignment_terraformed.go | 129 ++ .../v1alpha1/zz_ipassignment_types.go | 208 +++ apis/zz_register.go | 4 + config/databasemysql/config.go | 10 +- config/databasepostgresql/config.go | 10 +- config/externalname.go | 4 + config/instancereservedipassignment/config.go | 19 + config/networkingip/config.go | 22 + config/provider.go | 4 + .../database/v1alpha1/mysqlv2.yaml | 14 + .../database/v1alpha1/postgresqlv2.yaml | 14 + .../networking/v1alpha1/ip.yaml | 15 + .../database/mysqlv2/zz_controller.go | 91 ++ .../database/postgresqlv2/zz_controller.go | 91 ++ .../controller/networking/ip/zz_controller.go | 91 ++ .../reserved/ipassignment/zz_controller.go | 91 ++ internal/controller/zz_setup.go | 8 + .../database.linode.upbound.io_mysqlv2s.yaml | 590 ++++++++ ...abase.linode.upbound.io_postgresqlv2s.yaml | 590 ++++++++ .../networking.linode.upbound.io_ips.yaml | 582 ++++++++ ...erved.linode.upbound.io_ipassignments.yaml | 712 ++++++++++ 43 files changed, 6738 insertions(+), 154 deletions(-) create mode 100755 apis/database/v1alpha1/zz_mysqlv2_terraformed.go create mode 100755 apis/database/v1alpha1/zz_mysqlv2_types.go create mode 100755 apis/database/v1alpha1/zz_postgresqlv2_terraformed.go create mode 100755 apis/database/v1alpha1/zz_postgresqlv2_types.go create mode 100755 apis/networking/v1alpha1/zz_generated.conversion_hubs.go create mode 100644 apis/networking/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/networking/v1alpha1/zz_generated.managed.go create mode 100644 apis/networking/v1alpha1/zz_generated.managedlist.go create mode 100644 apis/networking/v1alpha1/zz_generated.resolvers.go create mode 100755 apis/networking/v1alpha1/zz_groupversion_info.go create mode 100755 apis/networking/v1alpha1/zz_ip_terraformed.go create mode 100755 apis/networking/v1alpha1/zz_ip_types.go create mode 100755 apis/reserved/v1alpha1/zz_generated.conversion_hubs.go create mode 100644 apis/reserved/v1alpha1/zz_generated.deepcopy.go create mode 100644 apis/reserved/v1alpha1/zz_generated.managed.go create mode 100644 apis/reserved/v1alpha1/zz_generated.managedlist.go create mode 100644 apis/reserved/v1alpha1/zz_generated.resolvers.go create mode 100755 apis/reserved/v1alpha1/zz_groupversion_info.go create mode 100755 apis/reserved/v1alpha1/zz_ipassignment_terraformed.go create mode 100755 apis/reserved/v1alpha1/zz_ipassignment_types.go create mode 100644 config/instancereservedipassignment/config.go create mode 100644 config/networkingip/config.go create mode 100644 examples-generated/database/v1alpha1/mysqlv2.yaml create mode 100644 examples-generated/database/v1alpha1/postgresqlv2.yaml create mode 100644 examples-generated/networking/v1alpha1/ip.yaml create mode 100755 internal/controller/database/mysqlv2/zz_controller.go create mode 100755 internal/controller/database/postgresqlv2/zz_controller.go create mode 100755 internal/controller/networking/ip/zz_controller.go create mode 100755 internal/controller/reserved/ipassignment/zz_controller.go create mode 100644 package/crds/database.linode.upbound.io_mysqlv2s.yaml create mode 100644 package/crds/database.linode.upbound.io_postgresqlv2s.yaml create mode 100644 package/crds/networking.linode.upbound.io_ips.yaml create mode 100644 package/crds/reserved.linode.upbound.io_ipassignments.yaml diff --git a/apis/database/v1alpha1/zz_generated.conversion_hubs.go b/apis/database/v1alpha1/zz_generated.conversion_hubs.go index a185a4b..fc6b7f2 100755 --- a/apis/database/v1alpha1/zz_generated.conversion_hubs.go +++ b/apis/database/v1alpha1/zz_generated.conversion_hubs.go @@ -12,5 +12,11 @@ func (tr *AccessControls) Hub() {} // Hub marks this type as a conversion hub. func (tr *MySQL) Hub() {} +// Hub marks this type as a conversion hub. +func (tr *MySQLv2) Hub() {} + // Hub marks this type as a conversion hub. func (tr *PostgreSQL) Hub() {} + +// Hub marks this type as a conversion hub. +func (tr *PostgreSQLv2) Hub() {} diff --git a/apis/database/v1alpha1/zz_generated.deepcopy.go b/apis/database/v1alpha1/zz_generated.deepcopy.go index e050b7d..28969a0 100644 --- a/apis/database/v1alpha1/zz_generated.deepcopy.go +++ b/apis/database/v1alpha1/zz_generated.deepcopy.go @@ -573,7 +573,7 @@ func (in *MySQLStatus) DeepCopy() *MySQLStatus { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQL) DeepCopyInto(out *PostgreSQL) { +func (in *MySQLv2) DeepCopyInto(out *MySQLv2) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -581,18 +581,18 @@ func (in *PostgreSQL) DeepCopyInto(out *PostgreSQL) { in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQL. -func (in *PostgreSQL) DeepCopy() *PostgreSQL { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2. +func (in *MySQLv2) DeepCopy() *MySQLv2 { if in == nil { return nil } - out := new(PostgreSQL) + out := new(MySQLv2) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PostgreSQL) DeepCopyObject() runtime.Object { +func (in *MySQLv2) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -600,7 +600,7 @@ func (in *PostgreSQL) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLInitParameters) DeepCopyInto(out *PostgreSQLInitParameters) { +func (in *MySQLv2InitParameters) DeepCopyInto(out *MySQLv2InitParameters) { *out = *in if in.AllowList != nil { in, out := &in.AllowList, &out.AllowList @@ -618,38 +618,33 @@ func (in *PostgreSQLInitParameters) DeepCopyInto(out *PostgreSQLInitParameters) *out = new(float64) **out = **in } - if in.Encrypted != nil { - in, out := &in.Encrypted, &out.Encrypted - *out = new(bool) - **out = **in - } if in.EngineID != nil { in, out := &in.EngineID, &out.EngineID *out = new(string) **out = **in } - if in.Label != nil { - in, out := &in.Label, &out.Label + if in.ForkRestoreTime != nil { + in, out := &in.ForkRestoreTime, &out.ForkRestoreTime *out = new(string) **out = **in } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) + if in.ForkSource != nil { + in, out := &in.ForkSource, &out.ForkSource + *out = new(float64) **out = **in } - if in.ReplicationCommitType != nil { - in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + if in.Label != nil { + in, out := &in.Label, &out.Label *out = new(string) **out = **in } - if in.ReplicationType != nil { - in, out := &in.ReplicationType, &out.ReplicationType + if in.Region != nil { + in, out := &in.Region, &out.Region *out = new(string) **out = **in } - if in.SSLConnection != nil { - in, out := &in.SSLConnection, &out.SSLConnection + if in.Suspended != nil { + in, out := &in.Suspended, &out.Suspended *out = new(bool) **out = **in } @@ -660,49 +655,49 @@ func (in *PostgreSQLInitParameters) DeepCopyInto(out *PostgreSQLInitParameters) } if in.Updates != nil { in, out := &in.Updates, &out.Updates - *out = make([]PostgreSQLUpdatesInitParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLInitParameters. -func (in *PostgreSQLInitParameters) DeepCopy() *PostgreSQLInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2InitParameters. +func (in *MySQLv2InitParameters) DeepCopy() *MySQLv2InitParameters { if in == nil { return nil } - out := new(PostgreSQLInitParameters) + out := new(MySQLv2InitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLList) DeepCopyInto(out *PostgreSQLList) { +func (in *MySQLv2List) DeepCopyInto(out *MySQLv2List) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]PostgreSQL, len(*in)) + *out = make([]MySQLv2, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLList. -func (in *PostgreSQLList) DeepCopy() *PostgreSQLList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2List. +func (in *MySQLv2List) DeepCopy() *MySQLv2List { if in == nil { return nil } - out := new(PostgreSQLList) + out := new(MySQLv2List) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PostgreSQLList) DeepCopyObject() runtime.Object { +func (in *MySQLv2List) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -710,7 +705,7 @@ func (in *PostgreSQLList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { +func (in *MySQLv2Observation) DeepCopyInto(out *MySQLv2Observation) { *out = *in if in.AllowList != nil { in, out := &in.AllowList, &out.AllowList @@ -748,6 +743,16 @@ func (in *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { *out = new(string) **out = **in } + if in.ForkRestoreTime != nil { + in, out := &in.ForkRestoreTime, &out.ForkRestoreTime + *out = new(string) + **out = **in + } + if in.ForkSource != nil { + in, out := &in.ForkSource, &out.ForkSource + *out = new(float64) + **out = **in + } if in.HostPrimary != nil { in, out := &in.HostPrimary, &out.HostPrimary *out = new(string) @@ -768,23 +773,46 @@ func (in *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { *out = new(string) **out = **in } - if in.Port != nil { - in, out := &in.Port, &out.Port - *out = new(float64) - **out = **in + if in.Members != nil { + in, out := &in.Members, &out.Members + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } } - if in.Region != nil { - in, out := &in.Region, &out.Region + if in.OldestRestoreTime != nil { + in, out := &in.OldestRestoreTime, &out.OldestRestoreTime *out = new(string) **out = **in } - if in.ReplicationCommitType != nil { - in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + if in.PendingUpdates != nil { + in, out := &in.PendingUpdates, &out.PendingUpdates + *out = make([]PendingUpdatesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Platform != nil { + in, out := &in.Platform, &out.Platform *out = new(string) **out = **in } - if in.ReplicationType != nil { - in, out := &in.ReplicationType, &out.ReplicationType + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region *out = new(string) **out = **in } @@ -798,6 +826,11 @@ func (in *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { *out = new(string) **out = **in } + if in.Suspended != nil { + in, out := &in.Suspended, &out.Suspended + *out = new(bool) + **out = **in + } if in.Type != nil { in, out := &in.Type, &out.Type *out = new(string) @@ -810,9 +843,9 @@ func (in *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { } if in.Updates != nil { in, out := &in.Updates, &out.Updates - *out = make([]PostgreSQLUpdatesObservation, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val } } if in.Version != nil { @@ -822,18 +855,18 @@ func (in *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLObservation. -func (in *PostgreSQLObservation) DeepCopy() *PostgreSQLObservation { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2Observation. +func (in *MySQLv2Observation) DeepCopy() *MySQLv2Observation { if in == nil { return nil } - out := new(PostgreSQLObservation) + out := new(MySQLv2Observation) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLParameters) DeepCopyInto(out *PostgreSQLParameters) { +func (in *MySQLv2Parameters) DeepCopyInto(out *MySQLv2Parameters) { *out = *in if in.AllowList != nil { in, out := &in.AllowList, &out.AllowList @@ -851,38 +884,33 @@ func (in *PostgreSQLParameters) DeepCopyInto(out *PostgreSQLParameters) { *out = new(float64) **out = **in } - if in.Encrypted != nil { - in, out := &in.Encrypted, &out.Encrypted - *out = new(bool) - **out = **in - } if in.EngineID != nil { in, out := &in.EngineID, &out.EngineID *out = new(string) **out = **in } - if in.Label != nil { - in, out := &in.Label, &out.Label + if in.ForkRestoreTime != nil { + in, out := &in.ForkRestoreTime, &out.ForkRestoreTime *out = new(string) **out = **in } - if in.Region != nil { - in, out := &in.Region, &out.Region - *out = new(string) + if in.ForkSource != nil { + in, out := &in.ForkSource, &out.ForkSource + *out = new(float64) **out = **in } - if in.ReplicationCommitType != nil { - in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + if in.Label != nil { + in, out := &in.Label, &out.Label *out = new(string) **out = **in } - if in.ReplicationType != nil { - in, out := &in.ReplicationType, &out.ReplicationType + if in.Region != nil { + in, out := &in.Region, &out.Region *out = new(string) **out = **in } - if in.SSLConnection != nil { - in, out := &in.SSLConnection, &out.SSLConnection + if in.Suspended != nil { + in, out := &in.Suspended, &out.Suspended *out = new(bool) **out = **in } @@ -893,174 +921,1068 @@ func (in *PostgreSQLParameters) DeepCopyInto(out *PostgreSQLParameters) { } if in.Updates != nil { in, out := &in.Updates, &out.Updates - *out = make([]PostgreSQLUpdatesParameters, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLParameters. -func (in *PostgreSQLParameters) DeepCopy() *PostgreSQLParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2Parameters. +func (in *MySQLv2Parameters) DeepCopy() *MySQLv2Parameters { if in == nil { return nil } - out := new(PostgreSQLParameters) + out := new(MySQLv2Parameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLSpec) DeepCopyInto(out *PostgreSQLSpec) { +func (in *MySQLv2Spec) DeepCopyInto(out *MySQLv2Spec) { *out = *in in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) in.ForProvider.DeepCopyInto(&out.ForProvider) in.InitProvider.DeepCopyInto(&out.InitProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLSpec. -func (in *PostgreSQLSpec) DeepCopy() *PostgreSQLSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2Spec. +func (in *MySQLv2Spec) DeepCopy() *MySQLv2Spec { if in == nil { return nil } - out := new(PostgreSQLSpec) + out := new(MySQLv2Spec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLStatus) DeepCopyInto(out *PostgreSQLStatus) { +func (in *MySQLv2Status) DeepCopyInto(out *MySQLv2Status) { *out = *in in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) in.AtProvider.DeepCopyInto(&out.AtProvider) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLStatus. -func (in *PostgreSQLStatus) DeepCopy() *PostgreSQLStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLv2Status. +func (in *MySQLv2Status) DeepCopy() *MySQLv2Status { if in == nil { return nil } - out := new(PostgreSQLStatus) + out := new(MySQLv2Status) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLUpdatesInitParameters) DeepCopyInto(out *PostgreSQLUpdatesInitParameters) { +func (in *PendingUpdatesInitParameters) DeepCopyInto(out *PendingUpdatesInitParameters) { *out = *in - if in.DayOfWeek != nil { - in, out := &in.DayOfWeek, &out.DayOfWeek - *out = new(string) - **out = **in - } - if in.Duration != nil { - in, out := &in.Duration, &out.Duration - *out = new(float64) - **out = **in - } - if in.Frequency != nil { - in, out := &in.Frequency, &out.Frequency - *out = new(string) - **out = **in - } - if in.HourOfDay != nil { - in, out := &in.HourOfDay, &out.HourOfDay - *out = new(float64) - **out = **in - } - if in.WeekOfMonth != nil { - in, out := &in.WeekOfMonth, &out.WeekOfMonth - *out = new(float64) - **out = **in - } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesInitParameters. -func (in *PostgreSQLUpdatesInitParameters) DeepCopy() *PostgreSQLUpdatesInitParameters { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingUpdatesInitParameters. +func (in *PendingUpdatesInitParameters) DeepCopy() *PendingUpdatesInitParameters { if in == nil { return nil } - out := new(PostgreSQLUpdatesInitParameters) + out := new(PendingUpdatesInitParameters) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PostgreSQLUpdatesObservation) DeepCopyInto(out *PostgreSQLUpdatesObservation) { +func (in *PendingUpdatesObservation) DeepCopyInto(out *PendingUpdatesObservation) { *out = *in - if in.DayOfWeek != nil { - in, out := &in.DayOfWeek, &out.DayOfWeek + if in.Deadline != nil { + in, out := &in.Deadline, &out.Deadline *out = new(string) **out = **in } - if in.Duration != nil { - in, out := &in.Duration, &out.Duration - *out = new(float64) + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) **out = **in } - if in.Frequency != nil { - in, out := &in.Frequency, &out.Frequency + if in.PlannedFor != nil { + in, out := &in.PlannedFor, &out.PlannedFor *out = new(string) **out = **in } - if in.HourOfDay != nil { - in, out := &in.HourOfDay, &out.HourOfDay - *out = new(float64) - **out = **in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingUpdatesObservation. +func (in *PendingUpdatesObservation) DeepCopy() *PendingUpdatesObservation { + if in == nil { + return nil } - if in.WeekOfMonth != nil { - in, out := &in.WeekOfMonth, &out.WeekOfMonth - *out = new(float64) - **out = **in + out := new(PendingUpdatesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PendingUpdatesParameters) DeepCopyInto(out *PendingUpdatesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PendingUpdatesParameters. +func (in *PendingUpdatesParameters) DeepCopy() *PendingUpdatesParameters { + if in == nil { + return nil } + out := new(PendingUpdatesParameters) + in.DeepCopyInto(out) + return out } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesObservation. -func (in *PostgreSQLUpdatesObservation) DeepCopy() *PostgreSQLUpdatesObservation { +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQL) DeepCopyInto(out *PostgreSQL) { + *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 PostgreSQL. +func (in *PostgreSQL) DeepCopy() *PostgreSQL { if in == nil { return nil } - out := new(PostgreSQLUpdatesObservation) + out := new(PostgreSQL) in.DeepCopyInto(out) return out } +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PostgreSQL) 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 *PostgreSQLUpdatesParameters) DeepCopyInto(out *PostgreSQLUpdatesParameters) { +func (in *PostgreSQLInitParameters) DeepCopyInto(out *PostgreSQLInitParameters) { *out = *in - if in.DayOfWeek != nil { - in, out := &in.DayOfWeek, &out.DayOfWeek - *out = new(string) - **out = **in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.Duration != nil { - in, out := &in.Duration, &out.Duration + if in.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize *out = new(float64) **out = **in } - if in.Frequency != nil { - in, out := &in.Frequency, &out.Frequency + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID *out = new(string) **out = **in } - if in.HourOfDay != nil { - in, out := &in.HourOfDay, &out.HourOfDay - *out = new(float64) + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) **out = **in } - if in.WeekOfMonth != nil { - in, out := &in.WeekOfMonth, &out.WeekOfMonth - *out = new(float64) + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) **out = **in } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesParameters. -func (in *PostgreSQLUpdatesParameters) DeepCopy() *PostgreSQLUpdatesParameters { - if in == nil { - return nil + if in.ReplicationCommitType != nil { + in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + *out = new(string) + **out = **in } - out := new(PostgreSQLUpdatesParameters) + if in.ReplicationType != nil { + in, out := &in.ReplicationType, &out.ReplicationType + *out = new(string) + **out = **in + } + if in.SSLConnection != nil { + in, out := &in.SSLConnection, &out.SSLConnection + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make([]PostgreSQLUpdatesInitParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLInitParameters. +func (in *PostgreSQLInitParameters) DeepCopy() *PostgreSQLInitParameters { + if in == nil { + return nil + } + out := new(PostgreSQLInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLList) DeepCopyInto(out *PostgreSQLList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PostgreSQL, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLList. +func (in *PostgreSQLList) DeepCopy() *PostgreSQLList { + if in == nil { + return nil + } + out := new(PostgreSQLList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PostgreSQLList) 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 *PostgreSQLObservation) DeepCopyInto(out *PostgreSQLObservation) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.Created != nil { + in, out := &in.Created, &out.Created + *out = new(string) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } + if in.Engine != nil { + in, out := &in.Engine, &out.Engine + *out = new(string) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.HostPrimary != nil { + in, out := &in.HostPrimary, &out.HostPrimary + *out = new(string) + **out = **in + } + if in.HostSecondary != nil { + in, out := &in.HostSecondary, &out.HostSecondary + *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.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicationCommitType != nil { + in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + *out = new(string) + **out = **in + } + if in.ReplicationType != nil { + in, out := &in.ReplicationType, &out.ReplicationType + *out = new(string) + **out = **in + } + if in.SSLConnection != nil { + in, out := &in.SSLConnection, &out.SSLConnection + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updated != nil { + in, out := &in.Updated, &out.Updated + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make([]PostgreSQLUpdatesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + 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 PostgreSQLObservation. +func (in *PostgreSQLObservation) DeepCopy() *PostgreSQLObservation { + if in == nil { + return nil + } + out := new(PostgreSQLObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLParameters) DeepCopyInto(out *PostgreSQLParameters) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.ReplicationCommitType != nil { + in, out := &in.ReplicationCommitType, &out.ReplicationCommitType + *out = new(string) + **out = **in + } + if in.ReplicationType != nil { + in, out := &in.ReplicationType, &out.ReplicationType + *out = new(string) + **out = **in + } + if in.SSLConnection != nil { + in, out := &in.SSLConnection, &out.SSLConnection + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make([]PostgreSQLUpdatesParameters, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLParameters. +func (in *PostgreSQLParameters) DeepCopy() *PostgreSQLParameters { + if in == nil { + return nil + } + out := new(PostgreSQLParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLSpec) DeepCopyInto(out *PostgreSQLSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLSpec. +func (in *PostgreSQLSpec) DeepCopy() *PostgreSQLSpec { + if in == nil { + return nil + } + out := new(PostgreSQLSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLStatus) DeepCopyInto(out *PostgreSQLStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLStatus. +func (in *PostgreSQLStatus) DeepCopy() *PostgreSQLStatus { + if in == nil { + return nil + } + out := new(PostgreSQLStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLUpdatesInitParameters) DeepCopyInto(out *PostgreSQLUpdatesInitParameters) { + *out = *in + if in.DayOfWeek != nil { + in, out := &in.DayOfWeek, &out.DayOfWeek + *out = new(string) + **out = **in + } + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(float64) + **out = **in + } + if in.Frequency != nil { + in, out := &in.Frequency, &out.Frequency + *out = new(string) + **out = **in + } + if in.HourOfDay != nil { + in, out := &in.HourOfDay, &out.HourOfDay + *out = new(float64) + **out = **in + } + if in.WeekOfMonth != nil { + in, out := &in.WeekOfMonth, &out.WeekOfMonth + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesInitParameters. +func (in *PostgreSQLUpdatesInitParameters) DeepCopy() *PostgreSQLUpdatesInitParameters { + if in == nil { + return nil + } + out := new(PostgreSQLUpdatesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLUpdatesObservation) DeepCopyInto(out *PostgreSQLUpdatesObservation) { + *out = *in + if in.DayOfWeek != nil { + in, out := &in.DayOfWeek, &out.DayOfWeek + *out = new(string) + **out = **in + } + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(float64) + **out = **in + } + if in.Frequency != nil { + in, out := &in.Frequency, &out.Frequency + *out = new(string) + **out = **in + } + if in.HourOfDay != nil { + in, out := &in.HourOfDay, &out.HourOfDay + *out = new(float64) + **out = **in + } + if in.WeekOfMonth != nil { + in, out := &in.WeekOfMonth, &out.WeekOfMonth + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesObservation. +func (in *PostgreSQLUpdatesObservation) DeepCopy() *PostgreSQLUpdatesObservation { + if in == nil { + return nil + } + out := new(PostgreSQLUpdatesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLUpdatesParameters) DeepCopyInto(out *PostgreSQLUpdatesParameters) { + *out = *in + if in.DayOfWeek != nil { + in, out := &in.DayOfWeek, &out.DayOfWeek + *out = new(string) + **out = **in + } + if in.Duration != nil { + in, out := &in.Duration, &out.Duration + *out = new(float64) + **out = **in + } + if in.Frequency != nil { + in, out := &in.Frequency, &out.Frequency + *out = new(string) + **out = **in + } + if in.HourOfDay != nil { + in, out := &in.HourOfDay, &out.HourOfDay + *out = new(float64) + **out = **in + } + if in.WeekOfMonth != nil { + in, out := &in.WeekOfMonth, &out.WeekOfMonth + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLUpdatesParameters. +func (in *PostgreSQLUpdatesParameters) DeepCopy() *PostgreSQLUpdatesParameters { + if in == nil { + return nil + } + out := new(PostgreSQLUpdatesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2) DeepCopyInto(out *PostgreSQLv2) { + *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 PostgreSQLv2. +func (in *PostgreSQLv2) DeepCopy() *PostgreSQLv2 { + if in == nil { + return nil + } + out := new(PostgreSQLv2) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PostgreSQLv2) 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 *PostgreSQLv2InitParameters) DeepCopyInto(out *PostgreSQLv2InitParameters) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.ForkRestoreTime != nil { + in, out := &in.ForkRestoreTime, &out.ForkRestoreTime + *out = new(string) + **out = **in + } + if in.ForkSource != nil { + in, out := &in.ForkSource, &out.ForkSource + *out = new(float64) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Suspended != nil { + in, out := &in.Suspended, &out.Suspended + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2InitParameters. +func (in *PostgreSQLv2InitParameters) DeepCopy() *PostgreSQLv2InitParameters { + if in == nil { + return nil + } + out := new(PostgreSQLv2InitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2List) DeepCopyInto(out *PostgreSQLv2List) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]PostgreSQLv2, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2List. +func (in *PostgreSQLv2List) DeepCopy() *PostgreSQLv2List { + if in == nil { + return nil + } + out := new(PostgreSQLv2List) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *PostgreSQLv2List) 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 *PostgreSQLv2Observation) DeepCopyInto(out *PostgreSQLv2Observation) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.Created != nil { + in, out := &in.Created, &out.Created + *out = new(string) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } + if in.Engine != nil { + in, out := &in.Engine, &out.Engine + *out = new(string) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.ForkRestoreTime != nil { + in, out := &in.ForkRestoreTime, &out.ForkRestoreTime + *out = new(string) + **out = **in + } + if in.ForkSource != nil { + in, out := &in.ForkSource, &out.ForkSource + *out = new(float64) + **out = **in + } + if in.HostPrimary != nil { + in, out := &in.HostPrimary, &out.HostPrimary + *out = new(string) + **out = **in + } + if in.HostSecondary != nil { + in, out := &in.HostSecondary, &out.HostSecondary + *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.Members != nil { + in, out := &in.Members, &out.Members + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.OldestRestoreTime != nil { + in, out := &in.OldestRestoreTime, &out.OldestRestoreTime + *out = new(string) + **out = **in + } + if in.PendingUpdates != nil { + in, out := &in.PendingUpdates, &out.PendingUpdates + *out = make([]PostgreSQLv2PendingUpdatesObservation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Platform != nil { + in, out := &in.Platform, &out.Platform + *out = new(string) + **out = **in + } + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(float64) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.SSLConnection != nil { + in, out := &in.SSLConnection, &out.SSLConnection + *out = new(bool) + **out = **in + } + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Suspended != nil { + in, out := &in.Suspended, &out.Suspended + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updated != nil { + in, out := &in.Updated, &out.Updated + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + 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 PostgreSQLv2Observation. +func (in *PostgreSQLv2Observation) DeepCopy() *PostgreSQLv2Observation { + if in == nil { + return nil + } + out := new(PostgreSQLv2Observation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2Parameters) DeepCopyInto(out *PostgreSQLv2Parameters) { + *out = *in + if in.AllowList != nil { + in, out := &in.AllowList, &out.AllowList + *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.ClusterSize != nil { + in, out := &in.ClusterSize, &out.ClusterSize + *out = new(float64) + **out = **in + } + if in.EngineID != nil { + in, out := &in.EngineID, &out.EngineID + *out = new(string) + **out = **in + } + if in.ForkRestoreTime != nil { + in, out := &in.ForkRestoreTime, &out.ForkRestoreTime + *out = new(string) + **out = **in + } + if in.ForkSource != nil { + in, out := &in.ForkSource, &out.ForkSource + *out = new(float64) + **out = **in + } + if in.Label != nil { + in, out := &in.Label, &out.Label + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Suspended != nil { + in, out := &in.Suspended, &out.Suspended + *out = new(bool) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Updates != nil { + in, out := &in.Updates, &out.Updates + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2Parameters. +func (in *PostgreSQLv2Parameters) DeepCopy() *PostgreSQLv2Parameters { + if in == nil { + return nil + } + out := new(PostgreSQLv2Parameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2PendingUpdatesInitParameters) DeepCopyInto(out *PostgreSQLv2PendingUpdatesInitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2PendingUpdatesInitParameters. +func (in *PostgreSQLv2PendingUpdatesInitParameters) DeepCopy() *PostgreSQLv2PendingUpdatesInitParameters { + if in == nil { + return nil + } + out := new(PostgreSQLv2PendingUpdatesInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2PendingUpdatesObservation) DeepCopyInto(out *PostgreSQLv2PendingUpdatesObservation) { + *out = *in + if in.Deadline != nil { + in, out := &in.Deadline, &out.Deadline + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.PlannedFor != nil { + in, out := &in.PlannedFor, &out.PlannedFor + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2PendingUpdatesObservation. +func (in *PostgreSQLv2PendingUpdatesObservation) DeepCopy() *PostgreSQLv2PendingUpdatesObservation { + if in == nil { + return nil + } + out := new(PostgreSQLv2PendingUpdatesObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2PendingUpdatesParameters) DeepCopyInto(out *PostgreSQLv2PendingUpdatesParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2PendingUpdatesParameters. +func (in *PostgreSQLv2PendingUpdatesParameters) DeepCopy() *PostgreSQLv2PendingUpdatesParameters { + if in == nil { + return nil + } + out := new(PostgreSQLv2PendingUpdatesParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2Spec) DeepCopyInto(out *PostgreSQLv2Spec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2Spec. +func (in *PostgreSQLv2Spec) DeepCopy() *PostgreSQLv2Spec { + if in == nil { + return nil + } + out := new(PostgreSQLv2Spec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgreSQLv2Status) DeepCopyInto(out *PostgreSQLv2Status) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQLv2Status. +func (in *PostgreSQLv2Status) DeepCopy() *PostgreSQLv2Status { + if in == nil { + return nil + } + out := new(PostgreSQLv2Status) in.DeepCopyInto(out) return out } diff --git a/apis/database/v1alpha1/zz_generated.managed.go b/apis/database/v1alpha1/zz_generated.managed.go index d00e78b..6f60e29 100644 --- a/apis/database/v1alpha1/zz_generated.managed.go +++ b/apis/database/v1alpha1/zz_generated.managed.go @@ -127,6 +127,66 @@ func (mg *MySQL) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } +// GetCondition of this MySQLv2. +func (mg *MySQLv2) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this MySQLv2. +func (mg *MySQLv2) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this MySQLv2. +func (mg *MySQLv2) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this MySQLv2. +func (mg *MySQLv2) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this MySQLv2. +func (mg *MySQLv2) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this MySQLv2. +func (mg *MySQLv2) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this MySQLv2. +func (mg *MySQLv2) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this MySQLv2. +func (mg *MySQLv2) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this MySQLv2. +func (mg *MySQLv2) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this MySQLv2. +func (mg *MySQLv2) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this MySQLv2. +func (mg *MySQLv2) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this MySQLv2. +func (mg *MySQLv2) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} + // GetCondition of this PostgreSQL. func (mg *PostgreSQL) GetCondition(ct xpv1.ConditionType) xpv1.Condition { return mg.Status.GetCondition(ct) @@ -186,3 +246,63 @@ func (mg *PostgreSQL) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDet func (mg *PostgreSQL) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { mg.Spec.WriteConnectionSecretToReference = r } + +// GetCondition of this PostgreSQLv2. +func (mg *PostgreSQLv2) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this PostgreSQLv2. +func (mg *PostgreSQLv2) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this PostgreSQLv2. +func (mg *PostgreSQLv2) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this PostgreSQLv2. +func (mg *PostgreSQLv2) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this PostgreSQLv2. +func (mg *PostgreSQLv2) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this PostgreSQLv2. +func (mg *PostgreSQLv2) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this PostgreSQLv2. +func (mg *PostgreSQLv2) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this PostgreSQLv2. +func (mg *PostgreSQLv2) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this PostgreSQLv2. +func (mg *PostgreSQLv2) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this PostgreSQLv2. +func (mg *PostgreSQLv2) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this PostgreSQLv2. +func (mg *PostgreSQLv2) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this PostgreSQLv2. +func (mg *PostgreSQLv2) 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 index 3329b8a..7efdf10 100644 --- a/apis/database/v1alpha1/zz_generated.managedlist.go +++ b/apis/database/v1alpha1/zz_generated.managedlist.go @@ -25,6 +25,15 @@ func (l *MySQLList) GetItems() []resource.Managed { return items } +// GetItems of this MySQLv2List. +func (l *MySQLv2List) 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 PostgreSQLList. func (l *PostgreSQLList) GetItems() []resource.Managed { items := make([]resource.Managed, len(l.Items)) @@ -33,3 +42,12 @@ func (l *PostgreSQLList) GetItems() []resource.Managed { } return items } + +// GetItems of this PostgreSQLv2List. +func (l *PostgreSQLv2List) 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_mysqlv2_terraformed.go b/apis/database/v1alpha1/zz_mysqlv2_terraformed.go new file mode 100755 index 0000000..51368ab --- /dev/null +++ b/apis/database/v1alpha1/zz_mysqlv2_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this MySQLv2 +func (mg *MySQLv2) GetTerraformResourceType() string { + return "linode_database_mysql_v2" +} + +// GetConnectionDetailsMapping for this MySQLv2 +func (tr *MySQLv2) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ca_cert": "status.atProvider.caCert", "root_password": "status.atProvider.rootPassword", "root_username": "status.atProvider.rootUsername"} +} + +// GetObservation of this MySQLv2 +func (tr *MySQLv2) 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 MySQLv2 +func (tr *MySQLv2) 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 MySQLv2 +func (tr *MySQLv2) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this MySQLv2 +func (tr *MySQLv2) 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 MySQLv2 +func (tr *MySQLv2) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this MySQLv2 +func (tr *MySQLv2) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this MySQLv2 +func (tr *MySQLv2) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this MySQLv2 using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *MySQLv2) LateInitialize(attrs []byte) (bool, error) { + params := &MySQLv2Parameters{} + 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 *MySQLv2) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/database/v1alpha1/zz_mysqlv2_types.go b/apis/database/v1alpha1/zz_mysqlv2_types.go new file mode 100755 index 0000000..3a8b289 --- /dev/null +++ b/apis/database/v1alpha1/zz_mysqlv2_types.go @@ -0,0 +1,294 @@ +/* +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 MySQLv2InitParameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode instance nodes deployed to the Managed Database. + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. mysql) + // The unique ID of the database engine and version to use. (e.g. mysql/8) + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // The database timestamp from which it was restored. + // The database timestamp from which it was restored. + ForkRestoreTime *string `json:"forkRestoreTime,omitempty" tf:"fork_restore_time,omitempty"` + + // The ID of the database that was forked from. + // The ID of the database that was forked from. + ForkSource *float64 `json:"forkSource,omitempty" tf:"fork_source,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region to use for the Managed Database. + // The Region ID for the Managed Database. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this Managed Database should be suspended. + // Whether this database is suspended. + Suspended *bool `json:"suspended,omitempty" tf:"suspended,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database. + // The Linode Instance type used by the Managed Database for its nodes. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + Updates map[string]string `json:"updates,omitempty" tf:"updates,omitempty"` +} + +type MySQLv2Observation struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode instance nodes deployed to the Managed Database. + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // When this Managed Database was created. + // When this Managed Database was created. + Created *string `json:"created,omitempty" tf:"created,omitempty"` + + // Whether the Managed Databases is encrypted. + // Whether the Managed Databases is encrypted. + Encrypted *bool `json:"encrypted,omitempty" tf:"encrypted,omitempty"` + + // The Managed Database engine. (e.g. mysql) + // The Managed Database engine in engine/version format. + Engine *string `json:"engine,omitempty" tf:"engine,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. mysql) + // The unique ID of the database engine and version to use. (e.g. mysql/8) + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // The database timestamp from which it was restored. + // The database timestamp from which it was restored. + ForkRestoreTime *string `json:"forkRestoreTime,omitempty" tf:"fork_restore_time,omitempty"` + + // The ID of the database that was forked from. + // The ID of the database that was forked from. + ForkSource *float64 `json:"forkSource,omitempty" tf:"fork_source,omitempty"` + + // The primary host for the Managed Database. + // The primary host for the Managed Database. + HostPrimary *string `json:"hostPrimary,omitempty" tf:"host_primary,omitempty"` + + // The secondary/private host for the managed database. + // The secondary/private host for the Managed Database. + HostSecondary *string `json:"hostSecondary,omitempty" tf:"host_secondary,omitempty"` + + // The ID of the Managed Database. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // A mapping between IP addresses and strings designating them as primary or failover. + // +mapType=granular + Members map[string]*string `json:"members,omitempty" tf:"members,omitempty"` + + // The oldest time to which a database can be restored. + OldestRestoreTime *string `json:"oldestRestoreTime,omitempty" tf:"oldest_restore_time,omitempty"` + + // A set of pending updates. + // A set of pending updates. + PendingUpdates []PendingUpdatesObservation `json:"pendingUpdates,omitempty" tf:"pending_updates,omitempty"` + + // The back-end platform for relational databases used by the service. + // The back-end platform for relational databases used by the service. + Platform *string `json:"platform,omitempty" tf:"platform,omitempty"` + + // The access port for this Managed Database. + // The access port for this Managed Database. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // The region to use for the Managed Database. + // The Region ID for the Managed Database. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether to require SSL credentials to establish a connection to the Managed Database. + // Whether to require SSL credentials to establish a connection to the Managed Database. + SSLConnection *bool `json:"sslConnection,omitempty" tf:"ssl_connection,omitempty"` + + // The operating status of the Managed Database. + // The operating status of the Managed Database. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // Whether this Managed Database should be suspended. + // Whether this database is suspended. + Suspended *bool `json:"suspended,omitempty" tf:"suspended,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database. + // The Linode Instance type used by the Managed Database for its nodes. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // When this Managed Database was last updated. + // When this Managed Database was last updated. + Updated *string `json:"updated,omitempty" tf:"updated,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + Updates map[string]string `json:"updates,omitempty" tf:"updates,omitempty"` + + // The Managed Database engine version. (e.g. 13.2) + // The Managed Database engine version. + Version *string `json:"version,omitempty" tf:"version,omitempty"` +} + +type MySQLv2Parameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +kubebuilder:validation:Optional + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode instance nodes deployed to the Managed Database. + // +kubebuilder:validation:Optional + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. mysql) + // The unique ID of the database engine and version to use. (e.g. mysql/8) + // +kubebuilder:validation:Optional + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // The database timestamp from which it was restored. + // The database timestamp from which it was restored. + // +kubebuilder:validation:Optional + ForkRestoreTime *string `json:"forkRestoreTime,omitempty" tf:"fork_restore_time,omitempty"` + + // The ID of the database that was forked from. + // The ID of the database that was forked from. + // +kubebuilder:validation:Optional + ForkSource *float64 `json:"forkSource,omitempty" tf:"fork_source,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region to use for the Managed Database. + // The Region ID for the Managed Database. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this Managed Database should be suspended. + // Whether this database is suspended. + // +kubebuilder:validation:Optional + Suspended *bool `json:"suspended,omitempty" tf:"suspended,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database. + // The Linode Instance type used by the Managed Database for its nodes. + // +kubebuilder:validation:Optional + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + // +kubebuilder:validation:Optional + Updates map[string]string `json:"updates,omitempty" tf:"updates,omitempty"` +} + +type PendingUpdatesInitParameters struct { +} + +type PendingUpdatesObservation struct { + + // The time when a mandatory update needs to be applied. + Deadline *string `json:"deadline,omitempty" tf:"deadline,omitempty"` + + // A description of the update. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The date and time a maintenance update will be applied. + PlannedFor *string `json:"plannedFor,omitempty" tf:"planned_for,omitempty"` +} + +type PendingUpdatesParameters struct { +} + +// MySQLv2Spec defines the desired state of MySQLv2 +type MySQLv2Spec struct { + v1.ResourceSpec `json:",inline"` + ForProvider MySQLv2Parameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider MySQLv2InitParameters `json:"initProvider,omitempty"` +} + +// MySQLv2Status defines the observed state of MySQLv2. +type MySQLv2Status struct { + v1.ResourceStatus `json:",inline"` + AtProvider MySQLv2Observation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// MySQLv2 is the Schema for the MySQLv2s API. Manages a Linode MySQL Database. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} +type MySQLv2 struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.engineId) || (has(self.initProvider) && has(self.initProvider.engineId))",message="spec.forProvider.engineId is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" + Spec MySQLv2Spec `json:"spec"` + Status MySQLv2Status `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// MySQLv2List contains a list of MySQLv2s +type MySQLv2List struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MySQLv2 `json:"items"` +} + +// Repository type metadata. +var ( + MySQLv2_Kind = "MySQLv2" + MySQLv2_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: MySQLv2_Kind}.String() + MySQLv2_KindAPIVersion = MySQLv2_Kind + "." + CRDGroupVersion.String() + MySQLv2_GroupVersionKind = CRDGroupVersion.WithKind(MySQLv2_Kind) +) + +func init() { + SchemeBuilder.Register(&MySQLv2{}, &MySQLv2List{}) +} diff --git a/apis/database/v1alpha1/zz_postgresqlv2_terraformed.go b/apis/database/v1alpha1/zz_postgresqlv2_terraformed.go new file mode 100755 index 0000000..54ffba4 --- /dev/null +++ b/apis/database/v1alpha1/zz_postgresqlv2_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this PostgreSQLv2 +func (mg *PostgreSQLv2) GetTerraformResourceType() string { + return "linode_database_postgresql_v2" +} + +// GetConnectionDetailsMapping for this PostgreSQLv2 +func (tr *PostgreSQLv2) GetConnectionDetailsMapping() map[string]string { + return map[string]string{"ca_cert": "status.atProvider.caCert", "root_password": "status.atProvider.rootPassword", "root_username": "status.atProvider.rootUsername"} +} + +// GetObservation of this PostgreSQLv2 +func (tr *PostgreSQLv2) 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 PostgreSQLv2 +func (tr *PostgreSQLv2) 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 PostgreSQLv2 +func (tr *PostgreSQLv2) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this PostgreSQLv2 +func (tr *PostgreSQLv2) 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 PostgreSQLv2 +func (tr *PostgreSQLv2) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this PostgreSQLv2 +func (tr *PostgreSQLv2) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this PostgreSQLv2 +func (tr *PostgreSQLv2) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this PostgreSQLv2 using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *PostgreSQLv2) LateInitialize(attrs []byte) (bool, error) { + params := &PostgreSQLv2Parameters{} + 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 *PostgreSQLv2) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/database/v1alpha1/zz_postgresqlv2_types.go b/apis/database/v1alpha1/zz_postgresqlv2_types.go new file mode 100755 index 0000000..1ce6fa3 --- /dev/null +++ b/apis/database/v1alpha1/zz_postgresqlv2_types.go @@ -0,0 +1,294 @@ +/* +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 PostgreSQLv2InitParameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode instance nodes deployed to the Managed Database. + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. postgresql/16) + // The unique ID of the database engine and version to use. (e.g. postgresql/16) + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // The database timestamp from which it was restored. + // The database timestamp from which it was restored. + ForkRestoreTime *string `json:"forkRestoreTime,omitempty" tf:"fork_restore_time,omitempty"` + + // The ID of the database that was forked from. + // The ID of the database that was forked from. + ForkSource *float64 `json:"forkSource,omitempty" tf:"fork_source,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region to use for the Managed Database. + // The Region ID for the Managed Database. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this Managed Database should be suspended. + // Whether this database is suspended. + Suspended *bool `json:"suspended,omitempty" tf:"suspended,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database. + // The Linode Instance type used by the Managed Database for its nodes. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + Updates map[string]string `json:"updates,omitempty" tf:"updates,omitempty"` +} + +type PostgreSQLv2Observation struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode instance nodes deployed to the Managed Database. + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // When this Managed Database was created. + // When this Managed Database was created. + Created *string `json:"created,omitempty" tf:"created,omitempty"` + + // Whether the Managed Databases is encrypted. + // Whether the Managed Databases is encrypted. + Encrypted *bool `json:"encrypted,omitempty" tf:"encrypted,omitempty"` + + // The Managed Database engine. (e.g. postgresql) + // The Managed Database engine in engine/version format. + Engine *string `json:"engine,omitempty" tf:"engine,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. postgresql/16) + // The unique ID of the database engine and version to use. (e.g. postgresql/16) + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // The database timestamp from which it was restored. + // The database timestamp from which it was restored. + ForkRestoreTime *string `json:"forkRestoreTime,omitempty" tf:"fork_restore_time,omitempty"` + + // The ID of the database that was forked from. + // The ID of the database that was forked from. + ForkSource *float64 `json:"forkSource,omitempty" tf:"fork_source,omitempty"` + + // The primary host for the Managed Database. + // The primary host for the Managed Database. + HostPrimary *string `json:"hostPrimary,omitempty" tf:"host_primary,omitempty"` + + // The secondary/private host for the managed database. + // The secondary/private host for the Managed Database. + HostSecondary *string `json:"hostSecondary,omitempty" tf:"host_secondary,omitempty"` + + // The ID of the Managed Database. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // A mapping between IP addresses and strings designating them as primary or failover. + // +mapType=granular + Members map[string]*string `json:"members,omitempty" tf:"members,omitempty"` + + // The oldest time to which a database can be restored. + OldestRestoreTime *string `json:"oldestRestoreTime,omitempty" tf:"oldest_restore_time,omitempty"` + + // A set of pending updates. + // A set of pending updates. + PendingUpdates []PostgreSQLv2PendingUpdatesObservation `json:"pendingUpdates,omitempty" tf:"pending_updates,omitempty"` + + // The back-end platform for relational databases used by the service. + // The back-end platform for relational databases used by the service. + Platform *string `json:"platform,omitempty" tf:"platform,omitempty"` + + // The access port for this Managed Database. + // The access port for this Managed Database. + Port *float64 `json:"port,omitempty" tf:"port,omitempty"` + + // The region to use for the Managed Database. + // The Region ID for the Managed Database. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether to require SSL credentials to establish a connection to the Managed Database. + // Whether to require SSL credentials to establish a connection to the Managed Database. + SSLConnection *bool `json:"sslConnection,omitempty" tf:"ssl_connection,omitempty"` + + // The operating status of the Managed Database. + // The operating status of the Managed Database. + Status *string `json:"status,omitempty" tf:"status,omitempty"` + + // Whether this Managed Database should be suspended. + // Whether this database is suspended. + Suspended *bool `json:"suspended,omitempty" tf:"suspended,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database. + // The Linode Instance type used by the Managed Database for its nodes. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // When this Managed Database was last updated. + // When this Managed Database was last updated. + Updated *string `json:"updated,omitempty" tf:"updated,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + Updates map[string]string `json:"updates,omitempty" tf:"updates,omitempty"` + + // The Managed Database engine version. (e.g. 13.2) + // The Managed Database engine version. + Version *string `json:"version,omitempty" tf:"version,omitempty"` +} + +type PostgreSQLv2Parameters struct { + + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + // A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + // +kubebuilder:validation:Optional + // +listType=set + AllowList []*string `json:"allowList,omitempty" tf:"allow_list,omitempty"` + + // The number of Linode Instance nodes deployed to the Managed Database. (default 1) + // The number of Linode instance nodes deployed to the Managed Database. + // +kubebuilder:validation:Optional + ClusterSize *float64 `json:"clusterSize,omitempty" tf:"cluster_size,omitempty"` + + // The Managed Database engine in engine/version format. (e.g. postgresql/16) + // The unique ID of the database engine and version to use. (e.g. postgresql/16) + // +kubebuilder:validation:Optional + EngineID *string `json:"engineId,omitempty" tf:"engine_id,omitempty"` + + // The database timestamp from which it was restored. + // The database timestamp from which it was restored. + // +kubebuilder:validation:Optional + ForkRestoreTime *string `json:"forkRestoreTime,omitempty" tf:"fork_restore_time,omitempty"` + + // The ID of the database that was forked from. + // The ID of the database that was forked from. + // +kubebuilder:validation:Optional + ForkSource *float64 `json:"forkSource,omitempty" tf:"fork_source,omitempty"` + + // A unique, user-defined string referring to the Managed Database. + // A unique, user-defined string referring to the Managed Database. + // +kubebuilder:validation:Optional + Label *string `json:"label,omitempty" tf:"label,omitempty"` + + // The region to use for the Managed Database. + // The Region ID for the Managed Database. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this Managed Database should be suspended. + // Whether this database is suspended. + // +kubebuilder:validation:Optional + Suspended *bool `json:"suspended,omitempty" tf:"suspended,omitempty"` + + // The Linode Instance type used for the nodes of the Managed Database. + // The Linode Instance type used by the Managed Database for its nodes. + // +kubebuilder:validation:Optional + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Configuration settings for automated patch update maintenance for the Managed Database. + // +kubebuilder:validation:Optional + Updates map[string]string `json:"updates,omitempty" tf:"updates,omitempty"` +} + +type PostgreSQLv2PendingUpdatesInitParameters struct { +} + +type PostgreSQLv2PendingUpdatesObservation struct { + + // The time when a mandatory update needs to be applied. + Deadline *string `json:"deadline,omitempty" tf:"deadline,omitempty"` + + // A description of the update. + Description *string `json:"description,omitempty" tf:"description,omitempty"` + + // The date and time a maintenance update will be applied. + PlannedFor *string `json:"plannedFor,omitempty" tf:"planned_for,omitempty"` +} + +type PostgreSQLv2PendingUpdatesParameters struct { +} + +// PostgreSQLv2Spec defines the desired state of PostgreSQLv2 +type PostgreSQLv2Spec struct { + v1.ResourceSpec `json:",inline"` + ForProvider PostgreSQLv2Parameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider PostgreSQLv2InitParameters `json:"initProvider,omitempty"` +} + +// PostgreSQLv2Status defines the observed state of PostgreSQLv2. +type PostgreSQLv2Status struct { + v1.ResourceStatus `json:",inline"` + AtProvider PostgreSQLv2Observation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// PostgreSQLv2 is the Schema for the PostgreSQLv2s API. Manages a Linode PostgreSQL Database. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} +type PostgreSQLv2 struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.engineId) || (has(self.initProvider) && has(self.initProvider.engineId))",message="spec.forProvider.engineId is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.label) || (has(self.initProvider) && has(self.initProvider.label))",message="spec.forProvider.label is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.region) || (has(self.initProvider) && has(self.initProvider.region))",message="spec.forProvider.region is a required parameter" + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.type) || (has(self.initProvider) && has(self.initProvider.type))",message="spec.forProvider.type is a required parameter" + Spec PostgreSQLv2Spec `json:"spec"` + Status PostgreSQLv2Status `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// PostgreSQLv2List contains a list of PostgreSQLv2s +type PostgreSQLv2List struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []PostgreSQLv2 `json:"items"` +} + +// Repository type metadata. +var ( + PostgreSQLv2_Kind = "PostgreSQLv2" + PostgreSQLv2_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: PostgreSQLv2_Kind}.String() + PostgreSQLv2_KindAPIVersion = PostgreSQLv2_Kind + "." + CRDGroupVersion.String() + PostgreSQLv2_GroupVersionKind = CRDGroupVersion.WithKind(PostgreSQLv2_Kind) +) + +func init() { + SchemeBuilder.Register(&PostgreSQLv2{}, &PostgreSQLv2List{}) +} diff --git a/apis/networking/v1alpha1/zz_generated.conversion_hubs.go b/apis/networking/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..ce7ea71 --- /dev/null +++ b/apis/networking/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,10 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *IP) Hub() {} diff --git a/apis/networking/v1alpha1/zz_generated.deepcopy.go b/apis/networking/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..b66bacc --- /dev/null +++ b/apis/networking/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,285 @@ +//go:build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + 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 *IP) DeepCopyInto(out *IP) { + *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 IP. +func (in *IP) DeepCopy() *IP { + if in == nil { + return nil + } + out := new(IP) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IP) 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 *IPInitParameters) DeepCopyInto(out *IPInitParameters) { + *out = *in + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Reserved != nil { + in, out := &in.Reserved, &out.Reserved + *out = new(bool) + **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 IPInitParameters. +func (in *IPInitParameters) DeepCopy() *IPInitParameters { + if in == nil { + return nil + } + out := new(IPInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPList) DeepCopyInto(out *IPList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IP, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPList. +func (in *IPList) DeepCopy() *IPList { + if in == nil { + return nil + } + out := new(IPList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPList) 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 *IPObservation) DeepCopyInto(out *IPObservation) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.Gateway != nil { + in, out := &in.Gateway, &out.Gateway + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = new(float64) + **out = **in + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Rdns != nil { + in, out := &in.Rdns, &out.Rdns + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Reserved != nil { + in, out := &in.Reserved, &out.Reserved + *out = new(bool) + **out = **in + } + if in.SubnetMask != nil { + in, out := &in.SubnetMask, &out.SubnetMask + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.VPCNAT11 != nil { + in, out := &in.VPCNAT11, &out.VPCNAT11 + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPObservation. +func (in *IPObservation) DeepCopy() *IPObservation { + if in == nil { + return nil + } + out := new(IPObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPParameters) DeepCopyInto(out *IPParameters) { + *out = *in + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Reserved != nil { + in, out := &in.Reserved, &out.Reserved + *out = new(bool) + **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 IPParameters. +func (in *IPParameters) DeepCopy() *IPParameters { + if in == nil { + return nil + } + out := new(IPParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPSpec) DeepCopyInto(out *IPSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPSpec. +func (in *IPSpec) DeepCopy() *IPSpec { + if in == nil { + return nil + } + out := new(IPSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPStatus) DeepCopyInto(out *IPStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPStatus. +func (in *IPStatus) DeepCopy() *IPStatus { + if in == nil { + return nil + } + out := new(IPStatus) + in.DeepCopyInto(out) + return out +} diff --git a/apis/networking/v1alpha1/zz_generated.managed.go b/apis/networking/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..abf8b66 --- /dev/null +++ b/apis/networking/v1alpha1/zz_generated.managed.go @@ -0,0 +1,68 @@ +/* +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 IP. +func (mg *IP) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this IP. +func (mg *IP) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this IP. +func (mg *IP) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this IP. +func (mg *IP) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this IP. +func (mg *IP) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this IP. +func (mg *IP) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this IP. +func (mg *IP) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this IP. +func (mg *IP) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this IP. +func (mg *IP) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this IP. +func (mg *IP) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this IP. +func (mg *IP) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this IP. +func (mg *IP) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/networking/v1alpha1/zz_generated.managedlist.go b/apis/networking/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..2ea8f2c --- /dev/null +++ b/apis/networking/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 IPList. +func (l *IPList) 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/networking/v1alpha1/zz_generated.resolvers.go b/apis/networking/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..d12654f --- /dev/null +++ b/apis/networking/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,56 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this IP. +func (mg *IP) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.ForProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.LinodeIDRef, + Selector: mg.Spec.ForProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.LinodeID") + } + mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/networking/v1alpha1/zz_groupversion_info.go b/apis/networking/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..b5d1553 --- /dev/null +++ b/apis/networking/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=networking.linode.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 = "networking.linode.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/networking/v1alpha1/zz_ip_terraformed.go b/apis/networking/v1alpha1/zz_ip_terraformed.go new file mode 100755 index 0000000..c4df7e2 --- /dev/null +++ b/apis/networking/v1alpha1/zz_ip_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this IP +func (mg *IP) GetTerraformResourceType() string { + return "linode_networking_ip" +} + +// GetConnectionDetailsMapping for this IP +func (tr *IP) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this IP +func (tr *IP) 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 IP +func (tr *IP) 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 IP +func (tr *IP) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this IP +func (tr *IP) 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 IP +func (tr *IP) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this IP +func (tr *IP) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this IP +func (tr *IP) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this IP using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *IP) LateInitialize(attrs []byte) (bool, error) { + params := &IPParameters{} + 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 *IP) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/networking/v1alpha1/zz_ip_types.go b/apis/networking/v1alpha1/zz_ip_types.go new file mode 100755 index 0000000..b72c88e --- /dev/null +++ b/apis/networking/v1alpha1/zz_ip_types.go @@ -0,0 +1,194 @@ +/* +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 IPInitParameters struct { + + // The ID of the Linode to which the IP address will be assigned. Updating this field on an ephemeral IP will trigger a recreation. Conflicts with region. + // The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // Whether the IP address is public. Defaults to true. + // Whether the IPv4 address is public or private. + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The region where the reserved IP should be allocated. + // The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this IP address should be a reserved IP. + // Whether the IPv4 address should be reserved. + Reserved *bool `json:"reserved,omitempty" tf:"reserved,omitempty"` + + // The type of IP address. (ipv4, ipv6, etc.) + // The type of IP address (ipv4). + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +type IPObservation struct { + + // The IP address. + // The allocated IPv4 address. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // The default gateway for this address. + // The default gateway for this address. + Gateway *string `json:"gateway,omitempty" tf:"gateway,omitempty"` + + // The unique identifier of this IP address. + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The ID of the Linode to which the IP address will be assigned. Updating this field on an ephemeral IP will trigger a recreation. Conflicts with region. + // The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set. + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // The number of bits set in the subnet mask. + // The number of bits set in the subnet mask. + Prefix *float64 `json:"prefix,omitempty" tf:"prefix,omitempty"` + + // Whether the IP address is public. Defaults to true. + // Whether the IPv4 address is public or private. + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if not explicitly set. + // The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode. + Rdns *string `json:"rdns,omitempty" tf:"rdns,omitempty"` + + // The region where the reserved IP should be allocated. + // The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this IP address should be a reserved IP. + // Whether the IPv4 address should be reserved. + Reserved *bool `json:"reserved,omitempty" tf:"reserved,omitempty"` + + // The mask that separates host bits from network bits for this address. + // The mask that separates host bits from network bits for this address. + SubnetMask *string `json:"subnetMask,omitempty" tf:"subnet_mask,omitempty"` + + // The type of IP address. (ipv4, ipv6, etc.) + // The type of IP address (ipv4). + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet. + // Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet. + VPCNAT11 map[string]string `json:"vpcNat11,omitempty" tf:"vpc_nat_1_1,omitempty"` +} + +type IPParameters struct { + + // The ID of the Linode to which the IP address will be assigned. Updating this field on an ephemeral IP will trigger a recreation. Conflicts with region. + // The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + // +kubebuilder:validation:Optional + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // Whether the IP address is public. Defaults to true. + // Whether the IPv4 address is public or private. + // +kubebuilder:validation:Optional + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The region where the reserved IP should be allocated. + // The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set. + // +kubebuilder:validation:Optional + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // Whether this IP address should be a reserved IP. + // Whether the IPv4 address should be reserved. + // +kubebuilder:validation:Optional + Reserved *bool `json:"reserved,omitempty" tf:"reserved,omitempty"` + + // The type of IP address. (ipv4, ipv6, etc.) + // The type of IP address (ipv4). + // +kubebuilder:validation:Optional + Type *string `json:"type,omitempty" tf:"type,omitempty"` +} + +// IPSpec defines the desired state of IP +type IPSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider IPParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider IPInitParameters `json:"initProvider,omitempty"` +} + +// IPStatus defines the observed state of IP. +type IPStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider IPObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// IP is the Schema for the IPs API. Manages the allocation and assignment of an IP addresses. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} +type IP struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec IPSpec `json:"spec"` + Status IPStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// IPList contains a list of IPs +type IPList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IP `json:"items"` +} + +// Repository type metadata. +var ( + IP_Kind = "IP" + IP_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: IP_Kind}.String() + IP_KindAPIVersion = IP_Kind + "." + CRDGroupVersion.String() + IP_GroupVersionKind = CRDGroupVersion.WithKind(IP_Kind) +) + +func init() { + SchemeBuilder.Register(&IP{}, &IPList{}) +} diff --git a/apis/reserved/v1alpha1/zz_generated.conversion_hubs.go b/apis/reserved/v1alpha1/zz_generated.conversion_hubs.go new file mode 100755 index 0000000..68a3b56 --- /dev/null +++ b/apis/reserved/v1alpha1/zz_generated.conversion_hubs.go @@ -0,0 +1,10 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +// Hub marks this type as a conversion hub. +func (tr *IPAssignment) Hub() {} diff --git a/apis/reserved/v1alpha1/zz_generated.deepcopy.go b/apis/reserved/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000..a4fb95a --- /dev/null +++ b/apis/reserved/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,370 @@ +//go:build !ignore_autogenerated + +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" + 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 *IPAssignment) DeepCopyInto(out *IPAssignment) { + *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 IPAssignment. +func (in *IPAssignment) DeepCopy() *IPAssignment { + if in == nil { + return nil + } + out := new(IPAssignment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAssignment) 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 *IPAssignmentInitParameters) DeepCopyInto(out *IPAssignmentInitParameters) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.ApplyImmediately != nil { + in, out := &in.ApplyImmediately, &out.ApplyImmediately + *out = new(bool) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Rdns != nil { + in, out := &in.Rdns, &out.Rdns + *out = new(string) + **out = **in + } + if in.RdnsRef != nil { + in, out := &in.RdnsRef, &out.RdnsRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RdnsSelector != nil { + in, out := &in.RdnsSelector, &out.RdnsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAssignmentInitParameters. +func (in *IPAssignmentInitParameters) DeepCopy() *IPAssignmentInitParameters { + if in == nil { + return nil + } + out := new(IPAssignmentInitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAssignmentList) DeepCopyInto(out *IPAssignmentList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IPAssignment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAssignmentList. +func (in *IPAssignmentList) DeepCopy() *IPAssignmentList { + if in == nil { + return nil + } + out := new(IPAssignmentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAssignmentList) 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 *IPAssignmentObservation) DeepCopyInto(out *IPAssignmentObservation) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.ApplyImmediately != nil { + in, out := &in.ApplyImmediately, &out.ApplyImmediately + *out = new(bool) + **out = **in + } + if in.Gateway != nil { + in, out := &in.Gateway, &out.Gateway + *out = new(string) + **out = **in + } + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = new(float64) + **out = **in + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Rdns != nil { + in, out := &in.Rdns, &out.Rdns + *out = new(string) + **out = **in + } + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } + if in.Reserved != nil { + in, out := &in.Reserved, &out.Reserved + *out = new(bool) + **out = **in + } + if in.SubnetMask != nil { + in, out := &in.SubnetMask, &out.SubnetMask + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.VPCNAT11 != nil { + in, out := &in.VPCNAT11, &out.VPCNAT11 + *out = make([]VPCNAT11Observation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAssignmentObservation. +func (in *IPAssignmentObservation) DeepCopy() *IPAssignmentObservation { + if in == nil { + return nil + } + out := new(IPAssignmentObservation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAssignmentParameters) DeepCopyInto(out *IPAssignmentParameters) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.ApplyImmediately != nil { + in, out := &in.ApplyImmediately, &out.ApplyImmediately + *out = new(bool) + **out = **in + } + if in.LinodeID != nil { + in, out := &in.LinodeID, &out.LinodeID + *out = new(float64) + **out = **in + } + if in.LinodeIDRef != nil { + in, out := &in.LinodeIDRef, &out.LinodeIDRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.LinodeIDSelector != nil { + in, out := &in.LinodeIDSelector, &out.LinodeIDSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.Rdns != nil { + in, out := &in.Rdns, &out.Rdns + *out = new(string) + **out = **in + } + if in.RdnsRef != nil { + in, out := &in.RdnsRef, &out.RdnsRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.RdnsSelector != nil { + in, out := &in.RdnsSelector, &out.RdnsSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAssignmentParameters. +func (in *IPAssignmentParameters) DeepCopy() *IPAssignmentParameters { + if in == nil { + return nil + } + out := new(IPAssignmentParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAssignmentSpec) DeepCopyInto(out *IPAssignmentSpec) { + *out = *in + in.ResourceSpec.DeepCopyInto(&out.ResourceSpec) + in.ForProvider.DeepCopyInto(&out.ForProvider) + in.InitProvider.DeepCopyInto(&out.InitProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAssignmentSpec. +func (in *IPAssignmentSpec) DeepCopy() *IPAssignmentSpec { + if in == nil { + return nil + } + out := new(IPAssignmentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAssignmentStatus) DeepCopyInto(out *IPAssignmentStatus) { + *out = *in + in.ResourceStatus.DeepCopyInto(&out.ResourceStatus) + in.AtProvider.DeepCopyInto(&out.AtProvider) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAssignmentStatus. +func (in *IPAssignmentStatus) DeepCopy() *IPAssignmentStatus { + if in == nil { + return nil + } + out := new(IPAssignmentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNAT11InitParameters) DeepCopyInto(out *VPCNAT11InitParameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNAT11InitParameters. +func (in *VPCNAT11InitParameters) DeepCopy() *VPCNAT11InitParameters { + if in == nil { + return nil + } + out := new(VPCNAT11InitParameters) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNAT11Observation) DeepCopyInto(out *VPCNAT11Observation) { + *out = *in + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.SubnetID != nil { + in, out := &in.SubnetID, &out.SubnetID + *out = new(float64) + **out = **in + } + if in.VPCID != nil { + in, out := &in.VPCID, &out.VPCID + *out = new(float64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNAT11Observation. +func (in *VPCNAT11Observation) DeepCopy() *VPCNAT11Observation { + if in == nil { + return nil + } + out := new(VPCNAT11Observation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCNAT11Parameters) DeepCopyInto(out *VPCNAT11Parameters) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCNAT11Parameters. +func (in *VPCNAT11Parameters) DeepCopy() *VPCNAT11Parameters { + if in == nil { + return nil + } + out := new(VPCNAT11Parameters) + in.DeepCopyInto(out) + return out +} diff --git a/apis/reserved/v1alpha1/zz_generated.managed.go b/apis/reserved/v1alpha1/zz_generated.managed.go new file mode 100644 index 0000000..043b168 --- /dev/null +++ b/apis/reserved/v1alpha1/zz_generated.managed.go @@ -0,0 +1,68 @@ +/* +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 IPAssignment. +func (mg *IPAssignment) GetCondition(ct xpv1.ConditionType) xpv1.Condition { + return mg.Status.GetCondition(ct) +} + +// GetDeletionPolicy of this IPAssignment. +func (mg *IPAssignment) GetDeletionPolicy() xpv1.DeletionPolicy { + return mg.Spec.DeletionPolicy +} + +// GetManagementPolicies of this IPAssignment. +func (mg *IPAssignment) GetManagementPolicies() xpv1.ManagementPolicies { + return mg.Spec.ManagementPolicies +} + +// GetProviderConfigReference of this IPAssignment. +func (mg *IPAssignment) GetProviderConfigReference() *xpv1.Reference { + return mg.Spec.ProviderConfigReference +} + +// GetPublishConnectionDetailsTo of this IPAssignment. +func (mg *IPAssignment) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo { + return mg.Spec.PublishConnectionDetailsTo +} + +// GetWriteConnectionSecretToReference of this IPAssignment. +func (mg *IPAssignment) GetWriteConnectionSecretToReference() *xpv1.SecretReference { + return mg.Spec.WriteConnectionSecretToReference +} + +// SetConditions of this IPAssignment. +func (mg *IPAssignment) SetConditions(c ...xpv1.Condition) { + mg.Status.SetConditions(c...) +} + +// SetDeletionPolicy of this IPAssignment. +func (mg *IPAssignment) SetDeletionPolicy(r xpv1.DeletionPolicy) { + mg.Spec.DeletionPolicy = r +} + +// SetManagementPolicies of this IPAssignment. +func (mg *IPAssignment) SetManagementPolicies(r xpv1.ManagementPolicies) { + mg.Spec.ManagementPolicies = r +} + +// SetProviderConfigReference of this IPAssignment. +func (mg *IPAssignment) SetProviderConfigReference(r *xpv1.Reference) { + mg.Spec.ProviderConfigReference = r +} + +// SetPublishConnectionDetailsTo of this IPAssignment. +func (mg *IPAssignment) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo) { + mg.Spec.PublishConnectionDetailsTo = r +} + +// SetWriteConnectionSecretToReference of this IPAssignment. +func (mg *IPAssignment) SetWriteConnectionSecretToReference(r *xpv1.SecretReference) { + mg.Spec.WriteConnectionSecretToReference = r +} diff --git a/apis/reserved/v1alpha1/zz_generated.managedlist.go b/apis/reserved/v1alpha1/zz_generated.managedlist.go new file mode 100644 index 0000000..fdf331a --- /dev/null +++ b/apis/reserved/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 IPAssignmentList. +func (l *IPAssignmentList) 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/reserved/v1alpha1/zz_generated.resolvers.go b/apis/reserved/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..3c62f94 --- /dev/null +++ b/apis/reserved/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,89 @@ +/* +Copyright 2022 Upbound Inc. +*/ +// Code generated by angryjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + reference "github.com/crossplane/crossplane-runtime/pkg/reference" + v1alpha1 "github.com/linode/provider-linode/apis/instance/v1alpha1" + v1alpha11 "github.com/linode/provider-linode/apis/rdns/v1alpha1" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this IPAssignment. +func (mg *IPAssignment) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.ForProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.LinodeIDRef, + Selector: mg.Spec.ForProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.LinodeID") + } + mg.Spec.ForProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.LinodeIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.Rdns), + Extract: reference.ExternalName(), + Reference: mg.Spec.ForProvider.RdnsRef, + Selector: mg.Spec.ForProvider.RdnsSelector, + To: reference.To{ + List: &v1alpha11.RDNSList{}, + Managed: &v1alpha11.RDNS{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.Rdns") + } + mg.Spec.ForProvider.Rdns = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.RdnsRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromFloatPtrValue(mg.Spec.InitProvider.LinodeID), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.LinodeIDRef, + Selector: mg.Spec.InitProvider.LinodeIDSelector, + To: reference.To{ + List: &v1alpha1.InstanceList{}, + Managed: &v1alpha1.Instance{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.LinodeID") + } + mg.Spec.InitProvider.LinodeID = reference.ToFloatPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.LinodeIDRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.Rdns), + Extract: reference.ExternalName(), + Reference: mg.Spec.InitProvider.RdnsRef, + Selector: mg.Spec.InitProvider.RdnsSelector, + To: reference.To{ + List: &v1alpha11.RDNSList{}, + Managed: &v1alpha11.RDNS{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.Rdns") + } + mg.Spec.InitProvider.Rdns = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.RdnsRef = rsp.ResolvedReference + + return nil +} diff --git a/apis/reserved/v1alpha1/zz_groupversion_info.go b/apis/reserved/v1alpha1/zz_groupversion_info.go new file mode 100755 index 0000000..04fd900 --- /dev/null +++ b/apis/reserved/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=reserved.linode.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 = "reserved.linode.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/reserved/v1alpha1/zz_ipassignment_terraformed.go b/apis/reserved/v1alpha1/zz_ipassignment_terraformed.go new file mode 100755 index 0000000..057170d --- /dev/null +++ b/apis/reserved/v1alpha1/zz_ipassignment_terraformed.go @@ -0,0 +1,129 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package v1alpha1 + +import ( + "dario.cat/mergo" + "github.com/pkg/errors" + + "github.com/crossplane/upjet/pkg/resource" + "github.com/crossplane/upjet/pkg/resource/json" +) + +// GetTerraformResourceType returns Terraform resource type for this IPAssignment +func (mg *IPAssignment) GetTerraformResourceType() string { + return "linode_reserved_ip_assignment" +} + +// GetConnectionDetailsMapping for this IPAssignment +func (tr *IPAssignment) GetConnectionDetailsMapping() map[string]string { + return nil +} + +// GetObservation of this IPAssignment +func (tr *IPAssignment) 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 IPAssignment +func (tr *IPAssignment) 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 IPAssignment +func (tr *IPAssignment) GetID() string { + if tr.Status.AtProvider.ID == nil { + return "" + } + return *tr.Status.AtProvider.ID +} + +// GetParameters of this IPAssignment +func (tr *IPAssignment) 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 IPAssignment +func (tr *IPAssignment) SetParameters(params map[string]any) error { + p, err := json.TFParser.Marshal(params) + if err != nil { + return err + } + return json.TFParser.Unmarshal(p, &tr.Spec.ForProvider) +} + +// GetInitParameters of this IPAssignment +func (tr *IPAssignment) GetInitParameters() (map[string]any, error) { + p, err := json.TFParser.Marshal(tr.Spec.InitProvider) + if err != nil { + return nil, err + } + base := map[string]any{} + return base, json.TFParser.Unmarshal(p, &base) +} + +// GetInitParameters of this IPAssignment +func (tr *IPAssignment) GetMergedParameters(shouldMergeInitProvider bool) (map[string]any, error) { + params, err := tr.GetParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get parameters for resource '%q'", tr.GetName()) + } + if !shouldMergeInitProvider { + return params, nil + } + + initParams, err := tr.GetInitParameters() + if err != nil { + return nil, errors.Wrapf(err, "cannot get init parameters for resource '%q'", tr.GetName()) + } + + // Note(lsviben): mergo.WithSliceDeepCopy is needed to merge the + // slices from the initProvider to forProvider. As it also sets + // overwrite to true, we need to set it back to false, we don't + // want to overwrite the forProvider fields with the initProvider + // fields. + err = mergo.Merge(¶ms, initParams, mergo.WithSliceDeepCopy, func(c *mergo.Config) { + c.Overwrite = false + }) + if err != nil { + return nil, errors.Wrapf(err, "cannot merge spec.initProvider and spec.forProvider parameters for resource '%q'", tr.GetName()) + } + + return params, nil +} + +// LateInitialize this IPAssignment using its observed tfState. +// returns True if there are any spec changes for the resource. +func (tr *IPAssignment) LateInitialize(attrs []byte) (bool, error) { + params := &IPAssignmentParameters{} + 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 *IPAssignment) GetTerraformSchemaVersion() int { + return 0 +} diff --git a/apis/reserved/v1alpha1/zz_ipassignment_types.go b/apis/reserved/v1alpha1/zz_ipassignment_types.go new file mode 100755 index 0000000..a6f04cc --- /dev/null +++ b/apis/reserved/v1alpha1/zz_ipassignment_types.go @@ -0,0 +1,208 @@ +/* +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 IPAssignmentInitParameters struct { + + // The resulting IPv4 address. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // If true, the instance will be rebooted to update network interfaces. This functionality is not affected by the `skip_implicit_reboots` provider argument. + ApplyImmediately *bool `json:"applyImmediately,omitempty" tf:"apply_immediately,omitempty"` + + // The ID of the Linode to allocate an IPv4 address for. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // Whether the IPv4 address is public or private. + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The reverse DNS assigned to this address. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/rdns/v1alpha1.RDNS + Rdns *string `json:"rdns,omitempty" tf:"rdns,omitempty"` + + // Reference to a RDNS in rdns to populate rdns. + // +kubebuilder:validation:Optional + RdnsRef *v1.Reference `json:"rdnsRef,omitempty" tf:"-"` + + // Selector for a RDNS in rdns to populate rdns. + // +kubebuilder:validation:Optional + RdnsSelector *v1.Selector `json:"rdnsSelector,omitempty" tf:"-"` +} + +type IPAssignmentObservation struct { + + // The resulting IPv4 address. + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // If true, the instance will be rebooted to update network interfaces. This functionality is not affected by the `skip_implicit_reboots` provider argument. + ApplyImmediately *bool `json:"applyImmediately,omitempty" tf:"apply_immediately,omitempty"` + + // The default gateway for this address + Gateway *string `json:"gateway,omitempty" tf:"gateway,omitempty"` + + ID *string `json:"id,omitempty" tf:"id,omitempty"` + + // The ID of the Linode to allocate an IPv4 address for. + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // The number of bits set in the subnet mask. + Prefix *float64 `json:"prefix,omitempty" tf:"prefix,omitempty"` + + // Whether the IPv4 address is public or private. + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The reverse DNS assigned to this address. + Rdns *string `json:"rdns,omitempty" tf:"rdns,omitempty"` + + // The region this IP resides in. + Region *string `json:"region,omitempty" tf:"region,omitempty"` + + // The reservation status of the IP address + Reserved *bool `json:"reserved,omitempty" tf:"reserved,omitempty"` + + // The mask that separates host bits from network bits for this address. + SubnetMask *string `json:"subnetMask,omitempty" tf:"subnet_mask,omitempty"` + + // The type of IP address. + Type *string `json:"type,omitempty" tf:"type,omitempty"` + + // Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet. + VPCNAT11 []VPCNAT11Observation `json:"vpcNat11,omitempty" tf:"vpc_nat_1_1,omitempty"` +} + +type IPAssignmentParameters struct { + + // The resulting IPv4 address. + // +kubebuilder:validation:Optional + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + // If true, the instance will be rebooted to update network interfaces. This functionality is not affected by the `skip_implicit_reboots` provider argument. + // +kubebuilder:validation:Optional + ApplyImmediately *bool `json:"applyImmediately,omitempty" tf:"apply_immediately,omitempty"` + + // The ID of the Linode to allocate an IPv4 address for. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/instance/v1alpha1.Instance + // +kubebuilder:validation:Optional + LinodeID *float64 `json:"linodeId,omitempty" tf:"linode_id,omitempty"` + + // Reference to a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDRef *v1.Reference `json:"linodeIdRef,omitempty" tf:"-"` + + // Selector for a Instance in instance to populate linodeId. + // +kubebuilder:validation:Optional + LinodeIDSelector *v1.Selector `json:"linodeIdSelector,omitempty" tf:"-"` + + // Whether the IPv4 address is public or private. + // +kubebuilder:validation:Optional + Public *bool `json:"public,omitempty" tf:"public,omitempty"` + + // The reverse DNS assigned to this address. + // +crossplane:generate:reference:type=github.com/linode/provider-linode/apis/rdns/v1alpha1.RDNS + // +kubebuilder:validation:Optional + Rdns *string `json:"rdns,omitempty" tf:"rdns,omitempty"` + + // Reference to a RDNS in rdns to populate rdns. + // +kubebuilder:validation:Optional + RdnsRef *v1.Reference `json:"rdnsRef,omitempty" tf:"-"` + + // Selector for a RDNS in rdns to populate rdns. + // +kubebuilder:validation:Optional + RdnsSelector *v1.Selector `json:"rdnsSelector,omitempty" tf:"-"` +} + +type VPCNAT11InitParameters struct { +} + +type VPCNAT11Observation struct { + Address *string `json:"address,omitempty" tf:"address,omitempty"` + + SubnetID *float64 `json:"subnetId,omitempty" tf:"subnet_id,omitempty"` + + VPCID *float64 `json:"vpcId,omitempty" tf:"vpc_id,omitempty"` +} + +type VPCNAT11Parameters struct { +} + +// IPAssignmentSpec defines the desired state of IPAssignment +type IPAssignmentSpec struct { + v1.ResourceSpec `json:",inline"` + ForProvider IPAssignmentParameters `json:"forProvider"` + // THIS IS A BETA FIELD. It will be honored + // unless the Management Policies feature flag is disabled. + // InitProvider holds the same fields as ForProvider, with the exception + // of Identifier and other resource reference fields. The fields that are + // in InitProvider are merged into ForProvider when the resource is created. + // The same fields are also added to the terraform ignore_changes hook, to + // avoid updating them after creation. This is useful for fields that are + // required on creation, but we do not desire to update them after creation, + // for example because of an external controller is managing them, like an + // autoscaler. + InitProvider IPAssignmentInitParameters `json:"initProvider,omitempty"` +} + +// IPAssignmentStatus defines the observed state of IPAssignment. +type IPAssignmentStatus struct { + v1.ResourceStatus `json:",inline"` + AtProvider IPAssignmentObservation `json:"atProvider,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion + +// IPAssignment is the Schema for the IPAssignments API. +// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +// +kubebuilder:printcolumn:name="EXTERNAL-NAME",type="string",JSONPath=".metadata.annotations.crossplane\\.io/external-name" +// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,linode} +type IPAssignment struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.address) || (has(self.initProvider) && has(self.initProvider.address))",message="spec.forProvider.address is a required parameter" + Spec IPAssignmentSpec `json:"spec"` + Status IPAssignmentStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// IPAssignmentList contains a list of IPAssignments +type IPAssignmentList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []IPAssignment `json:"items"` +} + +// Repository type metadata. +var ( + IPAssignment_Kind = "IPAssignment" + IPAssignment_GroupKind = schema.GroupKind{Group: CRDGroup, Kind: IPAssignment_Kind}.String() + IPAssignment_KindAPIVersion = IPAssignment_Kind + "." + CRDGroupVersion.String() + IPAssignment_GroupVersionKind = CRDGroupVersion.WithKind(IPAssignment_Kind) +) + +func init() { + SchemeBuilder.Register(&IPAssignment{}, &IPAssignmentList{}) +} diff --git a/apis/zz_register.go b/apis/zz_register.go index 25702e0..8726484 100755 --- a/apis/zz_register.go +++ b/apis/zz_register.go @@ -18,11 +18,13 @@ import ( v1alpha1instance "github.com/linode/provider-linode/apis/instance/v1alpha1" v1alpha1ipv6 "github.com/linode/provider-linode/apis/ipv6/v1alpha1" v1alpha1lke "github.com/linode/provider-linode/apis/lke/v1alpha1" + v1alpha1networking "github.com/linode/provider-linode/apis/networking/v1alpha1" v1alpha1nodebalancer "github.com/linode/provider-linode/apis/nodebalancer/v1alpha1" v1alpha1objectstorage "github.com/linode/provider-linode/apis/objectstorage/v1alpha1" v1alpha1placementgroup "github.com/linode/provider-linode/apis/placementgroup/v1alpha1" v1alpha1placementgroupassignment "github.com/linode/provider-linode/apis/placementgroupassignment/v1alpha1" v1alpha1rdns "github.com/linode/provider-linode/apis/rdns/v1alpha1" + v1alpha1reserved "github.com/linode/provider-linode/apis/reserved/v1alpha1" v1alpha1sshkey "github.com/linode/provider-linode/apis/sshkey/v1alpha1" v1alpha1stackscript "github.com/linode/provider-linode/apis/stackscript/v1alpha1" v1alpha1token "github.com/linode/provider-linode/apis/token/v1alpha1" @@ -44,11 +46,13 @@ func init() { v1alpha1instance.SchemeBuilder.AddToScheme, v1alpha1ipv6.SchemeBuilder.AddToScheme, v1alpha1lke.SchemeBuilder.AddToScheme, + v1alpha1networking.SchemeBuilder.AddToScheme, v1alpha1nodebalancer.SchemeBuilder.AddToScheme, v1alpha1objectstorage.SchemeBuilder.AddToScheme, v1alpha1placementgroup.SchemeBuilder.AddToScheme, v1alpha1placementgroupassignment.SchemeBuilder.AddToScheme, v1alpha1rdns.SchemeBuilder.AddToScheme, + v1alpha1reserved.SchemeBuilder.AddToScheme, v1alpha1sshkey.SchemeBuilder.AddToScheme, v1alpha1stackscript.SchemeBuilder.AddToScheme, v1alpha1token.SchemeBuilder.AddToScheme, diff --git a/config/databasemysql/config.go b/config/databasemysql/config.go index 5b6fdb7..f81bd35 100644 --- a/config/databasemysql/config.go +++ b/config/databasemysql/config.go @@ -1,10 +1,18 @@ package databasemysql -import "github.com/crossplane/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { p.AddResourceConfigurator("linode_database_mysql", func(r *config.Resource) { r.UseAsync = true }) + p.AddResourceConfigurator("linode_database_mysql_v2", func(r *config.Resource) { + r.UseAsync = true + r.Kind = "MySQLv2" + r.TerraformResource.Schema["updates"].Type = schema.TypeMap + }) } diff --git a/config/databasepostgresql/config.go b/config/databasepostgresql/config.go index 699ad84..838d271 100644 --- a/config/databasepostgresql/config.go +++ b/config/databasepostgresql/config.go @@ -1,6 +1,9 @@ package databasepostgresql -import "github.com/crossplane/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { @@ -8,4 +11,9 @@ func Configure(p *config.Provider) { r.UseAsync = true r.Kind = "PostgreSQL" }) + p.AddResourceConfigurator("linode_database_postgresql_v2", func(r *config.Resource) { + r.UseAsync = true + r.Kind = "PostgreSQLv2" + r.TerraformResource.Schema["updates"].Type = schema.TypeMap + }) } diff --git a/config/externalname.go b/config/externalname.go index 39fdaa6..7dac389 100644 --- a/config/externalname.go +++ b/config/externalname.go @@ -36,6 +36,10 @@ var terraformPluginFrameworkExternalNameConfigs = map[string]config.ExternalName "linode_object_storage_object": config.IdentifierFromProvider, "linode_placement_group": config.IdentifierFromProvider, "linode_placement_group_assignment": config.IdentifierFromProvider, + "linode_reserved_ip_assignment": config.IdentifierFromProvider, + "linode_networking_ip": config.IdentifierFromProvider, + "linode_database_postgresql_v2": config.IdentifierFromProvider, + "linode_database_mysql_v2": config.IdentifierFromProvider, } // terraformSDKIncludeList contains all external name configurations diff --git a/config/instancereservedipassignment/config.go b/config/instancereservedipassignment/config.go new file mode 100644 index 0000000..99a45e2 --- /dev/null +++ b/config/instancereservedipassignment/config.go @@ -0,0 +1,19 @@ +package instancereservedipassignment + +import ( + "github.com/crossplane/upjet/pkg/config" +) + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("linode_reserved_ip_assignment", func(r *config.Resource) { + + r.References["linode_id"] = config.Reference{ + Type: "github.com/linode/provider-linode/apis/instance/v1alpha1.Instance", + } + + r.References["rdns"] = config.Reference{ + Type: "github.com/linode/provider-linode/apis/rdns/v1alpha1.RDNS", + } + }) +} diff --git a/config/networkingip/config.go b/config/networkingip/config.go new file mode 100644 index 0000000..1b25e27 --- /dev/null +++ b/config/networkingip/config.go @@ -0,0 +1,22 @@ +package networkingip + +import ( + "github.com/crossplane/upjet/pkg/config" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +// Configure configures individual resources by adding custom ResourceConfigurators. +func Configure(p *config.Provider) { + p.AddResourceConfigurator("linode_networking_ip", func(r *config.Resource) { + + r.References["linode_id"] = config.Reference{ + Type: "github.com/linode/provider-linode/apis/instance/v1alpha1.Instance", + } + + r.References["rdns"] = config.Reference{ + Type: "github.com/linode/provider-linode/apis/rdns/v1alpha1.RDNS", + } + + r.TerraformResource.Schema["vpc_nat_1_1"].Type = schema.TypeMap + }) +} diff --git a/config/provider.go b/config/provider.go index 8a33728..a71558a 100644 --- a/config/provider.go +++ b/config/provider.go @@ -30,10 +30,12 @@ import ( "github.com/linode/provider-linode/config/instanceconfig" "github.com/linode/provider-linode/config/instancedisk" "github.com/linode/provider-linode/config/instanceip" + "github.com/linode/provider-linode/config/instancereservedipassignment" "github.com/linode/provider-linode/config/instancesharedips" "github.com/linode/provider-linode/config/ipv6range" "github.com/linode/provider-linode/config/lkecluster" "github.com/linode/provider-linode/config/lkenodepool" + "github.com/linode/provider-linode/config/networkingip" "github.com/linode/provider-linode/config/nodebalancer" "github.com/linode/provider-linode/config/nodebalancerconfig" "github.com/linode/provider-linode/config/nodebalancernode" @@ -133,9 +135,11 @@ func GetProvider(_ context.Context, generationProvider bool) (*config.Provider, instancedisk.Configure, instanceip.Configure, instancesharedips.Configure, + instancereservedipassignment.Configure, ipv6range.Configure, lkecluster.Configure, lkenodepool.Configure, + networkingip.Configure, nodebalancer.Configure, nodebalancerconfig.Configure, nodebalancernode.Configure, diff --git a/examples-generated/database/v1alpha1/mysqlv2.yaml b/examples-generated/database/v1alpha1/mysqlv2.yaml new file mode 100644 index 0000000..9088032 --- /dev/null +++ b/examples-generated/database/v1alpha1/mysqlv2.yaml @@ -0,0 +1,14 @@ +apiVersion: database.linode.upbound.io/v1alpha1 +kind: MySQLv2 +metadata: + annotations: + meta.upbound.io/example-id: database/v1alpha1/mysqlv2 + labels: + testing.upbound.io/example-name: foobar + name: foobar +spec: + forProvider: + engineId: mysql/8 + label: mydatabase + region: us-mia + type: g6-nanode-1 diff --git a/examples-generated/database/v1alpha1/postgresqlv2.yaml b/examples-generated/database/v1alpha1/postgresqlv2.yaml new file mode 100644 index 0000000..814ec29 --- /dev/null +++ b/examples-generated/database/v1alpha1/postgresqlv2.yaml @@ -0,0 +1,14 @@ +apiVersion: database.linode.upbound.io/v1alpha1 +kind: PostgreSQLv2 +metadata: + annotations: + meta.upbound.io/example-id: database/v1alpha1/postgresqlv2 + labels: + testing.upbound.io/example-name: foobar + name: foobar +spec: + forProvider: + engineId: postgresql/16 + label: mydatabase + region: us-mia + type: g6-nanode-1 diff --git a/examples-generated/networking/v1alpha1/ip.yaml b/examples-generated/networking/v1alpha1/ip.yaml new file mode 100644 index 0000000..1cd98dc --- /dev/null +++ b/examples-generated/networking/v1alpha1/ip.yaml @@ -0,0 +1,15 @@ +apiVersion: networking.linode.upbound.io/v1alpha1 +kind: IP +metadata: + annotations: + meta.upbound.io/example-id: networking/v1alpha1/ip + labels: + testing.upbound.io/example-name: test_ip + name: test-ip +spec: + forProvider: + linodeIdSelector: + matchLabels: + testing.upbound.io/example-name: example + public: true + type: ipv4 diff --git a/internal/controller/database/mysqlv2/zz_controller.go b/internal/controller/database/mysqlv2/zz_controller.go new file mode 100755 index 0000000..7713e33 --- /dev/null +++ b/internal/controller/database/mysqlv2/zz_controller.go @@ -0,0 +1,91 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package mysqlv2 + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/linode/provider-linode/apis/database/v1alpha1" + features "github.com/linode/provider-linode/internal/features" +) + +// Setup adds a controller that reconciles MySQLv2 managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.MySQLv2_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.MySQLv2_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.MySQLv2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_database_mysql_v2"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.MySQLv2_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.MySQLv2 + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.MySQLv2{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.MySQLv2") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.MySQLv2List{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.MySQLv2List") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.MySQLv2_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.MySQLv2{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/database/postgresqlv2/zz_controller.go b/internal/controller/database/postgresqlv2/zz_controller.go new file mode 100755 index 0000000..48f0a9d --- /dev/null +++ b/internal/controller/database/postgresqlv2/zz_controller.go @@ -0,0 +1,91 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package postgresqlv2 + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/linode/provider-linode/apis/database/v1alpha1" + features "github.com/linode/provider-linode/internal/features" +) + +// Setup adds a controller that reconciles PostgreSQLv2 managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.PostgreSQLv2_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.PostgreSQLv2_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.PostgreSQLv2_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_database_postgresql_v2"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.PostgreSQLv2_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.PostgreSQLv2 + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.PostgreSQLv2{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.PostgreSQLv2") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.PostgreSQLv2List{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.PostgreSQLv2List") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.PostgreSQLv2_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.PostgreSQLv2{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/networking/ip/zz_controller.go b/internal/controller/networking/ip/zz_controller.go new file mode 100755 index 0000000..03b1321 --- /dev/null +++ b/internal/controller/networking/ip/zz_controller.go @@ -0,0 +1,91 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package ip + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/linode/provider-linode/apis/networking/v1alpha1" + features "github.com/linode/provider-linode/internal/features" +) + +// Setup adds a controller that reconciles IP managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.IP_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.IP_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.IP_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_networking_ip"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.IP_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.IP + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.IP{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.IP") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.IPList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.IPList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.IP_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.IP{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/reserved/ipassignment/zz_controller.go b/internal/controller/reserved/ipassignment/zz_controller.go new file mode 100755 index 0000000..c3186f0 --- /dev/null +++ b/internal/controller/reserved/ipassignment/zz_controller.go @@ -0,0 +1,91 @@ +/* +Copyright 2022 Upbound Inc. +*/ + +// Code generated by upjet. DO NOT EDIT. + +package ipassignment + +import ( + "time" + + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + xpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/statemetrics" + tjcontroller "github.com/crossplane/upjet/pkg/controller" + "github.com/crossplane/upjet/pkg/controller/handler" + "github.com/crossplane/upjet/pkg/metrics" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + + v1alpha1 "github.com/linode/provider-linode/apis/reserved/v1alpha1" + features "github.com/linode/provider-linode/internal/features" +) + +// Setup adds a controller that reconciles IPAssignment managed resources. +func Setup(mgr ctrl.Manager, o tjcontroller.Options) error { + name := managed.ControllerName(v1alpha1.IPAssignment_GroupVersionKind.String()) + var initializers managed.InitializerChain + cps := []managed.ConnectionPublisher{managed.NewAPISecretPublisher(mgr.GetClient(), mgr.GetScheme())} + if o.SecretStoreConfigGVK != nil { + cps = append(cps, connection.NewDetailsManager(mgr.GetClient(), *o.SecretStoreConfigGVK, connection.WithTLSConfig(o.ESSOptions.TLSConfig))) + } + eventHandler := handler.NewEventHandler(handler.WithLogger(o.Logger.WithValues("gvk", v1alpha1.IPAssignment_GroupVersionKind))) + ac := tjcontroller.NewAPICallbacks(mgr, xpresource.ManagedKind(v1alpha1.IPAssignment_GroupVersionKind), tjcontroller.WithEventHandler(eventHandler), tjcontroller.WithStatusUpdates(false)) + opts := []managed.ReconcilerOption{ + managed.WithExternalConnecter( + tjcontroller.NewTerraformPluginFrameworkAsyncConnector(mgr.GetClient(), o.OperationTrackerStore, o.SetupFn, o.Provider.Resources["linode_reserved_ip_assignment"], + tjcontroller.WithTerraformPluginFrameworkAsyncLogger(o.Logger), + tjcontroller.WithTerraformPluginFrameworkAsyncConnectorEventHandler(eventHandler), + tjcontroller.WithTerraformPluginFrameworkAsyncCallbackProvider(ac), + tjcontroller.WithTerraformPluginFrameworkAsyncMetricRecorder(metrics.NewMetricRecorder(v1alpha1.IPAssignment_GroupVersionKind, mgr, o.PollInterval)), + tjcontroller.WithTerraformPluginFrameworkAsyncManagementPolicies(o.Features.Enabled(features.EnableBetaManagementPolicies)))), + managed.WithLogger(o.Logger.WithValues("controller", name)), + managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), + managed.WithFinalizer(tjcontroller.NewOperationTrackerFinalizer(o.OperationTrackerStore, xpresource.NewAPIFinalizer(mgr.GetClient(), managed.FinalizerName))), + managed.WithTimeout(3 * time.Minute), + managed.WithInitializers(initializers), + managed.WithConnectionPublishers(cps...), + managed.WithPollInterval(o.PollInterval), + } + if o.PollJitter != 0 { + opts = append(opts, managed.WithPollJitterHook(o.PollJitter)) + } + if o.Features.Enabled(features.EnableBetaManagementPolicies) { + opts = append(opts, managed.WithManagementPolicies()) + } + if o.MetricOptions != nil { + opts = append(opts, managed.WithMetricRecorder(o.MetricOptions.MRMetrics)) + } + + // register webhooks for the kind v1alpha1.IPAssignment + // if they're enabled. + if o.StartWebhooks { + if err := ctrl.NewWebhookManagedBy(mgr). + For(&v1alpha1.IPAssignment{}). + Complete(); err != nil { + return errors.Wrap(err, "cannot register webhook for the kind v1alpha1.IPAssignment") + } + } + + if o.MetricOptions != nil && o.MetricOptions.MRStateMetrics != nil { + stateMetricsRecorder := statemetrics.NewMRStateRecorder( + mgr.GetClient(), o.Logger, o.MetricOptions.MRStateMetrics, &v1alpha1.IPAssignmentList{}, o.MetricOptions.PollStateMetricInterval, + ) + if err := mgr.Add(stateMetricsRecorder); err != nil { + return errors.Wrap(err, "cannot register MR state metrics recorder for kind v1alpha1.IPAssignmentList") + } + } + + r := managed.NewReconciler(mgr, xpresource.ManagedKind(v1alpha1.IPAssignment_GroupVersionKind), opts...) + + return ctrl.NewControllerManagedBy(mgr). + Named(name). + WithOptions(o.ForControllerRuntime()). + WithEventFilter(xpresource.DesiredStateChanged()). + Watches(&v1alpha1.IPAssignment{}, eventHandler). + Complete(ratelimiter.NewReconciler(name, r, o.GlobalRateLimiter)) +} diff --git a/internal/controller/zz_setup.go b/internal/controller/zz_setup.go index 8be06e6..622de47 100755 --- a/internal/controller/zz_setup.go +++ b/internal/controller/zz_setup.go @@ -12,7 +12,9 @@ import ( accountsettings "github.com/linode/provider-linode/internal/controller/accountsettings/accountsettings" accesscontrols "github.com/linode/provider-linode/internal/controller/database/accesscontrols" mysql "github.com/linode/provider-linode/internal/controller/database/mysql" + mysqlv2 "github.com/linode/provider-linode/internal/controller/database/mysqlv2" postgresql "github.com/linode/provider-linode/internal/controller/database/postgresql" + postgresqlv2 "github.com/linode/provider-linode/internal/controller/database/postgresqlv2" domain "github.com/linode/provider-linode/internal/controller/domain/domain" record "github.com/linode/provider-linode/internal/controller/domain/record" device "github.com/linode/provider-linode/internal/controller/firewall/device" @@ -26,6 +28,7 @@ import ( ipv6range "github.com/linode/provider-linode/internal/controller/ipv6/ipv6range" cluster "github.com/linode/provider-linode/internal/controller/lke/cluster" nodepool "github.com/linode/provider-linode/internal/controller/lke/nodepool" + ipnetworking "github.com/linode/provider-linode/internal/controller/networking/ip" confignodebalancer "github.com/linode/provider-linode/internal/controller/nodebalancer/config" node "github.com/linode/provider-linode/internal/controller/nodebalancer/node" nodebalancer "github.com/linode/provider-linode/internal/controller/nodebalancer/nodebalancer" @@ -36,6 +39,7 @@ import ( placementgroupassignment "github.com/linode/provider-linode/internal/controller/placementgroupassignment/placementgroupassignment" providerconfig "github.com/linode/provider-linode/internal/controller/providerconfig" rdns "github.com/linode/provider-linode/internal/controller/rdns/rdns" + ipassignment "github.com/linode/provider-linode/internal/controller/reserved/ipassignment" sshkey "github.com/linode/provider-linode/internal/controller/sshkey/sshkey" stackscript "github.com/linode/provider-linode/internal/controller/stackscript/stackscript" token "github.com/linode/provider-linode/internal/controller/token/token" @@ -52,7 +56,9 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { accountsettings.Setup, accesscontrols.Setup, mysql.Setup, + mysqlv2.Setup, postgresql.Setup, + postgresqlv2.Setup, domain.Setup, record.Setup, device.Setup, @@ -66,6 +72,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { ipv6range.Setup, cluster.Setup, nodepool.Setup, + ipnetworking.Setup, confignodebalancer.Setup, node.Setup, nodebalancer.Setup, @@ -76,6 +83,7 @@ func Setup(mgr ctrl.Manager, o controller.Options) error { placementgroupassignment.Setup, providerconfig.Setup, rdns.Setup, + ipassignment.Setup, sshkey.Setup, stackscript.Setup, token.Setup, diff --git a/package/crds/database.linode.upbound.io_mysqlv2s.yaml b/package/crds/database.linode.upbound.io_mysqlv2s.yaml new file mode 100644 index 0000000..9ee1f2c --- /dev/null +++ b/package/crds/database.linode.upbound.io_mysqlv2s.yaml @@ -0,0 +1,590 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: mysqlv2s.database.linode.upbound.io +spec: + group: database.linode.upbound.io + names: + categories: + - crossplane + - managed + - linode + kind: MySQLv2 + listKind: MySQLv2List + plural: mysqlv2s + singular: mysqlv2 + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: MySQLv2 is the Schema for the MySQLv2s API. Manages a Linode + MySQL Database. + 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: MySQLv2Spec defines the desired state of MySQLv2 + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + allowList: + description: |- + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: |- + The number of Linode Instance nodes deployed to the Managed Database. (default 1) + The number of Linode instance nodes deployed to the Managed Database. + type: number + engineId: + description: |- + The Managed Database engine in engine/version format. (e.g. mysql) + The unique ID of the database engine and version to use. (e.g. mysql/8) + type: string + forkRestoreTime: + description: |- + The database timestamp from which it was restored. + The database timestamp from which it was restored. + type: string + forkSource: + description: |- + The ID of the database that was forked from. + The ID of the database that was forked from. + type: number + label: + description: |- + A unique, user-defined string referring to the Managed Database. + A unique, user-defined string referring to the Managed Database. + type: string + region: + description: |- + The region to use for the Managed Database. + The Region ID for the Managed Database. + type: string + suspended: + description: |- + Whether this Managed Database should be suspended. + Whether this database is suspended. + type: boolean + type: + description: |- + The Linode Instance type used for the nodes of the Managed Database. + The Linode Instance type used by the Managed Database for its nodes. + type: string + updates: + additionalProperties: + type: string + description: Configuration settings for automated patch update + maintenance for the Managed Database. + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + allowList: + description: |- + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: |- + The number of Linode Instance nodes deployed to the Managed Database. (default 1) + The number of Linode instance nodes deployed to the Managed Database. + type: number + engineId: + description: |- + The Managed Database engine in engine/version format. (e.g. mysql) + The unique ID of the database engine and version to use. (e.g. mysql/8) + type: string + forkRestoreTime: + description: |- + The database timestamp from which it was restored. + The database timestamp from which it was restored. + type: string + forkSource: + description: |- + The ID of the database that was forked from. + The ID of the database that was forked from. + type: number + label: + description: |- + A unique, user-defined string referring to the Managed Database. + A unique, user-defined string referring to the Managed Database. + type: string + region: + description: |- + The region to use for the Managed Database. + The Region ID for the Managed Database. + type: string + suspended: + description: |- + Whether this Managed Database should be suspended. + Whether this database is suspended. + type: boolean + type: + description: |- + The Linode Instance type used for the nodes of the Managed Database. + The Linode Instance type used by the Managed Database for its nodes. + type: string + updates: + additionalProperties: + type: string + description: Configuration settings for automated patch update + maintenance for the Managed Database. + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.engineId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.engineId) + || (has(self.initProvider) && has(self.initProvider.engineId))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.region is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.region) + || (has(self.initProvider) && has(self.initProvider.region))' + - message: spec.forProvider.type is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.type) + || (has(self.initProvider) && has(self.initProvider.type))' + status: + description: MySQLv2Status defines the observed state of MySQLv2. + properties: + atProvider: + properties: + allowList: + description: |- + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: |- + The number of Linode Instance nodes deployed to the Managed Database. (default 1) + The number of Linode instance nodes deployed to the Managed Database. + type: number + created: + description: |- + When this Managed Database was created. + When this Managed Database was created. + type: string + encrypted: + description: |- + Whether the Managed Databases is encrypted. + Whether the Managed Databases is encrypted. + type: boolean + engine: + description: |- + The Managed Database engine. (e.g. mysql) + The Managed Database engine in engine/version format. + type: string + engineId: + description: |- + The Managed Database engine in engine/version format. (e.g. mysql) + The unique ID of the database engine and version to use. (e.g. mysql/8) + type: string + forkRestoreTime: + description: |- + The database timestamp from which it was restored. + The database timestamp from which it was restored. + type: string + forkSource: + description: |- + The ID of the database that was forked from. + The ID of the database that was forked from. + type: number + hostPrimary: + description: |- + The primary host for the Managed Database. + The primary host for the Managed Database. + type: string + hostSecondary: + description: |- + The secondary/private host for the managed database. + The secondary/private host for the Managed Database. + type: string + id: + description: The ID of the Managed Database. + type: string + label: + description: |- + A unique, user-defined string referring to the Managed Database. + A unique, user-defined string referring to the Managed Database. + type: string + members: + additionalProperties: + type: string + description: A mapping between IP addresses and strings designating + them as primary or failover. + type: object + x-kubernetes-map-type: granular + oldestRestoreTime: + description: The oldest time to which a database can be restored. + type: string + pendingUpdates: + description: |- + A set of pending updates. + A set of pending updates. + items: + properties: + deadline: + description: The time when a mandatory update needs to be + applied. + type: string + description: + description: A description of the update. + type: string + plannedFor: + description: The date and time a maintenance update will + be applied. + type: string + type: object + type: array + platform: + description: |- + The back-end platform for relational databases used by the service. + The back-end platform for relational databases used by the service. + type: string + port: + description: |- + The access port for this Managed Database. + The access port for this Managed Database. + type: number + region: + description: |- + The region to use for the Managed Database. + The Region ID for the Managed Database. + type: string + sslConnection: + description: |- + Whether to require SSL credentials to establish a connection to the Managed Database. + Whether to require SSL credentials to establish a connection to the Managed Database. + type: boolean + status: + description: |- + The operating status of the Managed Database. + The operating status of the Managed Database. + type: string + suspended: + description: |- + Whether this Managed Database should be suspended. + Whether this database is suspended. + type: boolean + type: + description: |- + The Linode Instance type used for the nodes of the Managed Database. + The Linode Instance type used by the Managed Database for its nodes. + type: string + updated: + description: |- + When this Managed Database was last updated. + When this Managed Database was last updated. + type: string + updates: + additionalProperties: + type: string + description: Configuration settings for automated patch update + maintenance for the Managed Database. + type: object + version: + description: |- + The Managed Database engine version. (e.g. 13.2) + The Managed Database engine version. + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/database.linode.upbound.io_postgresqlv2s.yaml b/package/crds/database.linode.upbound.io_postgresqlv2s.yaml new file mode 100644 index 0000000..ef056c4 --- /dev/null +++ b/package/crds/database.linode.upbound.io_postgresqlv2s.yaml @@ -0,0 +1,590 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: postgresqlv2s.database.linode.upbound.io +spec: + group: database.linode.upbound.io + names: + categories: + - crossplane + - managed + - linode + kind: PostgreSQLv2 + listKind: PostgreSQLv2List + plural: postgresqlv2s + singular: postgresqlv2 + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: PostgreSQLv2 is the Schema for the PostgreSQLv2s API. Manages + a Linode PostgreSQL Database. + 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: PostgreSQLv2Spec defines the desired state of PostgreSQLv2 + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + allowList: + description: |- + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: |- + The number of Linode Instance nodes deployed to the Managed Database. (default 1) + The number of Linode instance nodes deployed to the Managed Database. + type: number + engineId: + description: |- + The Managed Database engine in engine/version format. (e.g. postgresql/16) + The unique ID of the database engine and version to use. (e.g. postgresql/16) + type: string + forkRestoreTime: + description: |- + The database timestamp from which it was restored. + The database timestamp from which it was restored. + type: string + forkSource: + description: |- + The ID of the database that was forked from. + The ID of the database that was forked from. + type: number + label: + description: |- + A unique, user-defined string referring to the Managed Database. + A unique, user-defined string referring to the Managed Database. + type: string + region: + description: |- + The region to use for the Managed Database. + The Region ID for the Managed Database. + type: string + suspended: + description: |- + Whether this Managed Database should be suspended. + Whether this database is suspended. + type: boolean + type: + description: |- + The Linode Instance type used for the nodes of the Managed Database. + The Linode Instance type used by the Managed Database for its nodes. + type: string + updates: + additionalProperties: + type: string + description: Configuration settings for automated patch update + maintenance for the Managed Database. + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + allowList: + description: |- + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: |- + The number of Linode Instance nodes deployed to the Managed Database. (default 1) + The number of Linode instance nodes deployed to the Managed Database. + type: number + engineId: + description: |- + The Managed Database engine in engine/version format. (e.g. postgresql/16) + The unique ID of the database engine and version to use. (e.g. postgresql/16) + type: string + forkRestoreTime: + description: |- + The database timestamp from which it was restored. + The database timestamp from which it was restored. + type: string + forkSource: + description: |- + The ID of the database that was forked from. + The ID of the database that was forked from. + type: number + label: + description: |- + A unique, user-defined string referring to the Managed Database. + A unique, user-defined string referring to the Managed Database. + type: string + region: + description: |- + The region to use for the Managed Database. + The Region ID for the Managed Database. + type: string + suspended: + description: |- + Whether this Managed Database should be suspended. + Whether this database is suspended. + type: boolean + type: + description: |- + The Linode Instance type used for the nodes of the Managed Database. + The Linode Instance type used by the Managed Database for its nodes. + type: string + updates: + additionalProperties: + type: string + description: Configuration settings for automated patch update + maintenance for the Managed Database. + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.engineId is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.engineId) + || (has(self.initProvider) && has(self.initProvider.engineId))' + - message: spec.forProvider.label is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.label) + || (has(self.initProvider) && has(self.initProvider.label))' + - message: spec.forProvider.region is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.region) + || (has(self.initProvider) && has(self.initProvider.region))' + - message: spec.forProvider.type is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.type) + || (has(self.initProvider) && has(self.initProvider.type))' + status: + description: PostgreSQLv2Status defines the observed state of PostgreSQLv2. + properties: + atProvider: + properties: + allowList: + description: |- + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. Use linode_database_access_controls to manage your allow list separately. + A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format. + items: + type: string + type: array + x-kubernetes-list-type: set + clusterSize: + description: |- + The number of Linode Instance nodes deployed to the Managed Database. (default 1) + The number of Linode instance nodes deployed to the Managed Database. + type: number + created: + description: |- + When this Managed Database was created. + When this Managed Database was created. + type: string + encrypted: + description: |- + Whether the Managed Databases is encrypted. + Whether the Managed Databases is encrypted. + type: boolean + engine: + description: |- + The Managed Database engine. (e.g. postgresql) + The Managed Database engine in engine/version format. + type: string + engineId: + description: |- + The Managed Database engine in engine/version format. (e.g. postgresql/16) + The unique ID of the database engine and version to use. (e.g. postgresql/16) + type: string + forkRestoreTime: + description: |- + The database timestamp from which it was restored. + The database timestamp from which it was restored. + type: string + forkSource: + description: |- + The ID of the database that was forked from. + The ID of the database that was forked from. + type: number + hostPrimary: + description: |- + The primary host for the Managed Database. + The primary host for the Managed Database. + type: string + hostSecondary: + description: |- + The secondary/private host for the managed database. + The secondary/private host for the Managed Database. + type: string + id: + description: The ID of the Managed Database. + type: string + label: + description: |- + A unique, user-defined string referring to the Managed Database. + A unique, user-defined string referring to the Managed Database. + type: string + members: + additionalProperties: + type: string + description: A mapping between IP addresses and strings designating + them as primary or failover. + type: object + x-kubernetes-map-type: granular + oldestRestoreTime: + description: The oldest time to which a database can be restored. + type: string + pendingUpdates: + description: |- + A set of pending updates. + A set of pending updates. + items: + properties: + deadline: + description: The time when a mandatory update needs to be + applied. + type: string + description: + description: A description of the update. + type: string + plannedFor: + description: The date and time a maintenance update will + be applied. + type: string + type: object + type: array + platform: + description: |- + The back-end platform for relational databases used by the service. + The back-end platform for relational databases used by the service. + type: string + port: + description: |- + The access port for this Managed Database. + The access port for this Managed Database. + type: number + region: + description: |- + The region to use for the Managed Database. + The Region ID for the Managed Database. + type: string + sslConnection: + description: |- + Whether to require SSL credentials to establish a connection to the Managed Database. + Whether to require SSL credentials to establish a connection to the Managed Database. + type: boolean + status: + description: |- + The operating status of the Managed Database. + The operating status of the Managed Database. + type: string + suspended: + description: |- + Whether this Managed Database should be suspended. + Whether this database is suspended. + type: boolean + type: + description: |- + The Linode Instance type used for the nodes of the Managed Database. + The Linode Instance type used by the Managed Database for its nodes. + type: string + updated: + description: |- + When this Managed Database was last updated. + When this Managed Database was last updated. + type: string + updates: + additionalProperties: + type: string + description: Configuration settings for automated patch update + maintenance for the Managed Database. + type: object + version: + description: |- + The Managed Database engine version. (e.g. 13.2) + The Managed Database engine version. + 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 + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/networking.linode.upbound.io_ips.yaml b/package/crds/networking.linode.upbound.io_ips.yaml new file mode 100644 index 0000000..cbde736 --- /dev/null +++ b/package/crds/networking.linode.upbound.io_ips.yaml @@ -0,0 +1,582 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: ips.networking.linode.upbound.io +spec: + group: networking.linode.upbound.io + names: + categories: + - crossplane + - managed + - linode + kind: IP + listKind: IPList + plural: ips + singular: ip + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: IP is the Schema for the IPs API. Manages the allocation and + assignment of an IP addresses. + 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: IPSpec defines the desired state of IP + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + linodeId: + description: |- + The ID of the Linode to which the IP address will be assigned. Updating this field on an ephemeral IP will trigger a recreation. Conflicts with region. + The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + public: + description: |- + Whether the IP address is public. Defaults to true. + Whether the IPv4 address is public or private. + type: boolean + region: + description: |- + The region where the reserved IP should be allocated. + The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set. + type: string + reserved: + description: |- + Whether this IP address should be a reserved IP. + Whether the IPv4 address should be reserved. + type: boolean + type: + description: |- + The type of IP address. (ipv4, ipv6, etc.) + The type of IP address (ipv4). + type: string + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + linodeId: + description: |- + The ID of the Linode to which the IP address will be assigned. Updating this field on an ephemeral IP will trigger a recreation. Conflicts with region. + The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + public: + description: |- + Whether the IP address is public. Defaults to true. + Whether the IPv4 address is public or private. + type: boolean + region: + description: |- + The region where the reserved IP should be allocated. + The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set. + type: string + reserved: + description: |- + Whether this IP address should be a reserved IP. + Whether the IPv4 address should be reserved. + type: boolean + type: + description: |- + The type of IP address. (ipv4, ipv6, etc.) + The type of IP address (ipv4). + type: string + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + status: + description: IPStatus defines the observed state of IP. + properties: + atProvider: + properties: + address: + description: |- + The IP address. + The allocated IPv4 address. + type: string + gateway: + description: |- + The default gateway for this address. + The default gateway for this address. + type: string + id: + description: The unique identifier of this IP address. + type: string + linodeId: + description: |- + The ID of the Linode to which the IP address will be assigned. Updating this field on an ephemeral IP will trigger a recreation. Conflicts with region. + The ID of the Linode to allocate an IPv4 address for. Required when reserved is false or not set. + type: number + prefix: + description: |- + The number of bits set in the subnet mask. + The number of bits set in the subnet mask. + type: number + public: + description: |- + Whether the IP address is public. Defaults to true. + Whether the IPv4 address is public or private. + type: boolean + rdns: + description: |- + The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode if not explicitly set. + The reverse DNS assigned to this address. For public IPv4 addresses, this will be set to a default value provided by Linode. + type: string + region: + description: |- + The region where the reserved IP should be allocated. + The region for the reserved IPv4 address. Required when reserved is true and linode_id is not set. + type: string + reserved: + description: |- + Whether this IP address should be a reserved IP. + Whether the IPv4 address should be reserved. + type: boolean + subnetMask: + description: |- + The mask that separates host bits from network bits for this address. + The mask that separates host bits from network bits for this address. + type: string + type: + description: |- + The type of IP address. (ipv4, ipv6, etc.) + The type of IP address (ipv4). + type: string + vpcNat11: + additionalProperties: + type: string + description: |- + Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet. + Contains information about the NAT 1:1 mapping of a public IP address to a VPC subnet. + type: object + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/package/crds/reserved.linode.upbound.io_ipassignments.yaml b/package/crds/reserved.linode.upbound.io_ipassignments.yaml new file mode 100644 index 0000000..35d5201 --- /dev/null +++ b/package/crds/reserved.linode.upbound.io_ipassignments.yaml @@ -0,0 +1,712 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: ipassignments.reserved.linode.upbound.io +spec: + group: reserved.linode.upbound.io + names: + categories: + - crossplane + - managed + - linode + kind: IPAssignment + listKind: IPAssignmentList + plural: ipassignments + singular: ipassignment + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .status.conditions[?(@.type=='Synced')].status + name: SYNCED + type: string + - jsonPath: .status.conditions[?(@.type=='Ready')].status + name: READY + type: string + - jsonPath: .metadata.annotations.crossplane\.io/external-name + name: EXTERNAL-NAME + type: string + - jsonPath: .metadata.creationTimestamp + name: AGE + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: IPAssignment is the Schema for the IPAssignments API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: IPAssignmentSpec defines the desired state of IPAssignment + properties: + deletionPolicy: + default: Delete + description: |- + DeletionPolicy specifies what will happen to the underlying external + when this managed resource is deleted - either "Delete" or "Orphan" the + external resource. + This field is planned to be deprecated in favor of the ManagementPolicies + field in a future release. Currently, both could be set independently and + non-default values would be honored if the feature flag is enabled. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + enum: + - Orphan + - Delete + type: string + forProvider: + properties: + address: + description: The resulting IPv4 address. + type: string + applyImmediately: + description: If true, the instance will be rebooted to update + network interfaces. This functionality is not affected by the + `skip_implicit_reboots` provider argument. + type: boolean + linodeId: + description: The ID of the Linode to allocate an IPv4 address + for. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + public: + description: Whether the IPv4 address is public or private. + type: boolean + rdns: + description: The reverse DNS assigned to this address. + type: string + rdnsRef: + description: Reference to a RDNS in rdns to populate rdns. + 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 + rdnsSelector: + description: Selector for a RDNS in rdns to populate rdns. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + initProvider: + description: |- + THIS IS A BETA FIELD. It will be honored + unless the Management Policies feature flag is disabled. + InitProvider holds the same fields as ForProvider, with the exception + of Identifier and other resource reference fields. The fields that are + in InitProvider are merged into ForProvider when the resource is created. + The same fields are also added to the terraform ignore_changes hook, to + avoid updating them after creation. This is useful for fields that are + required on creation, but we do not desire to update them after creation, + for example because of an external controller is managing them, like an + autoscaler. + properties: + address: + description: The resulting IPv4 address. + type: string + applyImmediately: + description: If true, the instance will be rebooted to update + network interfaces. This functionality is not affected by the + `skip_implicit_reboots` provider argument. + type: boolean + linodeId: + description: The ID of the Linode to allocate an IPv4 address + for. + type: number + linodeIdRef: + description: Reference to a Instance in instance to populate linodeId. + 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 + linodeIdSelector: + description: Selector for a Instance in instance to populate linodeId. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + public: + description: Whether the IPv4 address is public or private. + type: boolean + rdns: + description: The reverse DNS assigned to this address. + type: string + rdnsRef: + description: Reference to a RDNS in rdns to populate rdns. + 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 + rdnsSelector: + description: Selector for a RDNS in rdns to populate rdns. + properties: + matchControllerRef: + description: |- + MatchControllerRef ensures an object with the same controller reference + as the selecting object is selected. + type: boolean + matchLabels: + additionalProperties: + type: string + description: MatchLabels ensures an object with matching labels + is selected. + type: object + policy: + description: Policies for selection. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + type: object + type: object + managementPolicies: + default: + - '*' + description: |- + THIS IS A BETA FIELD. It is on by default but can be opted out + through a Crossplane feature flag. + ManagementPolicies specify the array of actions Crossplane is allowed to + take on the managed and external resources. + This field is planned to replace the DeletionPolicy field in a future + release. Currently, both could be set independently and non-default + values would be honored if the feature flag is enabled. If both are + custom, the DeletionPolicy field will be ignored. + See the design doc for more information: https://github.com/crossplane/crossplane/blob/499895a25d1a1a0ba1604944ef98ac7a1a71f197/design/design-doc-observe-only-resources.md?plain=1#L223 + and this one: https://github.com/crossplane/crossplane/blob/444267e84783136daa93568b364a5f01228cacbe/design/one-pager-ignore-changes.md + items: + description: |- + A ManagementAction represents an action that the Crossplane controllers + can take on an external resource. + enum: + - Observe + - Create + - Update + - Delete + - LateInitialize + - '*' + type: string + type: array + providerConfigRef: + default: + name: default + description: |- + ProviderConfigReference specifies how the provider that will be used to + create, observe, update, and delete this managed resource should be + configured. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + publishConnectionDetailsTo: + description: |- + PublishConnectionDetailsTo specifies the connection secret config which + contains a name, metadata and a reference to secret store config to + which any connection details for this managed resource should be written. + Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + properties: + configRef: + default: + name: default + description: |- + SecretStoreConfigRef specifies which secret store config should be used + for this ConnectionSecret. + properties: + name: + description: Name of the referenced object. + type: string + policy: + description: Policies for referencing. + properties: + resolution: + default: Required + description: |- + Resolution specifies whether resolution of this reference is required. + The default is 'Required', which means the reconcile will fail if the + reference cannot be resolved. 'Optional' means this reference will be + a no-op if it cannot be resolved. + enum: + - Required + - Optional + type: string + resolve: + description: |- + Resolve specifies when this reference should be resolved. The default + is 'IfNotPresent', which will attempt to resolve the reference only when + the corresponding field is not present. Use 'Always' to resolve the + reference on every reconcile. + enum: + - Always + - IfNotPresent + type: string + type: object + required: + - name + type: object + metadata: + description: Metadata is the metadata for connection secret. + properties: + annotations: + additionalProperties: + type: string + description: |- + Annotations are the annotations to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.annotations". + - It is up to Secret Store implementation for others store types. + type: object + labels: + additionalProperties: + type: string + description: |- + Labels are the labels/tags to be added to connection secret. + - For Kubernetes secrets, this will be used as "metadata.labels". + - It is up to Secret Store implementation for others store types. + type: object + type: + description: |- + Type is the SecretType for the connection secret. + - Only valid for Kubernetes Secret Stores. + type: string + type: object + name: + description: Name is the name of the connection secret. + type: string + required: + - name + type: object + writeConnectionSecretToRef: + description: |- + WriteConnectionSecretToReference specifies the namespace and name of a + Secret to which any connection details for this managed resource should + be written. Connection details frequently include the endpoint, username, + and password required to connect to the managed resource. + This field is planned to be replaced in a future release in favor of + PublishConnectionDetailsTo. Currently, both could be set independently + and connection details would be published to both without affecting + each other. + properties: + name: + description: Name of the secret. + type: string + namespace: + description: Namespace of the secret. + type: string + required: + - name + - namespace + type: object + required: + - forProvider + type: object + x-kubernetes-validations: + - message: spec.forProvider.address is a required parameter + rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies + || ''Update'' in self.managementPolicies) || has(self.forProvider.address) + || (has(self.initProvider) && has(self.initProvider.address))' + status: + description: IPAssignmentStatus defines the observed state of IPAssignment. + properties: + atProvider: + properties: + address: + description: The resulting IPv4 address. + type: string + applyImmediately: + description: If true, the instance will be rebooted to update + network interfaces. This functionality is not affected by the + `skip_implicit_reboots` provider argument. + type: boolean + gateway: + description: The default gateway for this address + type: string + id: + type: string + linodeId: + description: The ID of the Linode to allocate an IPv4 address + for. + type: number + prefix: + description: The number of bits set in the subnet mask. + type: number + public: + description: Whether the IPv4 address is public or private. + type: boolean + rdns: + description: The reverse DNS assigned to this address. + type: string + region: + description: The region this IP resides in. + type: string + reserved: + description: The reservation status of the IP address + type: boolean + subnetMask: + description: The mask that separates host bits from network bits + for this address. + type: string + type: + description: The type of IP address. + type: string + vpcNat11: + description: Contains information about the NAT 1:1 mapping of + a public IP address to a VPC subnet. + items: + properties: + address: + type: string + subnetId: + type: number + vpcId: + type: number + type: object + type: array + type: object + conditions: + description: Conditions of the resource. + items: + description: A Condition that may apply to a resource. + properties: + lastTransitionTime: + description: |- + LastTransitionTime is the last time this condition transitioned from one + status to another. + format: date-time + type: string + message: + description: |- + A Message containing details about this condition's last transition from + one status to another, if any. + type: string + observedGeneration: + description: |- + ObservedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: A Reason for this condition's last transition from + one status to another. + type: string + status: + description: Status of this condition; is it currently True, + False, or Unknown? + type: string + type: + description: |- + Type of this condition. At most one of each condition type may apply to + a resource at any point in time. + type: string + required: + - lastTransitionTime + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + observedGeneration: + description: |- + ObservedGeneration is the latest metadata.generation + which resulted in either a ready state, or stalled due to error + it can not recover from without human intervention. + format: int64 + type: integer + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {}