From d6116b9371d001123fbf08aac5b9aab578b38e56 Mon Sep 17 00:00:00 2001 From: Juan Manuel Parrilla Madrid Date: Wed, 20 Dec 2023 12:00:20 +0100 Subject: [PATCH] HOSTEDCP-336: Move fixtures out of API Signed-off-by: Juan Manuel Parrilla Madrid --- cmd/cluster/agent/create.go | 2 +- cmd/cluster/aws/create.go | 2 +- cmd/cluster/azure/create.go | 2 +- cmd/cluster/core/create.go | 2 +- cmd/cluster/kubevirt/create.go | 2 +- cmd/cluster/kubevirt/create_test.go | 2 +- cmd/cluster/none/create.go | 2 +- cmd/cluster/powervs/create.go | 2 +- cmd/nodepool/kubevirt/create.go | 2 +- {api => examples}/fixtures/example.go | 0 {api => examples}/fixtures/example_agent.go | 0 {api => examples}/fixtures/example_aws.go | 0 {api => examples}/fixtures/example_azure.go | 0 {api => examples}/fixtures/example_ibmcloud_powervs.go | 0 {api => examples}/fixtures/example_kubevirt.go | 0 {api => examples}/fixtures/example_none.go | 0 .../controllers/hostedcluster/hostedcluster_webhook.go | 2 +- .../controllers/hostedcluster/hostedcluster_webhook_test.go | 2 +- 18 files changed, 11 insertions(+), 11 deletions(-) rename {api => examples}/fixtures/example.go (100%) rename {api => examples}/fixtures/example_agent.go (100%) rename {api => examples}/fixtures/example_aws.go (100%) rename {api => examples}/fixtures/example_azure.go (100%) rename {api => examples}/fixtures/example_ibmcloud_powervs.go (100%) rename {api => examples}/fixtures/example_kubevirt.go (100%) rename {api => examples}/fixtures/example_none.go (100%) diff --git a/cmd/cluster/agent/create.go b/cmd/cluster/agent/create.go index 44dc9aab01..f01d4a7e82 100644 --- a/cmd/cluster/agent/create.go +++ b/cmd/cluster/agent/create.go @@ -9,9 +9,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" crclient "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/openshift/hypershift/api/fixtures" "github.com/openshift/hypershift/cmd/cluster/core" "github.com/openshift/hypershift/cmd/util" + "github.com/openshift/hypershift/examples/fixtures" ) func NewCreateCommand(opts *core.CreateOptions) *cobra.Command { diff --git a/cmd/cluster/aws/create.go b/cmd/cluster/aws/create.go index 6849d366d4..3bab999313 100644 --- a/cmd/cluster/aws/create.go +++ b/cmd/cluster/aws/create.go @@ -6,11 +6,11 @@ import ( "fmt" "os" - apifixtures "github.com/openshift/hypershift/api/fixtures" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" "github.com/openshift/hypershift/cmd/cluster/core" awsinfra "github.com/openshift/hypershift/cmd/infra/aws" "github.com/openshift/hypershift/cmd/util" + apifixtures "github.com/openshift/hypershift/examples/fixtures" "github.com/openshift/hypershift/support/infraid" "github.com/spf13/cobra" ) diff --git a/cmd/cluster/azure/create.go b/cmd/cluster/azure/create.go index b16b9e249e..c9165342e6 100644 --- a/cmd/cluster/azure/create.go +++ b/cmd/cluster/azure/create.go @@ -9,10 +9,10 @@ import ( "strings" "syscall" - apifixtures "github.com/openshift/hypershift/api/fixtures" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" "github.com/openshift/hypershift/cmd/cluster/core" azureinfra "github.com/openshift/hypershift/cmd/infra/azure" + apifixtures "github.com/openshift/hypershift/examples/fixtures" "github.com/openshift/hypershift/support/infraid" "github.com/openshift/hypershift/support/releaseinfo" diff --git a/cmd/cluster/core/create.go b/cmd/cluster/core/create.go index ec61916a36..fa014f4b40 100644 --- a/cmd/cluster/core/create.go +++ b/cmd/cluster/core/create.go @@ -25,10 +25,10 @@ import ( "github.com/blang/semver" "github.com/go-logr/logr" - apifixtures "github.com/openshift/hypershift/api/fixtures" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" "github.com/openshift/hypershift/cmd/util" "github.com/openshift/hypershift/cmd/version" + apifixtures "github.com/openshift/hypershift/examples/fixtures" hyperapi "github.com/openshift/hypershift/support/api" "github.com/openshift/hypershift/support/globalconfig" "github.com/openshift/hypershift/support/releaseinfo" diff --git a/cmd/cluster/kubevirt/create.go b/cmd/cluster/kubevirt/create.go index 147ff76500..5b75c3a4d1 100644 --- a/cmd/cluster/kubevirt/create.go +++ b/cmd/cluster/kubevirt/create.go @@ -9,10 +9,10 @@ import ( "github.com/spf13/cobra" - apifixtures "github.com/openshift/hypershift/api/fixtures" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" "github.com/openshift/hypershift/cmd/cluster/core" "github.com/openshift/hypershift/cmd/cluster/kubevirt/params" + apifixtures "github.com/openshift/hypershift/examples/fixtures" "github.com/openshift/hypershift/support/infraid" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" diff --git a/cmd/cluster/kubevirt/create_test.go b/cmd/cluster/kubevirt/create_test.go index c8f0b8c6e0..9f75588dfa 100644 --- a/cmd/cluster/kubevirt/create_test.go +++ b/cmd/cluster/kubevirt/create_test.go @@ -7,9 +7,9 @@ import ( . "github.com/onsi/gomega" "k8s.io/utils/pointer" - apifixtures "github.com/openshift/hypershift/api/fixtures" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" "github.com/openshift/hypershift/cmd/cluster/core" + apifixtures "github.com/openshift/hypershift/examples/fixtures" ) func Test_ApplyPlatformSpecificValues(t *testing.T) { diff --git a/cmd/cluster/none/create.go b/cmd/cluster/none/create.go index 7906c30cfb..4f18a6c907 100644 --- a/cmd/cluster/none/create.go +++ b/cmd/cluster/none/create.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" - apifixtures "github.com/openshift/hypershift/api/fixtures" "github.com/openshift/hypershift/cmd/cluster/core" + apifixtures "github.com/openshift/hypershift/examples/fixtures" ) func NewCreateCommand(opts *core.CreateOptions) *cobra.Command { diff --git a/cmd/cluster/powervs/create.go b/cmd/cluster/powervs/create.go index caac90afc4..5b9ee6d43c 100644 --- a/cmd/cluster/powervs/create.go +++ b/cmd/cluster/powervs/create.go @@ -8,10 +8,10 @@ import ( "os/signal" "syscall" - apifixtures "github.com/openshift/hypershift/api/fixtures" hyperv1 "github.com/openshift/hypershift/api/hypershift/v1beta1" "github.com/openshift/hypershift/cmd/cluster/core" powervsinfra "github.com/openshift/hypershift/cmd/infra/powervs" + apifixtures "github.com/openshift/hypershift/examples/fixtures" "github.com/openshift/hypershift/support/infraid" "github.com/spf13/cobra" ) diff --git a/cmd/nodepool/kubevirt/create.go b/cmd/nodepool/kubevirt/create.go index 9f3664562a..d9e8c87835 100644 --- a/cmd/nodepool/kubevirt/create.go +++ b/cmd/nodepool/kubevirt/create.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "github.com/openshift/hypershift/api/fixtures" + "github.com/openshift/hypershift/examples/fixtures" "github.com/spf13/cobra" crclient "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/api/fixtures/example.go b/examples/fixtures/example.go similarity index 100% rename from api/fixtures/example.go rename to examples/fixtures/example.go diff --git a/api/fixtures/example_agent.go b/examples/fixtures/example_agent.go similarity index 100% rename from api/fixtures/example_agent.go rename to examples/fixtures/example_agent.go diff --git a/api/fixtures/example_aws.go b/examples/fixtures/example_aws.go similarity index 100% rename from api/fixtures/example_aws.go rename to examples/fixtures/example_aws.go diff --git a/api/fixtures/example_azure.go b/examples/fixtures/example_azure.go similarity index 100% rename from api/fixtures/example_azure.go rename to examples/fixtures/example_azure.go diff --git a/api/fixtures/example_ibmcloud_powervs.go b/examples/fixtures/example_ibmcloud_powervs.go similarity index 100% rename from api/fixtures/example_ibmcloud_powervs.go rename to examples/fixtures/example_ibmcloud_powervs.go diff --git a/api/fixtures/example_kubevirt.go b/examples/fixtures/example_kubevirt.go similarity index 100% rename from api/fixtures/example_kubevirt.go rename to examples/fixtures/example_kubevirt.go diff --git a/api/fixtures/example_none.go b/examples/fixtures/example_none.go similarity index 100% rename from api/fixtures/example_none.go rename to examples/fixtures/example_none.go diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go index b5f28a9083..0f52417431 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go @@ -9,7 +9,7 @@ import ( "github.com/blang/semver" jsonpatch "github.com/evanphx/json-patch/v5" "github.com/go-logr/logr" - apiexample "github.com/openshift/hypershift/api/fixtures" + apiexample "github.com/openshift/hypershift/examples/fixtures" "golang.org/x/sync/errgroup" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook_test.go b/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook_test.go index e6f2fc4ffb..580b962070 100644 --- a/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook_test.go +++ b/hypershift-operator/controllers/hostedcluster/hostedcluster_webhook_test.go @@ -15,8 +15,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client/fake" - apiexample "github.com/openshift/hypershift/api/fixtures" "github.com/openshift/hypershift/api/hypershift/v1beta1" + apiexample "github.com/openshift/hypershift/examples/fixtures" "github.com/openshift/hypershift/kubevirtexternalinfra" "github.com/openshift/hypershift/support/api" )