Skip to content

Commit 0c77ca2

Browse files
authored
Merge pull request #6141 from openshift-cloud-team/webhooks
Move webhooks out of api/v1beta1
2 parents 254c367 + a051b1f commit 0c77ca2

File tree

95 files changed

+2411
-2266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2411
-2266
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
!/controllers/**
88
!/exp/**
99
!/feature/**
10+
!/internal/**
1011
!/pkg/**
1112
!/version/**
1213
!/util/**

.golangci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,15 @@ linters:
231231
# within test files and test utils.
232232
- linters:
233233
- revive
234-
- staticcheck
235234
path: _test\.go
236235
text: should not use dot imports
236+
# Dot imports are used intentionally in internal/api and internal/webhooks
237+
# to avoid verbose type prefixes when working with the v1beta1 API types.
238+
- linters:
239+
- revive
240+
- staticcheck
241+
path: internal/(api|webhooks|test)/
242+
text: should not use dot imports
237243
# Exclude some packages or code to require comments, for example test code, or fake clients.
238244
- linters:
239245
- revive

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
541541
$(CONTROLLER_GEN) \
542542
paths=./api/... \
543543
paths=./$(EXP_DIR)/api/... \
544+
paths=./internal/webhooks/... \
544545
crd:crdVersions=v1 \
545546
rbac:roleName=base-manager-role \
546547
output:crd:dir=$(CRD_ROOT) \

api/v1beta1/azureasomanagedcluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,5 @@ type AzureASOManagedClusterList struct {
9999
}
100100

101101
func init() {
102-
SchemeBuilder.Register(&AzureASOManagedCluster{}, &AzureASOManagedClusterList{})
102+
objectTypes = append(objectTypes, &AzureASOManagedCluster{}, &AzureASOManagedClusterList{})
103103
}

api/v1beta1/azureasomanagedclustertemplate_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ type AzureASOManagedClusterTemplateList struct {
5959
}
6060

6161
func init() {
62-
SchemeBuilder.Register(&AzureASOManagedClusterTemplate{}, &AzureASOManagedClusterTemplateList{})
62+
objectTypes = append(objectTypes, &AzureASOManagedClusterTemplate{}, &AzureASOManagedClusterTemplateList{})
6363
}

api/v1beta1/azureasomanagedcontrolplane_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ type AzureASOManagedControlPlaneList struct {
8787
}
8888

8989
func init() {
90-
SchemeBuilder.Register(&AzureASOManagedControlPlane{}, &AzureASOManagedControlPlaneList{})
90+
objectTypes = append(objectTypes, &AzureASOManagedControlPlane{}, &AzureASOManagedControlPlaneList{})
9191
}

api/v1beta1/azureasomanagedcontrolplanetemplate_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ type AzureASOManagedControlPlaneTemplateList struct {
6464
}
6565

6666
func init() {
67-
SchemeBuilder.Register(&AzureASOManagedControlPlaneTemplate{}, &AzureASOManagedControlPlaneTemplateList{})
67+
objectTypes = append(objectTypes, &AzureASOManagedControlPlaneTemplate{}, &AzureASOManagedControlPlaneTemplateList{})
6868
}

api/v1beta1/azureasomanagedmachinepool_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ type AzureASOManagedMachinePoolList struct {
8282
}
8383

8484
func init() {
85-
SchemeBuilder.Register(&AzureASOManagedMachinePool{}, &AzureASOManagedMachinePoolList{})
85+
objectTypes = append(objectTypes, &AzureASOManagedMachinePool{}, &AzureASOManagedMachinePoolList{})
8686
}

api/v1beta1/azureasomanagedmachinepooltemplate_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ type AzureASOManagedMachinePoolTemplateList struct {
6363
}
6464

6565
func init() {
66-
SchemeBuilder.Register(&AzureASOManagedMachinePoolTemplate{}, &AzureASOManagedMachinePoolTemplateList{})
66+
objectTypes = append(objectTypes, &AzureASOManagedMachinePoolTemplate{}, &AzureASOManagedMachinePoolTemplateList{})
6767
}

api/v1beta1/azurecluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,5 +134,5 @@ func (c *AzureCluster) SetFutures(futures Futures) {
134134
}
135135

136136
func init() {
137-
SchemeBuilder.Register(&AzureCluster{}, &AzureClusterList{})
137+
objectTypes = append(objectTypes, &AzureCluster{}, &AzureClusterList{})
138138
}

0 commit comments

Comments
 (0)