diff --git a/apis/sls/v1alpha1/groupversion_info.go b/apis/sls/v1alpha1/groupversion_info.go index d8da43f..cc89e3f 100644 --- a/apis/sls/v1alpha1/groupversion_info.go +++ b/apis/sls/v1alpha1/groupversion_info.go @@ -63,5 +63,5 @@ var ( func init() { SchemeBuilder.Register(&Project{}, &ProjectList{}) - SchemeBuilder.Register(&LogStore{}, &StoreList{}) + SchemeBuilder.Register(&LogStore{}, &LogStoreList{}) } diff --git a/apis/sls/v1alpha1/logstore_types.go b/apis/sls/v1alpha1/logstore_types.go index c949844..e3c3024 100644 --- a/apis/sls/v1alpha1/logstore_types.go +++ b/apis/sls/v1alpha1/logstore_types.go @@ -90,8 +90,8 @@ type LogStore struct { // +kubebuilder:object:root=true -// StoreList contains a list of LogStore -type StoreList struct { +// LogStoreList contains a list of LogStore +type LogStoreList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []LogStore `json:"items"` diff --git a/apis/sls/v1alpha1/zz_generated.deepcopy.go b/apis/sls/v1alpha1/zz_generated.deepcopy.go index 2c7bd93..adba016 100644 --- a/apis/sls/v1alpha1/zz_generated.deepcopy.go +++ b/apis/sls/v1alpha1/zz_generated.deepcopy.go @@ -51,6 +51,38 @@ func (in *LogStore) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LogStoreList) DeepCopyInto(out *LogStoreList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]LogStore, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LogStoreList. +func (in *LogStoreList) DeepCopy() *LogStoreList { + if in == nil { + return nil + } + out := new(LogStoreList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *LogStoreList) 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 *LogStoreSpec) DeepCopyInto(out *LogStoreSpec) { *out = *in @@ -208,38 +240,6 @@ func (in *ProjectStatus) DeepCopy() *ProjectStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StoreList) DeepCopyInto(out *StoreList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]LogStore, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StoreList. -func (in *StoreList) DeepCopy() *StoreList { - if in == nil { - return nil - } - out := new(StoreList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *StoreList) 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 *StoreObservation) DeepCopyInto(out *StoreObservation) { *out = *in diff --git a/apis/sls/v1alpha1/zz_generated.managedlist.go b/apis/sls/v1alpha1/zz_generated.managedlist.go index cd9ebfb..9328c74 100644 --- a/apis/sls/v1alpha1/zz_generated.managedlist.go +++ b/apis/sls/v1alpha1/zz_generated.managedlist.go @@ -28,12 +28,3 @@ func (l *ProjectList) GetItems() []resource.Managed { } return items } - -// GetItems of this StoreList. -func (l *StoreList) 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/v1beta1/doc.go b/apis/v1beta1/doc.go index 188f71d..6901472 100644 --- a/apis/v1beta1/doc.go +++ b/apis/v1beta1/doc.go @@ -17,5 +17,5 @@ limitations under the License. // Package v1beta1 contains the core resources of the Alibaba Cloud. // +kubebuilder:object:generate=true // +groupName=alibaba.crossplane.io -// +versionName=v1alpha1 +// +versionName=v1beta1 package v1beta1 diff --git a/apis/v1beta1/register.go b/apis/v1beta1/register.go index 10f86ee..b586f4f 100644 --- a/apis/v1beta1/register.go +++ b/apis/v1beta1/register.go @@ -26,7 +26,7 @@ import ( // Package type metadata. const ( Group = "alibaba.crossplane.io" - Version = "v1alpha1" + Version = "v1beta1" ) var ( diff --git a/examples/provider.yaml b/examples/provider.yaml index d10cf92..abdadf8 100644 --- a/examples/provider.yaml +++ b/examples/provider.yaml @@ -5,7 +5,7 @@ metadata: name: crossplane-system --- -apiVersion: alibaba.crossplane.io/v1alpha1 +apiVersion: alibaba.crossplane.io/v1beta1 kind: ProviderConfig metadata: name: default diff --git a/package/crds/alibaba.crossplane.io_providerconfigs.yaml b/package/crds/alibaba.crossplane.io_providerconfigs.yaml index 2940ede..7371a86 100644 --- a/package/crds/alibaba.crossplane.io_providerconfigs.yaml +++ b/package/crds/alibaba.crossplane.io_providerconfigs.yaml @@ -26,7 +26,7 @@ spec: name: SECRET-NAME priority: 1 type: string - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: description: A ProviderConfig configures an Alibaba Cloud 'provider', i.e. a connection to a particular cloud account. diff --git a/package/crds/alibaba.crossplane.io_providerconfigusages.yaml b/package/crds/alibaba.crossplane.io_providerconfigusages.yaml index 030650d..641b995 100644 --- a/package/crds/alibaba.crossplane.io_providerconfigusages.yaml +++ b/package/crds/alibaba.crossplane.io_providerconfigusages.yaml @@ -31,7 +31,7 @@ spec: - jsonPath: .resourceRef.name name: RESOURCE-NAME type: string - name: v1alpha1 + name: v1beta1 schema: openAPIV3Schema: description: A ProviderConfigUsage indicates that a resource is using a ProviderConfig. diff --git a/pkg/clients/rds/rds_test.go b/pkg/clients/rds/rds_test.go index c58ad81..c95915a 100644 --- a/pkg/clients/rds/rds_test.go +++ b/pkg/clients/rds/rds_test.go @@ -285,7 +285,7 @@ func TestCreateAccount(t *testing.T) { for name, tc := range cases { t.Run(name, func(t *testing.T) { - err := c.DeleteDBInstance(tc.args.id) + err := c.CreateAccount(tc.args.id, tc.args.username, tc.args.password) if err != nil { e, ok := err.(*errors.ServerError) if ok { diff --git a/pkg/util/provider.go b/pkg/util/provider.go index e5e482b..cd18053 100644 --- a/pkg/util/provider.go +++ b/pkg/util/provider.go @@ -28,22 +28,13 @@ import ( aliv1beta1 "github.com/crossplane/provider-alibaba/apis/v1beta1" ) -const ( - // AccessKeyID is Alibaba Cloud Access key ID - AccessKeyID = "accessKeyId" - // AccessKeySecret is Alibaba Cloud Access Secret Key - AccessKeySecret = "accessKeySecret" - // SecurityToken is Alibaba Cloud STS token - SecurityToken = "securityToken" -) - const ( // ErrGetProviderConfig is the error of getting provider config ErrGetProviderConfig = "failed to get ProviderConfig" // ErrGetCredentials is the error of getting credentials ErrGetCredentials = "cannot get credentials" errFailedToExtractCredentials = "failed to extract Alibaba credentials" - errAccessKeyNotComplete = "AccessKeyID or AccessKeySecret not existed" + errAccessKeyNotComplete = "AccessKeyID or AccessKeySecret not existed" ) // AlibabaCredentials represents ak/sk, stsToken(maybe) information