From 7fc488aa31c766be945c63d610ac038e5e3fd768 Mon Sep 17 00:00:00 2001 From: encalada Date: Tue, 9 Jan 2024 09:35:23 -0500 Subject: [PATCH] clean conversion in alpha, clean e2e test case --- pkg/apis/build/v1alpha1/build_conversion.go | 24 ------------------- .../build/v1alpha1/buildrun_conversion.go | 24 ------------------- .../v1alpha1/buildstrategy_conversion.go | 24 ------------------- .../clusterbuildstrategy_conversion.go | 24 ------------------- test/e2e/v1beta1/common_test.go | 5 ---- 5 files changed, 101 deletions(-) delete mode 100644 pkg/apis/build/v1alpha1/build_conversion.go delete mode 100644 pkg/apis/build/v1alpha1/buildrun_conversion.go delete mode 100644 pkg/apis/build/v1alpha1/buildstrategy_conversion.go delete mode 100644 pkg/apis/build/v1alpha1/clusterbuildstrategy_conversion.go diff --git a/pkg/apis/build/v1alpha1/build_conversion.go b/pkg/apis/build/v1alpha1/build_conversion.go deleted file mode 100644 index c6638dd704..0000000000 --- a/pkg/apis/build/v1alpha1/build_conversion.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The Shipwright Contributors -// -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha1 - -import ( - "context" - "fmt" - - "github.com/shipwright-io/build/pkg/webhook" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -// ensure v1alpha1 implements the Conversion interface -var _ webhook.Conversion = (*Build)(nil) - -func (src *Build) ConvertTo(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert to") -} - -func (src *Build) ConvertFrom(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert from") -} diff --git a/pkg/apis/build/v1alpha1/buildrun_conversion.go b/pkg/apis/build/v1alpha1/buildrun_conversion.go deleted file mode 100644 index 5e07c04b46..0000000000 --- a/pkg/apis/build/v1alpha1/buildrun_conversion.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The Shipwright Contributors -// -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha1 - -import ( - "context" - "fmt" - - "github.com/shipwright-io/build/pkg/webhook" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -// ensure v1alpha1 implements the Conversion interface -var _ webhook.Conversion = (*BuildRun)(nil) - -func (src *BuildRun) ConvertTo(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert to") -} - -func (src *BuildRun) ConvertFrom(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert from") -} diff --git a/pkg/apis/build/v1alpha1/buildstrategy_conversion.go b/pkg/apis/build/v1alpha1/buildstrategy_conversion.go deleted file mode 100644 index fd0de79cf4..0000000000 --- a/pkg/apis/build/v1alpha1/buildstrategy_conversion.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The Shipwright Contributors -// -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha1 - -import ( - "context" - "fmt" - - "github.com/shipwright-io/build/pkg/webhook" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -// ensure v1alpha1 implements the Conversion interface -var _ webhook.Conversion = (*BuildStrategy)(nil) - -func (src *BuildStrategy) ConvertTo(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert to") -} - -func (src *BuildStrategy) ConvertFrom(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert from") -} diff --git a/pkg/apis/build/v1alpha1/clusterbuildstrategy_conversion.go b/pkg/apis/build/v1alpha1/clusterbuildstrategy_conversion.go deleted file mode 100644 index 21b1856290..0000000000 --- a/pkg/apis/build/v1alpha1/clusterbuildstrategy_conversion.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The Shipwright Contributors -// -// SPDX-License-Identifier: Apache-2.0 - -package v1alpha1 - -import ( - "context" - "fmt" - - "github.com/shipwright-io/build/pkg/webhook" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" -) - -// ensure v1alpha1 implements the Conversion interface -var _ webhook.Conversion = (*ClusterBuildStrategy)(nil) - -func (src *ClusterBuildStrategy) ConvertTo(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert to") -} - -func (src *ClusterBuildStrategy) ConvertFrom(_ context.Context, _ *unstructured.Unstructured) error { - return fmt.Errorf("v1alpha1 is the current storage version, nothing to convert from") -} diff --git a/test/e2e/v1beta1/common_test.go b/test/e2e/v1beta1/common_test.go index 165119e559..29b81e637d 100644 --- a/test/e2e/v1beta1/common_test.go +++ b/test/e2e/v1beta1/common_test.go @@ -161,11 +161,6 @@ func retrieveBuildAndBuildRun(testBuild *utils.TestBuild, namespace string, buil return nil, buildRun, err } - alphaBuild.ConvertTo(testBuild.Context, &obj) - jsonData, err = json.Marshal(obj.Object) - if err != nil { - Logf("Failed to convert the build to v1beta1: %s", err) - } var betaBuild buildv1beta1.Build json.Unmarshal(jsonData, &betaBuild)