From e703dc19d69f13ecc440b5956c24245d11ac8a83 Mon Sep 17 00:00:00 2001 From: Alper Rifat Ulucinar Date: Fri, 31 May 2024 04:08:59 +0300 Subject: [PATCH] Delete the generated CRD API hub & spoke files during generation Signed-off-by: Alper Rifat Ulucinar --- .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 28 --------------- .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 13 ------- .../v1beta1/zz_generated.conversion_hubs.go | 13 ------- .../v1beta1/zz_generated.conversion_hubs.go | 16 --------- .../v1beta1/zz_generated.conversion_hubs.go | 13 ------- .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 13 ------- .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ apis/generate.go | 1 + .../v1beta1/zz_generated.conversion_hubs.go | 22 ------------ .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ .../v1beta1/zz_generated.conversion_hubs.go | 19 ----------- .../v1beta1/zz_generated.conversion_spokes.go | 34 ------------------- .../v1beta1/zz_generated.conversion_hubs.go | 10 ------ 20 files changed, 1 insertion(+), 271 deletions(-) delete mode 100755 apis/appflow/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/appintegrations/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/appmesh/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/autoscalingplans/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/batch/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/budgets/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/codepipeline/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/datasync/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/dlm/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/elastictranscoder/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/emrserverless/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/firehose/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/fis/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/kendra/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/kinesisanalytics/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/mediaconvert/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/networkfirewall/v1beta1/zz_generated.conversion_hubs.go delete mode 100755 apis/opensearchserverless/v1beta1/zz_generated.conversion_spokes.go delete mode 100755 apis/resourcegroups/v1beta1/zz_generated.conversion_hubs.go diff --git a/apis/appflow/v1beta1/zz_generated.conversion_hubs.go b/apis/appflow/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 65811d4bf3..0000000000 --- a/apis/appflow/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Flow) Hub() {} diff --git a/apis/appintegrations/v1beta1/zz_generated.conversion_hubs.go b/apis/appintegrations/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 0f79769b79..0000000000 --- a/apis/appintegrations/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *EventIntegration) Hub() {} diff --git a/apis/appmesh/v1beta1/zz_generated.conversion_hubs.go b/apis/appmesh/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 165ba4d2bb..0000000000 --- a/apis/appmesh/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *GatewayRoute) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Mesh) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Route) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *VirtualGateway) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *VirtualNode) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *VirtualRouter) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *VirtualService) Hub() {} diff --git a/apis/autoscalingplans/v1beta1/zz_generated.conversion_hubs.go b/apis/autoscalingplans/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 145765452a..0000000000 --- a/apis/autoscalingplans/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *ScalingPlan) Hub() {} diff --git a/apis/batch/v1beta1/zz_generated.conversion_hubs.go b/apis/batch/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index a1bf6e20ea..0000000000 --- a/apis/batch/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *JobDefinition) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *SchedulingPolicy) Hub() {} diff --git a/apis/budgets/v1beta1/zz_generated.conversion_hubs.go b/apis/budgets/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index c7c1d28b6e..0000000000 --- a/apis/budgets/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Budget) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *BudgetAction) Hub() {} diff --git a/apis/codepipeline/v1beta1/zz_generated.conversion_hubs.go b/apis/codepipeline/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 3c6e64a922..0000000000 --- a/apis/codepipeline/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,16 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Codepipeline) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *CustomActionType) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Webhook) Hub() {} diff --git a/apis/datasync/v1beta1/zz_generated.conversion_hubs.go b/apis/datasync/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 6f29d8dfee..0000000000 --- a/apis/datasync/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *LocationS3) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Task) Hub() {} diff --git a/apis/dlm/v1beta1/zz_generated.conversion_hubs.go b/apis/dlm/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index ae7d0b1146..0000000000 --- a/apis/dlm/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *LifecyclePolicy) Hub() {} diff --git a/apis/elastictranscoder/v1beta1/zz_generated.conversion_hubs.go b/apis/elastictranscoder/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 527818071f..0000000000 --- a/apis/elastictranscoder/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,13 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Pipeline) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Preset) Hub() {} diff --git a/apis/emrserverless/v1beta1/zz_generated.conversion_hubs.go b/apis/emrserverless/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 4ceeb8659c..0000000000 --- a/apis/emrserverless/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Application) Hub() {} diff --git a/apis/firehose/v1beta1/zz_generated.conversion_hubs.go b/apis/firehose/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index bc29aa2197..0000000000 --- a/apis/firehose/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *DeliveryStream) Hub() {} diff --git a/apis/fis/v1beta1/zz_generated.conversion_hubs.go b/apis/fis/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index f07f19f2b4..0000000000 --- a/apis/fis/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *ExperimentTemplate) Hub() {} diff --git a/apis/generate.go b/apis/generate.go index c18ca606ea..ba649db96a 100644 --- a/apis/generate.go +++ b/apis/generate.go @@ -12,6 +12,7 @@ //go:generate rm -rf ../package/crds // Remove generated files +//go:generate bash -c "find . \\( -iname 'zz_generated.conversion_hubs.go' -o -iname 'zz_generated.conversion_spokes.go' \\) -delete" //go:generate bash -c "find . -type d -empty -delete" //go:generate bash -c "find ../internal/controller -iname 'zz_*' -delete" //go:generate bash -c "find ../internal/controller -type d -empty -delete" diff --git a/apis/kendra/v1beta1/zz_generated.conversion_hubs.go b/apis/kendra/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index b33ff602ff..0000000000 --- a/apis/kendra/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *DataSource) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Experience) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Index) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *QuerySuggestionsBlockList) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *Thesaurus) Hub() {} diff --git a/apis/kinesisanalytics/v1beta1/zz_generated.conversion_hubs.go b/apis/kinesisanalytics/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 4ceeb8659c..0000000000 --- a/apis/kinesisanalytics/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Application) Hub() {} diff --git a/apis/mediaconvert/v1beta1/zz_generated.conversion_hubs.go b/apis/mediaconvert/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 3ffcd96c98..0000000000 --- a/apis/mediaconvert/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Queue) Hub() {} diff --git a/apis/networkfirewall/v1beta1/zz_generated.conversion_hubs.go b/apis/networkfirewall/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 1dbc71f194..0000000000 --- a/apis/networkfirewall/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Firewall) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *FirewallPolicy) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *LoggingConfiguration) Hub() {} - -// Hub marks this type as a conversion hub. -func (tr *RuleGroup) Hub() {} diff --git a/apis/opensearchserverless/v1beta1/zz_generated.conversion_spokes.go b/apis/opensearchserverless/v1beta1/zz_generated.conversion_spokes.go deleted file mode 100755 index 02d2057ba6..0000000000 --- a/apis/opensearchserverless/v1beta1/zz_generated.conversion_spokes.go +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -import ( - ujconversion "github.com/crossplane/upjet/pkg/controller/conversion" - "github.com/crossplane/upjet/pkg/resource" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -// ConvertTo converts this SecurityConfig to the hub type. -func (tr *SecurityConfig) ConvertTo(dstRaw conversion.Hub) error { - spokeVersion := tr.GetObjectKind().GroupVersionKind().Version - hubVersion := dstRaw.GetObjectKind().GroupVersionKind().Version - if err := ujconversion.RoundTrip(dstRaw.(resource.Terraformed), tr); err != nil { - return errors.Wrapf(err, "cannot convert from the spoke version %q to the hub version %q", spokeVersion, hubVersion) - } - return nil -} - -// ConvertFrom converts from the hub type to the SecurityConfig type. -func (tr *SecurityConfig) ConvertFrom(srcRaw conversion.Hub) error { - spokeVersion := tr.GetObjectKind().GroupVersionKind().Version - hubVersion := srcRaw.GetObjectKind().GroupVersionKind().Version - if err := ujconversion.RoundTrip(tr, srcRaw.(resource.Terraformed)); err != nil { - return errors.Wrapf(err, "cannot convert from the hub version %q to the spoke version %q", hubVersion, spokeVersion) - } - return nil -} diff --git a/apis/resourcegroups/v1beta1/zz_generated.conversion_hubs.go b/apis/resourcegroups/v1beta1/zz_generated.conversion_hubs.go deleted file mode 100755 index 21a8da1f4a..0000000000 --- a/apis/resourcegroups/v1beta1/zz_generated.conversion_hubs.go +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-FileCopyrightText: 2024 The Crossplane Authors -// -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by upjet. DO NOT EDIT. - -package v1beta1 - -// Hub marks this type as a conversion hub. -func (tr *Group) Hub() {}