Repository: submariner-io/submariner-operator
Pull request #2158 (2022-07-27 12:20:55)

Make APIs in-line with operator-sdk 1.21.0
Make changes to `/api` to what the 1.21.0 sdk expects/generates. Following changes are made in this PR:

1. APIs are changed from `multi-group` to be `single-group` 
2. The dir structure/file names are changed to match what 1.21.0 sdk generates.

This PR takes content from a [feature PR on my fork](https://github.com/Jaanki/submariner-operator/pull/10). The forked PR generates a project from scratch based on sdk v1.21.0.

submariner-bot: 🤖 Created branch: z_pr2158/Jaanki/single_grp_api 
🚀 Full E2E won't run until the "ready-to-test" label is applied. I will add it automatically once the PR has 2 approvals, or you can add it manually.
skitt: https://github.com/submariner-io/shipyard/pull/889 will help with the `go mod tidy` problem.
skitt: The linting errors need to be fixed. `make unit` will update the embedded YAML, but the CRDs themselves need to be updated to add the full stops expected by the Go linting (and then the embedded YAMLs shouldn’t need to be updated).
Jaanki: > [submariner-io/shipyard#889](https://github.com/submariner-io/shipyard/pull/889) will help with the `go mod tidy` problem.

Yupe. Using `-compat=1.17` locally.
Jaanki: I think I will have to recreate manifests and CRDs but that would mean changes to embedded yamls as well. And it will make the PR  a very long one which I don't want.
skitt: > I think I will have to recreate manifests and CRDs but that would mean changes to embedded yamls as well. And it will make the PR a very long one which I don't want.

The main problem breaking deployment is

```
panic: Double registration of different types for submariner.io/v1alpha1, Kind=ServiceDiscovery: old=github.com/submariner-io/submariner-operator/api/v1alpha1.ServiceDiscovery, new=github.com/submariner-io/submariner-operator/api/submariner/v1alpha1.ServiceDiscovery in scheme "pkg/runtime/scheme.go:100"
```

Jaanki: > > I think I will have to recreate manifests and CRDs but that would mean changes to embedded yamls as well. And it will make the PR a very long one which I don't want.
> 
> The main problem breaking deployment is
> 
> ```
> panic: Double registration of different types for submariner.io/v1alpha1, Kind=ServiceDiscovery: old=github.com/submariner-io/submariner-operator/api/v1alpha1.ServiceDiscovery, new=github.com/submariner-io/submariner-operator/api/submariner/v1alpha1.ServiceDiscovery in scheme "pkg/runtime/scheme.go:100"
> ```

Where is this error?
skitt: > > The main problem breaking deployment is
> > ```
> > panic: Double registration of different types for submariner.io/v1alpha1, Kind=ServiceDiscovery: old=github.com/submariner-io/submariner-operator/api/v1alpha1.ServiceDiscovery, new=github.com/submariner-io/submariner-operator/api/submariner/v1alpha1.ServiceDiscovery in scheme "pkg/runtime/scheme.go:100"
> > ```
> 
> Where is this error?

https://github.com/submariner-io/submariner-operator/runs/7558982057?check_suite_focus=true#step:4:515

Patch:
diff --git a/Makefile b/Makefile
index 3c7705b5..002521e5 100644
--- a/Makefile
+++ b/Makefile
@@ -138,7 +138,7 @@ bin/lichen: $(VENDOR_MODULES)
 	$(GO) build -o $@ github.com/uw-labs/lichen
 
 # Generate deep-copy code
-CONTROLLER_DEEPCOPY := api/submariner/v1alpha1/zz_generated.deepcopy.go
+CONTROLLER_DEEPCOPY := api/v1alpha1/zz_generated.deepcopy.go
 $(CONTROLLER_DEEPCOPY): $(VENDOR_MODULES) | $(CONTROLLER_GEN)
 	$(CONTROLLER_GEN) object:headerFile="$(CURDIR)/hack/boilerplate.go.txt,year=$(shell date +"%Y")" paths="./..."
 
@@ -159,11 +159,11 @@ $(CONTROLLER_GEN): $(VENDOR_MODULES)
 	mkdir -p $(@D)
 	$(GO) build -o $@ sigs.k8s.io/controller-tools/cmd/controller-gen
 
-deploy/crds/submariner.io_servicediscoveries.yaml: ./api/submariner/v1alpha1/servicediscovery_types.go $(VENDOR_MODULES) | $(CONTROLLER_GEN)
+deploy/crds/submariner.io_servicediscoveries.yaml: ./api/v1alpha1/servicediscovery_types.go $(VENDOR_MODULES) | $(CONTROLLER_GEN)
 	$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=deploy/crds
 	test -f $@
 
-deploy/crds/submariner.io_brokers.yaml deploy/crds/submariner.io_submariners.yaml: ./api/submariner/v1alpha1/submariner_types.go $(VENDOR_MODULES) | $(CONTROLLER_GEN)
+deploy/crds/submariner.io_brokers.yaml deploy/crds/submariner.io_submariners.yaml: ./api/v1alpha1/submariner_types.go $(VENDOR_MODULES) | $(CONTROLLER_GEN)
 	$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=deploy/crds
 	test -f $@
 
diff --git a/api/addtoscheme_submariner_v1alpha1.go b/api/addtoscheme_submariner_v1alpha1.go
deleted file mode 100644
index 34e00cc1..00000000
--- a/api/addtoscheme_submariner_v1alpha1.go
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-
-Copyright Contributors to the Submariner project.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package api
-
-import (
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
-)
-
-func init() {
-	// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
-	AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme)
-}
diff --git a/api/apis.go b/api/apis.go
deleted file mode 100644
index cebfb253..00000000
--- a/api/apis.go
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-
-Copyright Contributors to the Submariner project.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-package api
-
-import (
-	"k8s.io/apimachinery/pkg/runtime"
-)
-
-// AddToSchemes may be used to add all resources defined in the project to a Scheme.
-var AddToSchemes runtime.SchemeBuilder
-
-// AddToScheme adds all Resources to the Scheme.
-func AddToScheme(s *runtime.Scheme) error {
-	return AddToSchemes.AddToScheme(s) // nolint:wrapcheck // No need to wrap here
-}
diff --git a/api/submariner/group.go b/api/submariner/group.go
deleted file mode 100644
index 25478c0d..00000000
--- a/api/submariner/group.go
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-
-Copyright Contributors to the Submariner project.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Package submariner contains submariner API versions.
-//
-// This file ensures Go source parsers acknowledge the submariner package
-// and any child packages. It can be removed if any other Go source files are
-// added to this package.
-package submariner
diff --git a/api/submariner/v1alpha1/doc.go b/api/submariner/v1alpha1/doc.go
deleted file mode 100644
index cb3680dc..00000000
--- a/api/submariner/v1alpha1/doc.go
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
-SPDX-License-Identifier: Apache-2.0
-
-Copyright Contributors to the Submariner project.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-// Package v1alpha1 contains API Schema definitions for the submariner v1alpha1 API group
-// +k8s:deepcopy-gen=package,register
-// +groupName=submariner.io
-package v1alpha1
diff --git a/api/v1alpha1/broker_types.go b/api/v1alpha1/broker_types.go
new file mode 100644
index 00000000..6cec8bf9
--- /dev/null
+++ b/api/v1alpha1/broker_types.go
@@ -0,0 +1,70 @@
+/*
+SPDX-License-Identifier: Apache-2.0
+
+Copyright Contributors to the Submariner project.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package v1alpha1
+
+import (
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+)
+
+// EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
+// NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
+
+// BrokerSpec defines the desired state of Broker.
+type BrokerSpec struct {
+	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+	// Important: Run "make" to regenerate code after modifying this file
+
+	Components                  []string `json:"components,omitempty"`
+	DefaultCustomDomains        []string `json:"defaultCustomDomains,omitempty"`
+	GlobalnetCIDRRange          string   `json:"globalnetCIDRRange,omitempty"`
+	DefaultGlobalnetClusterSize uint     `json:"defaultGlobalnetClusterSize,omitempty"`
+	GlobalnetEnabled            bool     `json:"globalnetEnabled,omitempty"`
+}
+
+// BrokerStatus defines the observed state of Broker.
+type BrokerStatus struct {
+	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+	// Important: Run "make" to regenerate code after modifying this file
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+//+kubebuilder:resource:path=brokers,scope=Namespaced
+
+// Broker is the Schema for the brokers API.
+type Broker struct { //nolint:govet // we want to keep the traditional order
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   BrokerSpec   `json:"spec,omitempty"`
+	Status BrokerStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// BrokerList contains a list of Broker.
+type BrokerList struct {
+	metav1.TypeMeta `json:",inline"`
+	metav1.ListMeta `json:"metadata,omitempty"`
+	Items           []Broker `json:"items"`
+}
+
+func init() {
+	SchemeBuilder.Register(&Broker{}, &BrokerList{})
+}
diff --git a/api/submariner/v1alpha1/register.go b/api/v1alpha1/groupversion_info.go
similarity index 63%
rename from api/submariner/v1alpha1/register.go
rename to api/v1alpha1/groupversion_info.go
index 639d5545..0ba08f44 100644
--- a/api/submariner/v1alpha1/register.go
+++ b/api/v1alpha1/groupversion_info.go
@@ -16,11 +16,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// NOTE: Boilerplate only.  Ignore this file.
-
-// Package v1alpha1 contains API Schema definitions for the submariner v1alpha1 API group
-// +k8s:deepcopy-gen=package,register
-// +groupName=submariner.io
+// Package v1alpha1 contains API Schema definitions for the  v1alpha1 API group
+//+kubebuilder:object:generate=true
+//+groupName=submariner.io
 package v1alpha1
 
 import (
@@ -29,10 +27,12 @@ import (
 )
 
 var (
-	// SchemeGroupVersion is group version used to register these objects.
-	SchemeGroupVersion = schema.GroupVersion{Group: "submariner.io", Version: "v1alpha1"}
+	// GroupVersion is group version used to register these objects.
+	GroupVersion = schema.GroupVersion{Group: "submariner.io", Version: "v1alpha1"}
 
 	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
-	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}
-	AddToScheme   = SchemeBuilder.AddToScheme
+	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
+
+	// AddToScheme adds the types in this group-version to the given scheme.
+	AddToScheme = SchemeBuilder.AddToScheme
 )
diff --git a/api/submariner/v1alpha1/servicediscovery_types.go b/api/v1alpha1/servicediscovery_types.go
similarity index 75%
rename from api/submariner/v1alpha1/servicediscovery_types.go
rename to api/v1alpha1/servicediscovery_types.go
index da4a5de1..7b838e22 100644
--- a/api/submariner/v1alpha1/servicediscovery_types.go
+++ b/api/v1alpha1/servicediscovery_types.go
@@ -24,12 +24,13 @@ import (
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 )
 
-// EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
-// NOTE: json tags are required.  Any new fields you add 	must have json tags for the fields to be serialized.
+// NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
 
-// ServiceDiscoverySpec defines the desired state of ServiceDiscovery
-// +k8s:openapi-gen=true
+// ServiceDiscoverySpec defines the desired state of ServiceDiscovery.
 type ServiceDiscoverySpec struct {
+	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+	// Important: Run "make" to regenerate code after modifying this file
+
 	BrokerK8sApiServer       string               `json:"brokerK8sApiServer"`
 	BrokerK8sApiServerToken  string               `json:"brokerK8sApiServerToken,omitempty"`
 	BrokerK8sCA              string               `json:"brokerK8sCA,omitempty"`
@@ -46,41 +47,30 @@ type ServiceDiscoverySpec struct {
 	// +listType=set
 	CustomDomains  []string          `json:"customDomains,omitempty"`
 	ImageOverrides map[string]string `json:"imageOverrides,omitempty"`
-	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
-	// Important: Run "make manifests" to regenerate code after modifying this file
-	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
-}
-
-type CoreDNSCustomConfig struct {
-	ConfigMapName string `json:"configMapName,omitempty"`
-	Namespace     string `json:"namespace,omitempty"`
 }
 
-// ServiceDiscoveryStatus defines the observed state of ServiceDiscovery
-// +k8s:openapi-gen=true
+// ServiceDiscoveryStatus defines the observed state of ServiceDiscovery.
 type ServiceDiscoveryStatus struct {
-	DeploymentInfo DeploymentInfo `json:"deploymentInfo,omitempty"`
 	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
-	// Important: Run "make manifests" to regenerate code after modifying this file
-	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
+	// Important: Run "make" to regenerate code after modifying this file
+
+	DeploymentInfo DeploymentInfo `json:"deploymentInfo,omitempty"`
 }
 
-// +kubebuilder:object:root=true
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+//+kubebuilder:resource:path=servicediscoveries,scope=Namespaced
 
 // ServiceDiscovery is the Schema for the servicediscoveries API.
-// +k8s:openapi-gen=true
-// +kubebuilder:subresource:status
-// +kubebuilder:resource:path=servicediscoveries,scope=Namespaced
-// +genclient
-// +operator-sdk:csv:customresourcedefinitions:displayName="Lighthouse"
 type ServiceDiscovery struct {
-	Status            ServiceDiscoveryStatus `json:"status,omitempty"`
-	metav1.ObjectMeta `json:"metadata,omitempty"`
-	Spec              ServiceDiscoverySpec `json:"spec,omitempty"`
 	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   ServiceDiscoverySpec   `json:"spec,omitempty"`
+	Status ServiceDiscoveryStatus `json:"status,omitempty"`
 }
 
-// +kubebuilder:object:root=true
+//+kubebuilder:object:root=true
 
 // ServiceDiscoveryList contains a list of ServiceDiscovery.
 type ServiceDiscoveryList struct {
@@ -93,6 +83,11 @@ func init() {
 	SchemeBuilder.Register(&ServiceDiscovery{}, &ServiceDiscoveryList{})
 }
 
+type CoreDNSCustomConfig struct {
+	ConfigMapName string `json:"configMapName,omitempty"`
+	Namespace     string `json:"namespace,omitempty"`
+}
+
 func (sd *ServiceDiscovery) UnmarshalJSON(data []byte) error {
 	type serviceDiscoveryAlias ServiceDiscovery
 
diff --git a/api/submariner/v1alpha1/submariner_types.go b/api/v1alpha1/submariner_types.go
similarity index 75%
rename from api/submariner/v1alpha1/submariner_types.go
rename to api/v1alpha1/submariner_types.go
index d2c94368..16ad1a32 100644
--- a/api/submariner/v1alpha1/submariner_types.go
+++ b/api/v1alpha1/submariner_types.go
@@ -30,9 +30,11 @@ import (
 // EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
 // NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.
 
-// SubmarinerSpec defines the desired state of Submariner
-// +k8s:openapi-gen=true
+// SubmarinerSpec defines the desired state of Submariner.
 type SubmarinerSpec struct {
+	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
+	// Important: Run "make" to regenerate code after modifying this file
+
 	Broker                   string               `json:"broker"`
 	BrokerK8sApiServer       string               `json:"brokerK8sApiServer"`
 	BrokerK8sApiServerToken  string               `json:"brokerK8sApiServerToken,omitempty"`
@@ -66,14 +68,13 @@ type SubmarinerSpec struct {
 	ImageOverrides map[string]string `json:"imageOverrides,omitempty"`
 	// +optional
 	ConnectionHealthCheck *HealthCheckSpec `json:"connectionHealthCheck,omitempty"`
-	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
-	// Important: Run "make manifests" to regenerate code after modifying this file
-	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
 }
 
-// SubmarinerStatus defines the observed state of Submariner
-// +k8s:openapi-gen=true
+// SubmarinerStatus defines the observed state of Submariner.
 type SubmarinerStatus struct {
+	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
+	// Important: Run "make" to regenerate code after modifying this file
+
 	NatEnabled                bool                    `json:"natEnabled"`
 	ColorCodes                string                  `json:"colorCodes,omitempty"`
 	ClusterID                 string                  `json:"clusterID"`
@@ -87,9 +88,32 @@ type SubmarinerStatus struct {
 	LoadBalancerStatus        LoadBalancerStatus      `json:"loadBalancerStatus,omitempty"`
 	Gateways                  *[]submv1.GatewayStatus `json:"gateways,omitempty"`
 	DeploymentInfo            DeploymentInfo          `json:"deploymentInfo,omitempty"`
-	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
-	// Important: Run "make manifests" to regenerate code after modifying this file
-	// Add custom validation using kubebuilder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
+}
+
+//+kubebuilder:object:root=true
+//+kubebuilder:subresource:status
+//+kubebuilder:resource:path=submariners,scope=Namespaced
+
+// Submariner is the Schema for the submariners API.
+type Submariner struct {
+	metav1.TypeMeta   `json:",inline"`
+	metav1.ObjectMeta `json:"metadata,omitempty"`
+
+	Spec   SubmarinerSpec   `json:"spec,omitempty"`
+	Status SubmarinerStatus `json:"status,omitempty"`
+}
+
+//+kubebuilder:object:root=true
+
+// SubmarinerList contains a list of Submariner.
+type SubmarinerList struct {
+	metav1.TypeMeta `json:",inline"`
+	metav1.ListMeta `json:"metadata,omitempty"`
+	Items           []Submariner `json:"items"`
+}
+
+func init() {
+	SchemeBuilder.Register(&Submariner{}, &SubmarinerList{})
 }
 
 type LoadBalancerStatus struct {
@@ -137,80 +161,6 @@ const (
 	Openstack                            = "openstack"
 )
 
-// +kubebuilder:object:root=true
-
-// Submariner is the Schema for the submariners API
-// +k8s:openapi-gen=true
-// +kubebuilder:subresource:status
-// +kubebuilder:resource:path=submariners,scope=Namespaced
-// +genclient
-// +operator-sdk:csv:customresourcedefinitions:displayName="Submariner"
-type Submariner struct {
-	metav1.TypeMeta   `json:",inline"`
-	metav1.ObjectMeta `json:"metadata,omitempty"`
-
-	Spec   SubmarinerSpec   `json:"spec,omitempty"`
-	Status SubmarinerStatus `json:"status,omitempty"`
-}
-
-// +kubebuilder:object:root=true
-
-// SubmarinerList contains a list of Submariner.
-type SubmarinerList struct {
-	metav1.TypeMeta `json:",inline"`
-	metav1.ListMeta `json:"metadata,omitempty"`
-	Items           []Submariner `json:"items"`
-}
-
-// BrokerSpec defines the desired state of Broker.
-// +k8s:openapi-gen=true
-type BrokerSpec struct {
-	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
-	// Important: Run "make" to regenerate code after modifying this file
-
-	Components                  []string `json:"components,omitempty"`
-	DefaultCustomDomains        []string `json:"defaultCustomDomains,omitempty"`
-	GlobalnetCIDRRange          string   `json:"globalnetCIDRRange,omitempty"`
-	DefaultGlobalnetClusterSize uint     `json:"defaultGlobalnetClusterSize,omitempty"`
-	GlobalnetEnabled            bool     `json:"globalnetEnabled,omitempty"`
-}
-
-// BrokerStatus defines the observed state of Broker
-// +k8s:openapi-gen=true
-type BrokerStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
-	// Important: Run "make" to regenerate code after modifying this file
-}
-
-// +kubebuilder:object:root=true
-
-// Broker is the Schema for the brokers API
-// +k8s:openapi-gen=true
-// +kubebuilder:subresource:status
-// +kubebuilder:resource:path=brokers,scope=Namespaced
-// +genclient
-// +operator-sdk:csv:customresourcedefinitions:displayName="Broker"
-type Broker struct { //nolint:govet // we want to keep the traditional order
-	metav1.TypeMeta   `json:",inline"`
-	metav1.ObjectMeta `json:"metadata,omitempty"`
-
-	Spec   BrokerSpec   `json:"spec,omitempty"`
-	Status BrokerStatus `json:"status,omitempty"`
-}
-
-// +kubebuilder:object:root=true
-
-// BrokerList contains a list of Broker.
-type BrokerList struct {
-	metav1.TypeMeta `json:",inline"`
-	metav1.ListMeta `json:"metadata,omitempty"`
-	Items           []Broker `json:"items"`
-}
-
-func init() {
-	SchemeBuilder.Register(&Submariner{}, &SubmarinerList{})
-	SchemeBuilder.Register(&Broker{}, &BrokerList{})
-}
-
 func (s *Submariner) UnmarshalJSON(data []byte) error {
 	type submarinerAlias Submariner
 
diff --git a/api/submariner/v1alpha1/versions.go b/api/v1alpha1/versions.go
similarity index 100%
rename from api/submariner/v1alpha1/versions.go
rename to api/v1alpha1/versions.go
diff --git a/api/submariner/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go
similarity index 100%
rename from api/submariner/v1alpha1/zz_generated.deepcopy.go
rename to api/v1alpha1/zz_generated.deepcopy.go
index 0c01a7f8..8addf396 100644
--- a/api/submariner/v1alpha1/zz_generated.deepcopy.go
+++ b/api/v1alpha1/zz_generated.deepcopy.go
@@ -228,10 +228,10 @@ func (in *LoadBalancerStatus) DeepCopy() *LoadBalancerStatus {
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *ServiceDiscovery) DeepCopyInto(out *ServiceDiscovery) {
 	*out = *in
-	out.Status = in.Status
+	out.TypeMeta = in.TypeMeta
 	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
 	in.Spec.DeepCopyInto(&out.Spec)
-	out.TypeMeta = in.TypeMeta
+	out.Status = in.Status
 }
 
 // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceDiscovery.
diff --git a/controllers/servicediscovery/cleanup.go b/controllers/servicediscovery/cleanup.go
index e23b7baf..a872209e 100644
--- a/controllers/servicediscovery/cleanup.go
+++ b/controllers/servicediscovery/cleanup.go
@@ -26,7 +26,7 @@ import (
 	"github.com/submariner-io/admiral/pkg/finalizer"
 	"github.com/submariner-io/admiral/pkg/resource"
 	"github.com/submariner-io/admiral/pkg/util"
-	operatorv1alpha1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	operatorv1alpha1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	ctrlresource "github.com/submariner-io/submariner-operator/controllers/resource"
 	"github.com/submariner-io/submariner-operator/controllers/uninstall"
diff --git a/controllers/servicediscovery/servicediscovery_controller.go b/controllers/servicediscovery/servicediscovery_controller.go
index 8b9f4782..9b1b0a91 100644
--- a/controllers/servicediscovery/servicediscovery_controller.go
+++ b/controllers/servicediscovery/servicediscovery_controller.go
@@ -33,7 +33,7 @@ import (
 	"github.com/pkg/errors"
 	"github.com/submariner-io/admiral/pkg/finalizer"
 	"github.com/submariner-io/admiral/pkg/syncer/broker"
-	submarinerv1alpha1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	submarinerv1alpha1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	"github.com/submariner-io/submariner-operator/controllers/helpers"
 	"github.com/submariner-io/submariner-operator/controllers/metrics"
diff --git a/controllers/submariner/broker_controller.go b/controllers/submariner/broker_controller.go
index c3237248..6f6bdddd 100644
--- a/controllers/submariner/broker_controller.go
+++ b/controllers/submariner/broker_controller.go
@@ -23,7 +23,7 @@ import (
 
 	"github.com/go-logr/logr"
 	"github.com/pkg/errors"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/pkg/crd"
 	"github.com/submariner-io/submariner-operator/pkg/discovery/globalnet"
 	"github.com/submariner-io/submariner-operator/pkg/gateway"
diff --git a/controllers/submariner/cleanup.go b/controllers/submariner/cleanup.go
index a363ce33..5d9171cb 100644
--- a/controllers/submariner/cleanup.go
+++ b/controllers/submariner/cleanup.go
@@ -23,7 +23,7 @@ import (
 	"time"
 
 	"github.com/submariner-io/admiral/pkg/finalizer"
-	operatorv1alpha1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	operatorv1alpha1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	"github.com/submariner-io/submariner-operator/controllers/resource"
 	"github.com/submariner-io/submariner-operator/controllers/uninstall"
diff --git a/controllers/submariner/daemonsets.go b/controllers/submariner/daemonsets.go
index 6d6a00ba..6dc42f89 100644
--- a/controllers/submariner/daemonsets.go
+++ b/controllers/submariner/daemonsets.go
@@ -22,7 +22,7 @@ import (
 	"context"
 
 	"github.com/pkg/errors"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/controllers/submariner/gateway_resources.go b/controllers/submariner/gateway_resources.go
index 1aa747fe..2bcc08f1 100644
--- a/controllers/submariner/gateway_resources.go
+++ b/controllers/submariner/gateway_resources.go
@@ -26,7 +26,7 @@ import (
 	"github.com/go-logr/logr"
 	"github.com/pkg/errors"
 	"github.com/submariner-io/admiral/pkg/syncer/broker"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/helpers"
 	"github.com/submariner-io/submariner-operator/controllers/metrics"
 	"github.com/submariner-io/submariner-operator/pkg/names"
diff --git a/controllers/submariner/globalnet_resources.go b/controllers/submariner/globalnet_resources.go
index 59b0d455..42aa6a54 100644
--- a/controllers/submariner/globalnet_resources.go
+++ b/controllers/submariner/globalnet_resources.go
@@ -20,7 +20,7 @@ package submariner
 
 import (
 	"github.com/go-logr/logr"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/helpers"
 	"github.com/submariner-io/submariner-operator/controllers/metrics"
 	"github.com/submariner-io/submariner-operator/pkg/names"
diff --git a/controllers/submariner/loadbalancer_resources.go b/controllers/submariner/loadbalancer_resources.go
index d9828f0b..1027b5f0 100644
--- a/controllers/submariner/loadbalancer_resources.go
+++ b/controllers/submariner/loadbalancer_resources.go
@@ -20,7 +20,7 @@ package submariner
 
 import (
 	"github.com/go-logr/logr"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/helpers"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	submv1 "github.com/submariner-io/submariner/pkg/apis/submariner.io/v1"
diff --git a/controllers/submariner/np_syncer_resources.go b/controllers/submariner/np_syncer_resources.go
index e0e21801..901b089f 100644
--- a/controllers/submariner/np_syncer_resources.go
+++ b/controllers/submariner/np_syncer_resources.go
@@ -22,7 +22,7 @@ import (
 	"strconv"
 
 	"github.com/go-logr/logr"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/helpers"
 	"github.com/submariner-io/submariner-operator/pkg/discovery/network"
 	"github.com/submariner-io/submariner-operator/pkg/names"
diff --git a/controllers/submariner/route_agent_resources.go b/controllers/submariner/route_agent_resources.go
index fb8e198b..7df5bd52 100644
--- a/controllers/submariner/route_agent_resources.go
+++ b/controllers/submariner/route_agent_resources.go
@@ -22,7 +22,7 @@ import (
 	"strconv"
 
 	"github.com/go-logr/logr"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/helpers"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	appsv1 "k8s.io/api/apps/v1"
diff --git a/controllers/submariner/servicediscovery_resources.go b/controllers/submariner/servicediscovery_resources.go
index e5a037ee..09d1dd12 100644
--- a/controllers/submariner/servicediscovery_resources.go
+++ b/controllers/submariner/servicediscovery_resources.go
@@ -23,7 +23,7 @@ import (
 
 	"github.com/go-logr/logr"
 	"github.com/pkg/errors"
-	"github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/controllers/submariner/submariner_controller.go b/controllers/submariner/submariner_controller.go
index dbf4f98e..b6ea2700 100644
--- a/controllers/submariner/submariner_controller.go
+++ b/controllers/submariner/submariner_controller.go
@@ -31,7 +31,7 @@ import (
 	"github.com/submariner-io/admiral/pkg/resource"
 	"github.com/submariner-io/admiral/pkg/syncer"
 	"github.com/submariner-io/admiral/pkg/util"
-	submopv1a1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	submopv1a1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	resourceiface "github.com/submariner-io/submariner-operator/controllers/resource"
 	"github.com/submariner-io/submariner-operator/pkg/crd"
diff --git a/controllers/submariner/submariner_networkdiscovery.go b/controllers/submariner/submariner_networkdiscovery.go
index 496b1b72..82100062 100644
--- a/controllers/submariner/submariner_networkdiscovery.go
+++ b/controllers/submariner/submariner_networkdiscovery.go
@@ -23,7 +23,7 @@ import (
 
 	"github.com/go-logr/logr"
 	"github.com/pkg/errors"
-	submopv1a1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	submopv1a1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/pkg/discovery/network"
 )
 
diff --git a/main.go b/main.go
index 20d2fe1b..9b40a6ab 100644
--- a/main.go
+++ b/main.go
@@ -34,8 +34,7 @@ import (
 	sdkVersion "github.com/operator-framework/operator-sdk/version"
 	"github.com/pkg/errors"
 	"github.com/submariner-io/admiral/pkg/log/kzerolog"
-	"github.com/submariner-io/submariner-operator/api"
-	submarinerv1alpha1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers"
 	"github.com/submariner-io/submariner-operator/controllers/submariner"
 	"github.com/submariner-io/submariner-operator/pkg/crd"
@@ -80,7 +79,7 @@ func printVersion() {
 // nolint:wsl // block should not end with a whitespace.
 func init() {
 	utilruntime.Must(clientgoscheme.AddToScheme(scheme))
-	utilruntime.Must(submarinerv1alpha1.AddToScheme(scheme))
+	utilruntime.Must(v1alpha1.AddToScheme(scheme))
 	utilruntime.Must(apiextensions.AddToScheme(scheme))
 	// +kubebuilder:scaffold:scheme
 }
@@ -159,7 +158,7 @@ func main() {
 	}
 
 	// Setup Scheme for all resources
-	if err := api.AddToScheme(mgr.GetScheme()); err != nil {
+	if err := v1alpha1.AddToScheme(mgr.GetScheme()); err != nil {
 		log.Error(err, "")
 		os.Exit(1)
 	}
@@ -242,7 +241,7 @@ func createServiceMonitors(ctx context.Context, cfg *rest.Config, servicePorts [
 func serveCRMetrics(cfg *rest.Config) error {
 	// Below function returns filtered operator/CustomResource specific GVKs.
 	// For more control override the below GVK list with your own custom logic.
-	filteredGVK, err := k8sutil.GetGVKsFromAddToScheme(api.AddToScheme)
+	filteredGVK, err := k8sutil.GetGVKsFromAddToScheme(v1alpha1.AddToScheme)
 	if err != nil {
 		return errors.Wrap(err, "error getting GVKs")
 	}
diff --git a/pkg/discovery/network/network.go b/pkg/discovery/network/network.go
index 6a321623..b11641a7 100644
--- a/pkg/discovery/network/network.go
+++ b/pkg/discovery/network/network.go
@@ -24,7 +24,7 @@ import (
 
 	"github.com/go-logr/logr"
 	"github.com/pkg/errors"
-	submariner "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	"k8s.io/apimachinery/pkg/types"
 	"k8s.io/client-go/dynamic"
@@ -142,7 +142,7 @@ func getGlobalCIDRs(operatorClient client.Client, operatorNamespace string) (str
 		return "", nil
 	}
 
-	existingCfg := submariner.Submariner{}
+	existingCfg := v1alpha1.Submariner{}
 
 	err := operatorClient.Get(context.TODO(), types.NamespacedName{Namespace: operatorNamespace, Name: names.SubmarinerCrName}, &existingCfg)
 	if err != nil {
diff --git a/pkg/embeddedyamls/yamls.go b/pkg/embeddedyamls/yamls.go
index b35e871b..379ad955 100644
--- a/pkg/embeddedyamls/yamls.go
+++ b/pkg/embeddedyamls/yamls.go
@@ -41,7 +41,7 @@ spec:
   - name: v1alpha1
     schema:
       openAPIV3Schema:
-        description: Broker is the Schema for the brokers API
+        description: Broker is the Schema for the brokers API.
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -74,7 +74,7 @@ spec:
                 type: boolean
             type: object
           status:
-            description: BrokerStatus defines the observed state of Broker
+            description: BrokerStatus defines the observed state of Broker.
             type: object
         type: object
     served: true
@@ -109,7 +109,7 @@ spec:
   - name: v1alpha1
     schema:
       openAPIV3Schema:
-        description: Submariner is the Schema for the submariners API
+        description: Submariner is the Schema for the submariners API.
         properties:
           apiVersion:
             description: 'APIVersion defines the versioned schema of this representation
@@ -124,7 +124,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: SubmarinerSpec defines the desired state of Submariner
+            description: SubmarinerSpec defines the desired state of Submariner.
             properties:
               broker:
                 type: string
@@ -223,7 +223,7 @@ spec:
             - serviceCIDR
             type: object
           status:
-            description: SubmarinerStatus defines the observed state of Submariner
+            description: SubmarinerStatus defines the observed state of Submariner.
             properties:
               clusterCIDR:
                 type: string
@@ -990,7 +990,7 @@ spec:
           metadata:
             type: object
           spec:
-            description: ServiceDiscoverySpec defines the desired state of ServiceDiscovery
+            description: ServiceDiscoverySpec defines the desired state of ServiceDiscovery.
             properties:
               brokerK8sApiServer:
                 type: string
@@ -1040,7 +1040,7 @@ spec:
             - namespace
             type: object
           status:
-            description: ServiceDiscoveryStatus defines the observed state of ServiceDiscovery
+            description: ServiceDiscoveryStatus defines the observed state of ServiceDiscovery.
             properties:
               deploymentInfo:
                 properties:
diff --git a/pkg/images/images.go b/pkg/images/images.go
index 9c2f2943..84b4fcfc 100644
--- a/pkg/images/images.go
+++ b/pkg/images/images.go
@@ -23,7 +23,7 @@ import (
 	"os"
 	"strings"
 
-	apis "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	apis "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	v1 "k8s.io/api/core/v1"
 )


Test patch:
diff --git a/controllers/servicediscovery/servicediscovery_controller_test.go b/controllers/servicediscovery/servicediscovery_controller_test.go
index 3ba19fbc..c9ed1ad0 100644
--- a/controllers/servicediscovery/servicediscovery_controller_test.go
+++ b/controllers/servicediscovery/servicediscovery_controller_test.go
@@ -24,7 +24,7 @@ import (
 
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
-	submariner_v1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	submariner_v1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	corev1 "k8s.io/api/core/v1"
diff --git a/controllers/servicediscovery/servicediscovery_suite_test.go b/controllers/servicediscovery/servicediscovery_suite_test.go
index 8e64afbd..1a27cbb0 100644
--- a/controllers/servicediscovery/servicediscovery_suite_test.go
+++ b/controllers/servicediscovery/servicediscovery_suite_test.go
@@ -28,7 +28,7 @@ import (
 	. "github.com/onsi/gomega"
 	operatorv1 "github.com/openshift/api/operator/v1"
 	"github.com/submariner-io/admiral/pkg/log/kzerolog"
-	submariner_v1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	"github.com/submariner-io/submariner-operator/controllers/servicediscovery"
 	"github.com/submariner-io/submariner-operator/controllers/test"
@@ -60,7 +60,7 @@ supercluster.local:53 {
 )
 
 var _ = BeforeSuite(func() {
-	Expect(submariner_v1.AddToScheme(scheme.Scheme)).To(Succeed())
+	Expect(v1alpha1.AddToScheme(scheme.Scheme)).To(Succeed())
 	Expect(operatorv1.Install(scheme.Scheme)).To(Succeed())
 })
 
@@ -76,7 +76,7 @@ func TestSubmariner(t *testing.T) {
 type testDriver struct {
 	test.Driver
 	kubeClient       *fakeKubeClient.Clientset
-	serviceDiscovery *submariner_v1.ServiceDiscovery
+	serviceDiscovery *v1alpha1.ServiceDiscovery
 }
 
 func newTestDriver() *testDriver {
@@ -202,13 +202,13 @@ func newDNSConfig(clusterIP string) *operatorv1.DNS {
 	return dns
 }
 
-func newServiceDiscovery() *submariner_v1.ServiceDiscovery {
-	return &submariner_v1.ServiceDiscovery{
+func newServiceDiscovery() *v1alpha1.ServiceDiscovery {
+	return &v1alpha1.ServiceDiscovery{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:      serviceDiscoveryName,
 			Namespace: submarinerNamespace,
 		},
-		Spec: submariner_v1.ServiceDiscoverySpec{
+		Spec: v1alpha1.ServiceDiscoverySpec{
 			GlobalnetEnabled:         false,
 			Repository:               "quay.io/submariner",
 			Version:                  "1.0.0",
diff --git a/controllers/submariner/submariner_controller_test.go b/controllers/submariner/submariner_controller_test.go
index 74fb0859..8901635f 100644
--- a/controllers/submariner/submariner_controller_test.go
+++ b/controllers/submariner/submariner_controller_test.go
@@ -25,7 +25,7 @@ import (
 
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
-	operatorv1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	"github.com/submariner-io/submariner-operator/controllers/test"
 	"github.com/submariner-io/submariner-operator/controllers/uninstall"
@@ -209,8 +209,8 @@ func testReconciliation() {
 			t.AssertReconcileSuccess()
 
 			updated := t.getSubmariner()
-			Expect(updated.Spec.Repository).To(Equal(operatorv1.DefaultRepo))
-			Expect(updated.Spec.Version).To(Equal(operatorv1.DefaultSubmarinerVersion))
+			Expect(updated.Spec.Repository).To(Equal(v1alpha1.DefaultRepo))
+			Expect(updated.Spec.Version).To(Equal(v1alpha1.DefaultSubmarinerVersion))
 		})
 	})
 
@@ -238,7 +238,7 @@ func testReconciliation() {
 
 	When("Submariner resource retrieval fails", func() {
 		BeforeEach(func() {
-			t.Client = &test.FailingClient{Client: t.NewClient(), OnGet: reflect.TypeOf(&operatorv1.Submariner{})}
+			t.Client = &test.FailingClient{Client: t.NewClient(), OnGet: reflect.TypeOf(&v1alpha1.Submariner{})}
 		})
 
 		It("should return an error", func() {
@@ -397,7 +397,7 @@ func testDeletion() {
 			t.submariner.Spec.ServiceDiscoveryEnabled = true
 
 			t.InitClientObjs = append(t.InitClientObjs,
-				&operatorv1.ServiceDiscovery{
+				&v1alpha1.ServiceDiscovery{
 					ObjectMeta: metav1.ObjectMeta{
 						Namespace: submarinerNamespace,
 						Name:      names.ServiceDiscoveryCrName,
@@ -413,7 +413,7 @@ func testDeletion() {
 
 			t.AssertReconcileSuccess()
 
-			serviceDiscovery := &operatorv1.ServiceDiscovery{}
+			serviceDiscovery := &v1alpha1.ServiceDiscovery{}
 			err := t.Client.Get(context.TODO(), types.NamespacedName{Name: names.ServiceDiscoveryCrName, Namespace: submarinerNamespace},
 				serviceDiscovery)
 			Expect(errors.IsNotFound(err)).To(BeTrue(), "ServiceDiscovery still exists")
diff --git a/controllers/submariner/submariner_suite_test.go b/controllers/submariner/submariner_suite_test.go
index 202037d7..e1650f27 100644
--- a/controllers/submariner/submariner_suite_test.go
+++ b/controllers/submariner/submariner_suite_test.go
@@ -28,7 +28,7 @@ import (
 	. "github.com/onsi/gomega"
 	"github.com/submariner-io/admiral/pkg/log/kzerolog"
 	"github.com/submariner-io/admiral/pkg/syncer/broker"
-	operatorv1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	"github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/constants"
 	submarinerController "github.com/submariner-io/submariner-operator/controllers/submariner"
 	"github.com/submariner-io/submariner-operator/controllers/test"
@@ -44,7 +44,7 @@ import (
 )
 
 var _ = BeforeSuite(func() {
-	Expect(operatorv1.AddToScheme(scheme.Scheme)).To(Succeed())
+	Expect(v1alpha1.AddToScheme(scheme.Scheme)).To(Succeed())
 	Expect(apiextensions.AddToScheme(scheme.Scheme)).To(Succeed())
 	Expect(submarinerv1.AddToScheme(scheme.Scheme)).To(Succeed())
 })
@@ -60,7 +60,7 @@ func TestSubmariner(t *testing.T) {
 
 type testDriver struct {
 	test.Driver
-	submariner     *operatorv1.Submariner
+	submariner     *v1alpha1.Submariner
 	clusterNetwork *network.ClusterNetwork
 }
 
@@ -105,8 +105,8 @@ func (t *testDriver) awaitSubmarinerDeleted() {
 	t.AwaitNoResource(t.submariner)
 }
 
-func (t *testDriver) getSubmariner() *operatorv1.Submariner {
-	obj := &operatorv1.Submariner{}
+func (t *testDriver) getSubmariner() *v1alpha1.Submariner {
+	obj := &v1alpha1.Submariner{}
 	err := t.Client.Get(context.TODO(), types.NamespacedName{Name: submarinerName, Namespace: submarinerNamespace}, obj)
 	Expect(err).To(Succeed())
 
@@ -133,7 +133,7 @@ func (t *testDriver) assertUninstallRouteAgentDaemonSet() *appsv1.DaemonSet {
 	return daemonSet
 }
 
-func (t *testDriver) assertRouteAgentDaemonSetEnv(submariner *operatorv1.Submariner, envMap map[string]string) {
+func (t *testDriver) assertRouteAgentDaemonSetEnv(submariner *v1alpha1.Submariner, envMap map[string]string) {
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_NAMESPACE", submariner.Spec.Namespace))
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_CLUSTERID", submariner.Spec.ClusterID))
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_CLUSTERCIDR", submariner.Status.ClusterCIDR))
@@ -164,7 +164,7 @@ func (t *testDriver) assertUninstallGatewayDaemonSet() *appsv1.DaemonSet {
 	return daemonSet
 }
 
-func (t *testDriver) assertGatewayDaemonSetEnv(submariner *operatorv1.Submariner, envMap map[string]string) {
+func (t *testDriver) assertGatewayDaemonSetEnv(submariner *v1alpha1.Submariner, envMap map[string]string) {
 	Expect(envMap).To(HaveKeyWithValue("CE_IPSEC_PSK", submariner.Spec.CeIPSecPSK))
 	Expect(envMap).To(HaveKeyWithValue("CE_IPSEC_NATTPORT", strconv.Itoa(submariner.Spec.CeIPSecNATTPort)))
 	Expect(envMap).To(HaveKeyWithValue(broker.EnvironmentVariable("RemoteNamespace"), submariner.Spec.BrokerK8sRemoteNamespace))
@@ -206,7 +206,7 @@ func (t *testDriver) assertUninstallGlobalnetDaemonSet() *appsv1.DaemonSet {
 	return daemonSet
 }
 
-func (t *testDriver) assertGlobalnetDaemonSetEnv(submariner *operatorv1.Submariner, envMap map[string]string) {
+func (t *testDriver) assertGlobalnetDaemonSetEnv(submariner *v1alpha1.Submariner, envMap map[string]string) {
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_NAMESPACE", submariner.Spec.Namespace))
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_CLUSTERID", submariner.Spec.ClusterID))
 }
@@ -232,7 +232,7 @@ func (t *testDriver) assertUninstallNetworkPluginSyncerDeployment() *appsv1.Depl
 	return deployment
 }
 
-func (t *testDriver) assertNetworkPluginSyncerDeploymentEnv(submariner *operatorv1.Submariner, envMap map[string]string) {
+func (t *testDriver) assertNetworkPluginSyncerDeploymentEnv(submariner *v1alpha1.Submariner, envMap map[string]string) {
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_NAMESPACE", submariner.Spec.Namespace))
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_CLUSTERID", submariner.Spec.ClusterID))
 	Expect(envMap).To(HaveKeyWithValue("SUBMARINER_CLUSTERCIDR", submariner.Status.ClusterCIDR))
@@ -246,7 +246,7 @@ func assertGatewayNodeSelector(daemonSet *appsv1.DaemonSet) {
 	Expect(daemonSet.Spec.Template.Spec.NodeSelector["submariner.io/gateway"]).To(Equal("true"))
 }
 
-func (t *testDriver) withNetworkDiscovery() *operatorv1.Submariner {
+func (t *testDriver) withNetworkDiscovery() *v1alpha1.Submariner {
 	t.submariner.Status.ClusterCIDR = getClusterCIDR(t.submariner, t.clusterNetwork)
 	t.submariner.Status.ServiceCIDR = getServiceCIDR(t.submariner, t.clusterNetwork)
 	t.submariner.Status.GlobalCIDR = getGlobalCIDR(t.submariner, t.clusterNetwork)
@@ -255,13 +255,13 @@ func (t *testDriver) withNetworkDiscovery() *operatorv1.Submariner {
 	return t.submariner
 }
 
-func newSubmariner() *operatorv1.Submariner {
-	return &operatorv1.Submariner{
+func newSubmariner() *v1alpha1.Submariner {
+	return &v1alpha1.Submariner{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:      submarinerName,
 			Namespace: submarinerNamespace,
 		},
-		Spec: operatorv1.SubmarinerSpec{
+		Spec: v1alpha1.SubmarinerSpec{
 			Repository:               "quay.io/submariner",
 			Version:                  "0.12.0",
 			CeIPSecNATTPort:          4500,
@@ -284,7 +284,7 @@ func newSubmariner() *operatorv1.Submariner {
 	}
 }
 
-func getClusterCIDR(submariner *operatorv1.Submariner, clusterNetwork *network.ClusterNetwork) string {
+func getClusterCIDR(submariner *v1alpha1.Submariner, clusterNetwork *network.ClusterNetwork) string {
 	if submariner.Spec.ClusterCIDR != "" {
 		return submariner.Spec.ClusterCIDR
 	}
@@ -292,7 +292,7 @@ func getClusterCIDR(submariner *operatorv1.Submariner, clusterNetwork *network.C
 	return clusterNetwork.PodCIDRs[0]
 }
 
-func getServiceCIDR(submariner *operatorv1.Submariner, clusterNetwork *network.ClusterNetwork) string {
+func getServiceCIDR(submariner *v1alpha1.Submariner, clusterNetwork *network.ClusterNetwork) string {
 	if submariner.Spec.ServiceCIDR != "" {
 		return submariner.Spec.ServiceCIDR
 	}
@@ -300,7 +300,7 @@ func getServiceCIDR(submariner *operatorv1.Submariner, clusterNetwork *network.C
 	return clusterNetwork.ServiceCIDRs[0]
 }
 
-func getGlobalCIDR(submariner *operatorv1.Submariner, clusterNetwork *network.ClusterNetwork) string {
+func getGlobalCIDR(submariner *v1alpha1.Submariner, clusterNetwork *network.ClusterNetwork) string {
 	if submariner.Spec.GlobalCIDR != "" {
 		return submariner.Spec.GlobalCIDR
 	}
diff --git a/pkg/images/image_parsing_test.go b/pkg/images/image_parsing_test.go
index 34ce59ae..0716f473 100644
--- a/pkg/images/image_parsing_test.go
+++ b/pkg/images/image_parsing_test.go
@@ -23,7 +23,7 @@ import (
 
 	. "github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
-	apis "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	apis "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/pkg/images"
 )
 
diff --git a/test/e2e/cleanup/submariner.go b/test/e2e/cleanup/submariner.go
index 3d14d9c7..43c1f8cf 100644
--- a/test/e2e/cleanup/submariner.go
+++ b/test/e2e/cleanup/submariner.go
@@ -30,7 +30,7 @@ import (
 	. "github.com/onsi/gomega"
 	"github.com/submariner-io/admiral/pkg/watcher"
 	"github.com/submariner-io/shipyard/test/e2e/framework"
-	operatorv1alpha1 "github.com/submariner-io/submariner-operator/api/submariner/v1alpha1"
+	operatorv1alpha1 "github.com/submariner-io/submariner-operator/api/v1alpha1"
 	"github.com/submariner-io/submariner-operator/controllers/uninstall"
 	"github.com/submariner-io/submariner-operator/pkg/names"
 	submarinerclientset "github.com/submariner-io/submariner/pkg/client/clientset/versioned"