diff --git a/apis/core/v1alpha1/identifiers.go b/apis/core/v1alpha1/identifiers.go index ff3195a..a04c753 100644 --- a/apis/core/v1alpha1/identifiers.go +++ b/apis/core/v1alpha1/identifiers.go @@ -20,15 +20,18 @@ type AWSIdentifiers struct { ARN *AWSResourceName `json:"arn,omitempty"` // NameOrId is a user-supplied string identifier for the resource. It may // or may not be globally unique, depending on the type of resource. - NameOrID *string `json:"nameOrID,omitempty"` + NameOrID string `json:"nameOrID,omitempty"` + // AdditionalKeys represents any additional arbitrary identifiers used when + // describing the target resource. + AdditionalKeys map[string]string `json:"additionalKeys,omitempty"` } // TargetKubernetesResource provides all the values necessary to identify a given ACK type // and override any metadata values when creating a resource of that type. type TargetKubernetesResource struct { // +kubebuilder:validation:Required - Group *string `json:"group"` + Group string `json:"group"` // +kubebuilder:validation:Required - Kind *string `json:"kind"` + Kind string `json:"kind"` Metadata *PartialObjectMeta `json:"metadata,omitempty"` } diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index 96cdba3..aba268b 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -30,10 +30,12 @@ func (in *AWSIdentifiers) DeepCopyInto(out *AWSIdentifiers) { *out = new(AWSResourceName) **out = **in } - if in.NameOrID != nil { - in, out := &in.NameOrID, &out.NameOrID - *out = new(string) - **out = **in + if in.AdditionalKeys != nil { + in, out := &in.AdditionalKeys, &out.AdditionalKeys + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } } @@ -248,18 +250,24 @@ func (in *ResourceMetadata) DeepCopy() *ResourceMetadata { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TargetKubernetesResource) DeepCopyInto(out *TargetKubernetesResource) { +func (in *SecretKeyReference) DeepCopyInto(out *SecretKeyReference) { *out = *in - if in.Group != nil { - in, out := &in.Group, &out.Group - *out = new(string) - **out = **in - } - if in.Kind != nil { - in, out := &in.Kind, &out.Kind - *out = new(string) - **out = **in + out.SecretReference = in.SecretReference +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeyReference. +func (in *SecretKeyReference) DeepCopy() *SecretKeyReference { + if in == nil { + return nil } + out := new(SecretKeyReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TargetKubernetesResource) DeepCopyInto(out *TargetKubernetesResource) { + *out = *in if in.Metadata != nil { in, out := &in.Metadata, &out.Metadata *out = new(PartialObjectMeta) diff --git a/config/crd/bases/services.k8s.aws_adoptedresources.yaml b/config/crd/bases/services.k8s.aws_adoptedresources.yaml index 310264d..a64411a 100644 --- a/config/crd/bases/services.k8s.aws_adoptedresources.yaml +++ b/config/crd/bases/services.k8s.aws_adoptedresources.yaml @@ -40,6 +40,12 @@ spec: description: AWSIdentifiers provide all unique ways to reference an AWS resource. properties: + additionalKeys: + additionalProperties: + type: string + description: AdditionalKeys represents any additional arbitrary + identifiers used when describing the target resource. + type: object arn: description: ARN is the AWS Resource Name for the resource. It is a globally unique identifier. diff --git a/pkg/runtime/adoption_reconciler.go b/pkg/runtime/adoption_reconciler.go index 29cfb81..fca7b7e 100644 --- a/pkg/runtime/adoption_reconciler.go +++ b/pkg/runtime/adoption_reconciler.go @@ -337,8 +337,8 @@ func (r *adoptionReconciler) getTargetResourceGroupKind( res *ackv1alpha1.AdoptedResource, ) schema.GroupKind { return schema.GroupKind{ - Group: *res.Spec.Kubernetes.Group, - Kind: *res.Spec.Kubernetes.Kind, + Group: res.Spec.Kubernetes.Group, + Kind: res.Spec.Kubernetes.Kind, } }