diff --git a/apis/dis/v1alpha1/zz_checkpointv2_types.go b/apis/dis/v1alpha1/zz_checkpointv2_types.go index 8ca19f9..be08497 100755 --- a/apis/dis/v1alpha1/zz_checkpointv2_types.go +++ b/apis/dis/v1alpha1/zz_checkpointv2_types.go @@ -17,8 +17,18 @@ type CheckpointV2InitParameters struct { // Name of the consumer application to be created // The application name contains 1 to 200 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/dis/v1alpha1.AppV2 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractDisAppName() AppName *string `json:"appName,omitempty" tf:"app_name,omitempty"` + // Reference to a AppV2 in dis to populate appName. + // +kubebuilder:validation:Optional + AppNameRef *v1.Reference `json:"appNameRef,omitempty" tf:"-"` + + // Selector for a AppV2 in dis to populate appName. + // +kubebuilder:validation:Optional + AppNameSelector *v1.Selector `json:"appNameSelector,omitempty" tf:"-"` + // Type of the checkpoint. LAST_READ: Only sequence numbers are recorded in databases. // Default value: LAST_READ CheckpointType *string `json:"checkpointType,omitempty" tf:"checkpoint_type,omitempty"` @@ -36,7 +46,17 @@ type CheckpointV2InitParameters struct { // Name of the stream. The stream name can contain 1 to 64 characters, // including letters, digits, underscores (_), and hyphens (-). + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/dis/v1alpha1.StreamV2 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractDisStreamName() StreamName *string `json:"streamName,omitempty" tf:"stream_name,omitempty"` + + // Reference to a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameRef *v1.Reference `json:"streamNameRef,omitempty" tf:"-"` + + // Selector for a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameSelector *v1.Selector `json:"streamNameSelector,omitempty" tf:"-"` } type CheckpointV2Observation struct { @@ -71,9 +91,19 @@ type CheckpointV2Parameters struct { // Name of the consumer application to be created // The application name contains 1 to 200 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/dis/v1alpha1.AppV2 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractDisAppName() // +kubebuilder:validation:Optional AppName *string `json:"appName,omitempty" tf:"app_name,omitempty"` + // Reference to a AppV2 in dis to populate appName. + // +kubebuilder:validation:Optional + AppNameRef *v1.Reference `json:"appNameRef,omitempty" tf:"-"` + + // Selector for a AppV2 in dis to populate appName. + // +kubebuilder:validation:Optional + AppNameSelector *v1.Selector `json:"appNameSelector,omitempty" tf:"-"` + // Type of the checkpoint. LAST_READ: Only sequence numbers are recorded in databases. // Default value: LAST_READ // +kubebuilder:validation:Optional @@ -95,8 +125,18 @@ type CheckpointV2Parameters struct { // Name of the stream. The stream name can contain 1 to 64 characters, // including letters, digits, underscores (_), and hyphens (-). + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/dis/v1alpha1.StreamV2 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractDisStreamName() // +kubebuilder:validation:Optional StreamName *string `json:"streamName,omitempty" tf:"stream_name,omitempty"` + + // Reference to a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameRef *v1.Reference `json:"streamNameRef,omitempty" tf:"-"` + + // Selector for a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameSelector *v1.Selector `json:"streamNameSelector,omitempty" tf:"-"` } // CheckpointV2Spec defines the desired state of CheckpointV2 @@ -135,10 +175,8 @@ type CheckpointV2Status struct { type CheckpointV2 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.appName) || (has(self.initProvider) && has(self.initProvider.appName))",message="spec.forProvider.appName is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.partitionId) || (has(self.initProvider) && has(self.initProvider.partitionId))",message="spec.forProvider.partitionId is a required parameter" // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.sequenceNumber) || (has(self.initProvider) && has(self.initProvider.sequenceNumber))",message="spec.forProvider.sequenceNumber is a required parameter" - // +kubebuilder:validation:XValidation:rule="!('*' in self.managementPolicies || 'Create' in self.managementPolicies || 'Update' in self.managementPolicies) || has(self.forProvider.streamName) || (has(self.initProvider) && has(self.initProvider.streamName))",message="spec.forProvider.streamName is a required parameter" Spec CheckpointV2Spec `json:"spec"` Status CheckpointV2Status `json:"status,omitempty"` } diff --git a/apis/dis/v1alpha1/zz_dumptaskv2_types.go b/apis/dis/v1alpha1/zz_dumptaskv2_types.go index 9ff2950..f7e69c5 100755 --- a/apis/dis/v1alpha1/zz_dumptaskv2_types.go +++ b/apis/dis/v1alpha1/zz_dumptaskv2_types.go @@ -32,7 +32,17 @@ type DumpTaskV2InitParameters struct { ObsProcessingSchema []ObsProcessingSchemaInitParameters `json:"obsProcessingSchema,omitempty" tf:"obs_processing_schema,omitempty"` // Name of the stream. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/dis/v1alpha1.StreamV2 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractDisStreamName() StreamName *string `json:"streamName,omitempty" tf:"stream_name,omitempty"` + + // Reference to a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameRef *v1.Reference `json:"streamNameRef,omitempty" tf:"-"` + + // Selector for a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameSelector *v1.Selector `json:"streamNameSelector,omitempty" tf:"-"` } type DumpTaskV2Observation struct { @@ -101,8 +111,18 @@ type DumpTaskV2Parameters struct { ObsProcessingSchema []ObsProcessingSchemaParameters `json:"obsProcessingSchema,omitempty" tf:"obs_processing_schema,omitempty"` // Name of the stream. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/dis/v1alpha1.StreamV2 + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractDisStreamName() // +kubebuilder:validation:Optional StreamName *string `json:"streamName,omitempty" tf:"stream_name,omitempty"` + + // Reference to a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameRef *v1.Reference `json:"streamNameRef,omitempty" tf:"-"` + + // Selector for a StreamV2 in dis to populate streamName. + // +kubebuilder:validation:Optional + StreamNameSelector *v1.Selector `json:"streamNameSelector,omitempty" tf:"-"` } type ObsDestinationDescriptorInitParameters struct { @@ -128,8 +148,18 @@ type ObsDestinationDescriptorInitParameters struct { FilePrefix *string `json:"filePrefix,omitempty" tf:"file_prefix,omitempty"` // Name of the OBS bucket used to store data from the DIS stream. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/obs/v1alpha1.Bucket + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractObsBucket() ObsBucketPath *string `json:"obsBucketPath,omitempty" tf:"obs_bucket_path,omitempty"` + // Reference to a Bucket in obs to populate obsBucketPath. + // +kubebuilder:validation:Optional + ObsBucketPathRef *v1.Reference `json:"obsBucketPathRef,omitempty" tf:"-"` + + // Selector for a Bucket in obs to populate obsBucketPath. + // +kubebuilder:validation:Optional + ObsBucketPathSelector *v1.Selector `json:"obsBucketPathSelector,omitempty" tf:"-"` + // Directory structure of the object file written into OBS. // The directory structure is in the format of yyyy/MM/dd/HH/mm (time at which the dump task was created). // Possible values: @@ -207,8 +237,18 @@ type ObsDestinationDescriptorParameters struct { FilePrefix *string `json:"filePrefix,omitempty" tf:"file_prefix,omitempty"` // Name of the OBS bucket used to store data from the DIS stream. + // +crossplane:generate:reference:type=github.com/opentelekomcloud/provider-opentelekomcloud/apis/obs/v1alpha1.Bucket + // +crossplane:generate:reference:extractor=github.com/opentelekomcloud/provider-opentelekomcloud/config/common.ExtractObsBucket() + // +kubebuilder:validation:Optional + ObsBucketPath *string `json:"obsBucketPath,omitempty" tf:"obs_bucket_path,omitempty"` + + // Reference to a Bucket in obs to populate obsBucketPath. + // +kubebuilder:validation:Optional + ObsBucketPathRef *v1.Reference `json:"obsBucketPathRef,omitempty" tf:"-"` + + // Selector for a Bucket in obs to populate obsBucketPath. // +kubebuilder:validation:Optional - ObsBucketPath *string `json:"obsBucketPath" tf:"obs_bucket_path,omitempty"` + ObsBucketPathSelector *v1.Selector `json:"obsBucketPathSelector,omitempty" tf:"-"` // Directory structure of the object file written into OBS. // The directory structure is in the format of yyyy/MM/dd/HH/mm (time at which the dump task was created). @@ -330,9 +370,8 @@ type DumpTaskV2Status struct { type DumpTaskV2 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.streamName) || (has(self.initProvider) && has(self.initProvider.streamName))",message="spec.forProvider.streamName is a required parameter" - Spec DumpTaskV2Spec `json:"spec"` - Status DumpTaskV2Status `json:"status,omitempty"` + Spec DumpTaskV2Spec `json:"spec"` + Status DumpTaskV2Status `json:"status,omitempty"` } // +kubebuilder:object:root=true diff --git a/apis/dis/v1alpha1/zz_generated.deepcopy.go b/apis/dis/v1alpha1/zz_generated.deepcopy.go index 5469c68..5d2c279 100644 --- a/apis/dis/v1alpha1/zz_generated.deepcopy.go +++ b/apis/dis/v1alpha1/zz_generated.deepcopy.go @@ -9,6 +9,7 @@ Copyright 2022 Upbound Inc. package v1alpha1 import ( + "github.com/crossplane/crossplane-runtime/apis/common/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -229,6 +230,16 @@ func (in *CheckpointV2InitParameters) DeepCopyInto(out *CheckpointV2InitParamete *out = new(string) **out = **in } + if in.AppNameRef != nil { + in, out := &in.AppNameRef, &out.AppNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AppNameSelector != nil { + in, out := &in.AppNameSelector, &out.AppNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.CheckpointType != nil { in, out := &in.CheckpointType, &out.CheckpointType *out = new(string) @@ -254,6 +265,16 @@ func (in *CheckpointV2InitParameters) DeepCopyInto(out *CheckpointV2InitParamete *out = new(string) **out = **in } + if in.StreamNameRef != nil { + in, out := &in.StreamNameRef, &out.StreamNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.StreamNameSelector != nil { + in, out := &in.StreamNameSelector, &out.StreamNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointV2InitParameters. @@ -356,6 +377,16 @@ func (in *CheckpointV2Parameters) DeepCopyInto(out *CheckpointV2Parameters) { *out = new(string) **out = **in } + if in.AppNameRef != nil { + in, out := &in.AppNameRef, &out.AppNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.AppNameSelector != nil { + in, out := &in.AppNameSelector, &out.AppNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.CheckpointType != nil { in, out := &in.CheckpointType, &out.CheckpointType *out = new(string) @@ -381,6 +412,16 @@ func (in *CheckpointV2Parameters) DeepCopyInto(out *CheckpointV2Parameters) { *out = new(string) **out = **in } + if in.StreamNameRef != nil { + in, out := &in.StreamNameRef, &out.StreamNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.StreamNameSelector != nil { + in, out := &in.StreamNameSelector, &out.StreamNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheckpointV2Parameters. @@ -487,6 +528,16 @@ func (in *DumpTaskV2InitParameters) DeepCopyInto(out *DumpTaskV2InitParameters) *out = new(string) **out = **in } + if in.StreamNameRef != nil { + in, out := &in.StreamNameRef, &out.StreamNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.StreamNameSelector != nil { + in, out := &in.StreamNameSelector, &out.StreamNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DumpTaskV2InitParameters. @@ -644,6 +695,16 @@ func (in *DumpTaskV2Parameters) DeepCopyInto(out *DumpTaskV2Parameters) { *out = new(string) **out = **in } + if in.StreamNameRef != nil { + in, out := &in.StreamNameRef, &out.StreamNameRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.StreamNameSelector != nil { + in, out := &in.StreamNameSelector, &out.StreamNameSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DumpTaskV2Parameters. @@ -724,6 +785,16 @@ func (in *ObsDestinationDescriptorInitParameters) DeepCopyInto(out *ObsDestinati *out = new(string) **out = **in } + if in.ObsBucketPathRef != nil { + in, out := &in.ObsBucketPathRef, &out.ObsBucketPathRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ObsBucketPathSelector != nil { + in, out := &in.ObsBucketPathSelector, &out.ObsBucketPathSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.PartitionFormat != nil { in, out := &in.PartitionFormat, &out.PartitionFormat *out = new(string) @@ -844,6 +915,16 @@ func (in *ObsDestinationDescriptorParameters) DeepCopyInto(out *ObsDestinationDe *out = new(string) **out = **in } + if in.ObsBucketPathRef != nil { + in, out := &in.ObsBucketPathRef, &out.ObsBucketPathRef + *out = new(v1.Reference) + (*in).DeepCopyInto(*out) + } + if in.ObsBucketPathSelector != nil { + in, out := &in.ObsBucketPathSelector, &out.ObsBucketPathSelector + *out = new(v1.Selector) + (*in).DeepCopyInto(*out) + } if in.PartitionFormat != nil { in, out := &in.PartitionFormat, &out.PartitionFormat *out = new(string) diff --git a/apis/dis/v1alpha1/zz_generated.resolvers.go b/apis/dis/v1alpha1/zz_generated.resolvers.go new file mode 100644 index 0000000..0c8ae54 --- /dev/null +++ b/apis/dis/v1alpha1/zz_generated.resolvers.go @@ -0,0 +1,167 @@ +/* +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/opentelekomcloud/provider-opentelekomcloud/apis/obs/v1alpha1" + common "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" + errors "github.com/pkg/errors" + client "sigs.k8s.io/controller-runtime/pkg/client" +) + +// ResolveReferences of this CheckpointV2. +func (mg *CheckpointV2) 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.FromPtrValue(mg.Spec.ForProvider.AppName), + Extract: common.ExtractDisAppName(), + Reference: mg.Spec.ForProvider.AppNameRef, + Selector: mg.Spec.ForProvider.AppNameSelector, + To: reference.To{ + List: &AppV2List{}, + Managed: &AppV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.AppName") + } + mg.Spec.ForProvider.AppName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.AppNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.StreamName), + Extract: common.ExtractDisStreamName(), + Reference: mg.Spec.ForProvider.StreamNameRef, + Selector: mg.Spec.ForProvider.StreamNameSelector, + To: reference.To{ + List: &StreamV2List{}, + Managed: &StreamV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.StreamName") + } + mg.Spec.ForProvider.StreamName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.StreamNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.AppName), + Extract: common.ExtractDisAppName(), + Reference: mg.Spec.InitProvider.AppNameRef, + Selector: mg.Spec.InitProvider.AppNameSelector, + To: reference.To{ + List: &AppV2List{}, + Managed: &AppV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.AppName") + } + mg.Spec.InitProvider.AppName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.AppNameRef = rsp.ResolvedReference + + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.StreamName), + Extract: common.ExtractDisStreamName(), + Reference: mg.Spec.InitProvider.StreamNameRef, + Selector: mg.Spec.InitProvider.StreamNameSelector, + To: reference.To{ + List: &StreamV2List{}, + Managed: &StreamV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.StreamName") + } + mg.Spec.InitProvider.StreamName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.StreamNameRef = rsp.ResolvedReference + + return nil +} + +// ResolveReferences of this DumpTaskV2. +func (mg *DumpTaskV2) ResolveReferences(ctx context.Context, c client.Reader) error { + r := reference.NewAPIResolver(c, mg) + + var rsp reference.ResolutionResponse + var err error + + for i3 := 0; i3 < len(mg.Spec.ForProvider.ObsDestinationDescriptor); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ObsDestinationDescriptor[i3].ObsBucketPath), + Extract: common.ExtractObsBucket(), + Reference: mg.Spec.ForProvider.ObsDestinationDescriptor[i3].ObsBucketPathRef, + Selector: mg.Spec.ForProvider.ObsDestinationDescriptor[i3].ObsBucketPathSelector, + To: reference.To{ + List: &v1alpha1.BucketList{}, + Managed: &v1alpha1.Bucket{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.ObsDestinationDescriptor[i3].ObsBucketPath") + } + mg.Spec.ForProvider.ObsDestinationDescriptor[i3].ObsBucketPath = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.ObsDestinationDescriptor[i3].ObsBucketPathRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.StreamName), + Extract: common.ExtractDisStreamName(), + Reference: mg.Spec.ForProvider.StreamNameRef, + Selector: mg.Spec.ForProvider.StreamNameSelector, + To: reference.To{ + List: &StreamV2List{}, + Managed: &StreamV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.ForProvider.StreamName") + } + mg.Spec.ForProvider.StreamName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.ForProvider.StreamNameRef = rsp.ResolvedReference + + for i3 := 0; i3 < len(mg.Spec.InitProvider.ObsDestinationDescriptor); i3++ { + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.ObsDestinationDescriptor[i3].ObsBucketPath), + Extract: common.ExtractObsBucket(), + Reference: mg.Spec.InitProvider.ObsDestinationDescriptor[i3].ObsBucketPathRef, + Selector: mg.Spec.InitProvider.ObsDestinationDescriptor[i3].ObsBucketPathSelector, + To: reference.To{ + List: &v1alpha1.BucketList{}, + Managed: &v1alpha1.Bucket{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.ObsDestinationDescriptor[i3].ObsBucketPath") + } + mg.Spec.InitProvider.ObsDestinationDescriptor[i3].ObsBucketPath = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.ObsDestinationDescriptor[i3].ObsBucketPathRef = rsp.ResolvedReference + + } + rsp, err = r.Resolve(ctx, reference.ResolutionRequest{ + CurrentValue: reference.FromPtrValue(mg.Spec.InitProvider.StreamName), + Extract: common.ExtractDisStreamName(), + Reference: mg.Spec.InitProvider.StreamNameRef, + Selector: mg.Spec.InitProvider.StreamNameSelector, + To: reference.To{ + List: &StreamV2List{}, + Managed: &StreamV2{}, + }, + }) + if err != nil { + return errors.Wrap(err, "mg.Spec.InitProvider.StreamName") + } + mg.Spec.InitProvider.StreamName = reference.ToPtrValue(rsp.ResolvedValue) + mg.Spec.InitProvider.StreamNameRef = rsp.ResolvedReference + + return nil +} diff --git a/config/common/common.go b/config/common/common.go index ec036be..d0ed957 100644 --- a/config/common/common.go +++ b/config/common/common.go @@ -32,7 +32,19 @@ const ( // AgencyNameExtractor is the golang path to ExtractAgencyName function // in this package. - AgencyNameExtractor = SelfPackagePath + ".ExtractAgencyName()" + AgencyNameExtractor = SelfPackagePath + ".ExtractAgencyName()" // AgencyNameExtractor is the golang path to ExtractAgencyName function + + // DisStreamNameExtractor is the golang path to ExtractDisStreamName function + // in this package. + DisStreamNameExtractor = SelfPackagePath + ".ExtractDisStreamName()" + + // DisAppNameExtractor is the golang path to ExtractDisAppName function + // in this package. + DisAppNameExtractor = SelfPackagePath + ".ExtractDisAppName()" + + // ObsBucketExtractor is the golang path to ExtractObsBucket function + // in this package. + ObsBucketExtractor = SelfPackagePath + ".ExtractObsBucket()" ) // ExtractNetworkID extracts the value of `spec.forProvider.network_id` @@ -162,3 +174,66 @@ func ExtractAgencyName() xpref.ExtractValueFn { return "" } } + +// ExtractDisStreamName extracts the value of `spec.forProvider.name` +// from a Terraformed resource. If mr is not a Terraformed +// resource, returns an empty string. +func ExtractDisStreamName() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Terraformed) + if !ok { + return "" + } + o, err := tr.GetParameters() + if err != nil { + return "" + } + if k := o["name"]; k != nil { + return k.(string) + } + + return "" + } +} + +// ExtractDisAppName extracts the value of `spec.forProvider.name` +// from a Terraformed resource. If mr is not a Terraformed +// resource, returns an empty string. +func ExtractDisAppName() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Terraformed) + if !ok { + return "" + } + o, err := tr.GetParameters() + if err != nil { + return "" + } + if k := o["name"]; k != nil { + return k.(string) + } + + return "" + } +} + +// ExtractObsBucket extracts the value of `spec.forProvider.bucket` +// from a Terraformed resource. If mr is not a Terraformed +// resource, returns an empty string. +func ExtractObsBucket() xpref.ExtractValueFn { + return func(mr xpresource.Managed) string { + tr, ok := mr.(resource.Terraformed) + if !ok { + return "" + } + o, err := tr.GetParameters() + if err != nil { + return "" + } + if k := o["bucket"]; k != nil { + return k.(string) + } + + return "" + } +} diff --git a/config/deh/config.go b/config/deh/config.go index 72dbeab..49f3d0b 100644 --- a/config/deh/config.go +++ b/config/deh/config.go @@ -4,5 +4,7 @@ import "github.com/crossplane/upjet/pkg/config" // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { - // Nothing for now + p.AddResourceConfigurator("opentelekomcloud_deh_host_v1", func(r *config.Resource) { + r.UseAsync = true + }) } diff --git a/config/dis/config.go b/config/dis/config.go index 49e52b9..a55a59a 100644 --- a/config/dis/config.go +++ b/config/dis/config.go @@ -1,8 +1,38 @@ package dis -import "github.com/crossplane/upjet/pkg/config" +import ( + "github.com/crossplane/upjet/pkg/config" + "github.com/opentelekomcloud/provider-opentelekomcloud/config/common" +) // Configure configures individual resources by adding custom ResourceConfigurators. func Configure(p *config.Provider) { - // Nothing for now + p.AddResourceConfigurator("opentelekomcloud_dis_stream_v2", func(r *config.Resource) { + r.UseAsync = true + }) + p.AddResourceConfigurator("opentelekomcloud_dis_dump_task_v2", func(r *config.Resource) { + r.UseAsync = true + r.References["stream_name"] = config.Reference{ + TerraformName: "opentelekomcloud_dis_stream_v2", + Extractor: common.DisStreamNameExtractor, + } + r.References["obs_destination_descriptor.obs_bucket_path"] = config.Reference{ + TerraformName: "opentelekomcloud_obs_bucket", + Extractor: common.ObsBucketExtractor, + } + }) + p.AddResourceConfigurator("opentelekomcloud_dis_checkpoint_v2", func(r *config.Resource) { + r.UseAsync = true + r.References["app_name"] = config.Reference{ + TerraformName: "opentelekomcloud_dis_app_v2", + Extractor: common.DisAppNameExtractor, + } + r.References["stream_name"] = config.Reference{ + TerraformName: "opentelekomcloud_dis_stream_v2", + Extractor: common.DisStreamNameExtractor, + } + }) + p.AddResourceConfigurator("opentelekomcloud_dis_app_v2", func(r *config.Resource) { + r.UseAsync = true + }) } diff --git a/examples-generated/dis/v1alpha1/checkpointv2.yaml b/examples-generated/dis/v1alpha1/checkpointv2.yaml index 651da34..da3167a 100644 --- a/examples-generated/dis/v1alpha1/checkpointv2.yaml +++ b/examples-generated/dis/v1alpha1/checkpointv2.yaml @@ -8,11 +8,15 @@ metadata: name: checkpoint-1 spec: forProvider: - appName: app_name + appNameSelector: + matchLabels: + testing.upbound.io/example-name: app_1 metadata: my_first_checkpoint partitionId: "0" sequenceNumber: "0" - streamName: MyStream + streamNameSelector: + matchLabels: + testing.upbound.io/example-name: stream_1 --- diff --git a/examples-generated/dis/v1alpha1/dumptaskv2.yaml b/examples-generated/dis/v1alpha1/dumptaskv2.yaml index cd79c23..acc3bf7 100644 --- a/examples-generated/dis/v1alpha1/dumptaskv2.yaml +++ b/examples-generated/dis/v1alpha1/dumptaskv2.yaml @@ -15,11 +15,15 @@ spec: deliverTimeInterval: 30 destinationFileType: text filePrefix: _pf - obsBucketPath: my-tf-test-bucket + obsBucketPathSelector: + matchLabels: + testing.upbound.io/example-name: bucket partitionFormat: yyyy/MM/dd/HH/mm recordDelimiter: '|' taskName: my_task - streamName: MyStream + streamNameSelector: + matchLabels: + testing.upbound.io/example-name: stream_1 --- diff --git a/examples/dis/checkpoint.yaml b/examples/dis/checkpoint.yaml new file mode 100644 index 0000000..911064c --- /dev/null +++ b/examples/dis/checkpoint.yaml @@ -0,0 +1,56 @@ +apiVersion: dis.opentelekomcloud.crossplane.io/v1alpha1 +kind: AppV2 +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/checkpointv2 + labels: + testing.upbound.io/example-name: sample-app + name: sample-app +spec: + forProvider: + name: crossplane-dis-app + +--- + +apiVersion: dis.opentelekomcloud.crossplane.io/v1alpha1 +kind: StreamV2 +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/checkpointv2 + labels: + testing.upbound.io/example-name: sample-stream + name: sample-stream +spec: + forProvider: + autoScaleMaxPartitionCount: 4 + autoScaleMinPartitionCount: 1 + compressionFormat: zip + dataType: BLOB + name: crossplane-dis-stream + partitionCount: 3 + retentionPeriod: 24 + streamType: COMMON + tags: + managed-by: crossplane + +--- + +apiVersion: dis.opentelekomcloud.crossplane.io/v1alpha1 +kind: CheckpointV2 +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/checkpointv2 + labels: + testing.upbound.io/example-name: sample-checkpoint + name: sample-checkpoint +spec: + forProvider: + appNameSelector: + matchLabels: + testing.upbound.io/example-name: sample-app + metadata: crossplane-dis-checkpoint + partitionId: "0" + sequenceNumber: "0" + streamNameSelector: + matchLabels: + testing.upbound.io/example-name: sample-stream diff --git a/examples/dis/dump_task.yaml b/examples/dis/dump_task.yaml new file mode 100644 index 0000000..0485a9d --- /dev/null +++ b/examples/dis/dump_task.yaml @@ -0,0 +1,79 @@ +apiVersion: obs.opentelekomcloud.crossplane.io/v1alpha1 +kind: Bucket +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/dumptaskv2 + labels: + testing.upbound.io/example-name: sample-bucket + name: sample-bucket +spec: + forProvider: + acl: private + bucket: crossplane-dis-bucket + storageClass: STANDARD + +--- + +apiVersion: dis.opentelekomcloud.crossplane.io/v1alpha1 +kind: AppV2 +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/dumptaskv2 + labels: + testing.upbound.io/example-name: sample-app + name: sample-app +spec: + forProvider: + name: crossplane-dis-app + +--- + +apiVersion: dis.opentelekomcloud.crossplane.io/v1alpha1 +kind: StreamV2 +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/dumptaskv2 + labels: + testing.upbound.io/example-name: sample-stream + name: sample-stream +spec: + forProvider: + autoScaleMaxPartitionCount: 4 + autoScaleMinPartitionCount: 1 + compressionFormat: zip + dataType: BLOB + name: crossplane-dis-stream + partitionCount: 3 + retentionPeriod: 24 + streamType: COMMON + tags: + managed-by: crossplane + +--- + +apiVersion: dis.opentelekomcloud.crossplane.io/v1alpha1 +kind: DumpTaskV2 +metadata: + annotations: + meta.upbound.io/example-id: dis/v1alpha1/dumptaskv2 + labels: + testing.upbound.io/example-name: sample-task + name: sample-task +spec: + forProvider: + destination: OBS + obsDestinationDescriptor: + - agencyName: dis_admin_agency + consumerStrategy: LATEST + deliverTimeInterval: 30 + destinationFileType: text + filePrefix: _pf + obsBucketPathSelector: + matchLabels: + testing.upbound.io/example-name: sample-bucket + partitionFormat: yyyy/MM/dd/HH/mm + recordDelimiter: '|' + taskName: crossplane-dis-task + streamNameSelector: + matchLabels: + testing.upbound.io/example-name: sample-stream diff --git a/package/crds/dis.opentelekomcloud.crossplane.io_checkpointv2s.yaml b/package/crds/dis.opentelekomcloud.crossplane.io_checkpointv2s.yaml index 021bb55..c1018de 100644 --- a/package/crds/dis.opentelekomcloud.crossplane.io_checkpointv2s.yaml +++ b/package/crds/dis.opentelekomcloud.crossplane.io_checkpointv2s.yaml @@ -78,6 +78,80 @@ spec: Name of the consumer application to be created The application name contains 1 to 200 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. type: string + appNameRef: + description: Reference to a AppV2 in dis to populate appName. + 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 + appNameSelector: + description: Selector for a AppV2 in dis to populate appName. + 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 checkpointType: description: |- Type of the checkpoint. LAST_READ: Only sequence numbers are recorded in databases. @@ -102,6 +176,80 @@ spec: Name of the stream. The stream name can contain 1 to 64 characters, including letters, digits, underscores (_), and hyphens (-). type: string + streamNameRef: + description: Reference to a StreamV2 in dis to populate streamName. + 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 + streamNameSelector: + description: Selector for a StreamV2 in dis to populate streamName. + 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: |- @@ -121,6 +269,80 @@ spec: Name of the consumer application to be created The application name contains 1 to 200 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. type: string + appNameRef: + description: Reference to a AppV2 in dis to populate appName. + 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 + appNameSelector: + description: Selector for a AppV2 in dis to populate appName. + 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 checkpointType: description: |- Type of the checkpoint. LAST_READ: Only sequence numbers are recorded in databases. @@ -145,6 +367,80 @@ spec: Name of the stream. The stream name can contain 1 to 64 characters, including letters, digits, underscores (_), and hyphens (-). type: string + streamNameRef: + description: Reference to a StreamV2 in dis to populate streamName. + 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 + streamNameSelector: + description: Selector for a StreamV2 in dis to populate streamName. + 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: @@ -314,10 +610,6 @@ spec: - forProvider type: object x-kubernetes-validations: - - message: spec.forProvider.appName is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.appName) - || (has(self.initProvider) && has(self.initProvider.appName))' - message: spec.forProvider.partitionId is a required parameter rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.partitionId) @@ -326,10 +618,6 @@ spec: rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies || ''Update'' in self.managementPolicies) || has(self.forProvider.sequenceNumber) || (has(self.initProvider) && has(self.initProvider.sequenceNumber))' - - message: spec.forProvider.streamName is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.streamName) - || (has(self.initProvider) && has(self.initProvider.streamName))' status: description: CheckpointV2Status defines the observed state of CheckpointV2. properties: diff --git a/package/crds/dis.opentelekomcloud.crossplane.io_dumptaskv2s.yaml b/package/crds/dis.opentelekomcloud.crossplane.io_dumptaskv2s.yaml index c07a76d..464684a 100644 --- a/package/crds/dis.opentelekomcloud.crossplane.io_dumptaskv2s.yaml +++ b/package/crds/dis.opentelekomcloud.crossplane.io_dumptaskv2s.yaml @@ -115,6 +115,80 @@ spec: description: Name of the OBS bucket used to store data from the DIS stream. type: string + obsBucketPathRef: + description: Reference to a Bucket in obs to populate obsBucketPath. + 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 + obsBucketPathSelector: + description: Selector for a Bucket in obs to populate obsBucketPath. + 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 partitionFormat: description: |- Directory structure of the object file written into OBS. @@ -159,6 +233,80 @@ spec: streamName: description: Name of the stream. type: string + streamNameRef: + description: Reference to a StreamV2 in dis to populate streamName. + 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 + streamNameSelector: + description: Selector for a StreamV2 in dis to populate streamName. + 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: |- @@ -215,6 +363,80 @@ spec: description: Name of the OBS bucket used to store data from the DIS stream. type: string + obsBucketPathRef: + description: Reference to a Bucket in obs to populate obsBucketPath. + 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 + obsBucketPathSelector: + description: Selector for a Bucket in obs to populate obsBucketPath. + 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 partitionFormat: description: |- Directory structure of the object file written into OBS. @@ -259,6 +481,80 @@ spec: streamName: description: Name of the stream. type: string + streamNameRef: + description: Reference to a StreamV2 in dis to populate streamName. + 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 + streamNameSelector: + description: Selector for a StreamV2 in dis to populate streamName. + 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: @@ -427,11 +723,6 @@ spec: required: - forProvider type: object - x-kubernetes-validations: - - message: spec.forProvider.streamName is a required parameter - rule: '!(''*'' in self.managementPolicies || ''Create'' in self.managementPolicies - || ''Update'' in self.managementPolicies) || has(self.forProvider.streamName) - || (has(self.initProvider) && has(self.initProvider.streamName))' status: description: DumpTaskV2Status defines the observed state of DumpTaskV2. properties: