Skip to content

Commit 700d533

Browse files
committed
Move OpenStackFloatingIPPool to v1alpha1
1 parent a8a23b1 commit 700d533

18 files changed

+2642
-2355
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ generate-go: $(MOCKGEN)
257257
paths=./api/... \
258258
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
259259
$(CONVERSION_GEN) \
260+
--input-dirs=./api/v1alpha1 \
260261
--input-dirs=./api/v1alpha5 \
261262
--input-dirs=./api/v1alpha6 \
262263
--input-dirs=./api/v1alpha7 \

api/v1alpha1/conditions_consts.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
const (
20+
// OpenstackFloatingIPPoolReadyCondition reports on the current status of the floating ip pool. Ready indicates that the pool is ready to be used.
21+
OpenstackFloatingIPPoolReadyCondition = "OpenstackFloatingIPPoolReadyCondition"
22+
)

api/v1alpha1/doc.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1

api/v1alpha1/groupversion_info.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Copyright 2023 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// package v1alpha1 contains API Schema definitions for the infrastructure v1alpha1 API group
18+
// +kubebuilder:object:generate=true
19+
// +groupName=infrastructure.cluster.x-k8s.io
20+
package v1alpha1
21+
22+
import (
23+
"k8s.io/apimachinery/pkg/runtime/schema"
24+
"sigs.k8s.io/controller-runtime/pkg/scheme"
25+
)
26+
27+
var (
28+
// GroupVersion is group version used to register these objects.
29+
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha1"}
30+
31+
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
32+
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
33+
34+
// AddToScheme adds the types in this group-version to the given scheme.
35+
AddToScheme = SchemeBuilder.AddToScheme
36+
)

api/v1alpha8/openstackfloatingippool_types.go renamed to api/v1alpha1/openstackfloatingippool_types.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
package v1alpha8
17+
package v1alpha1
1818

1919
import (
2020
"fmt"
2121

2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2323
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
24+
25+
// We use v1alpha7 here rather than anything newer because as of writing
26+
// it is the newest API version we should no longer be making breaking
27+
// changes to. If we bump this we need to look carefully for resulting
28+
// CRD changes in v1alpha1 to ensure they are compatible.
29+
"sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7"
2430
)
2531

2632
const (
@@ -50,11 +56,11 @@ type OpenStackFloatingIPPoolSpec struct {
5056

5157
// IdentityRef is a reference to a identity to be used when reconciling this pool.
5258
// +optional
53-
IdentityRef *OpenStackIdentityReference `json:"identityRef,omitempty"`
59+
IdentityRef *v1alpha7.OpenStackIdentityReference `json:"identityRef,omitempty"`
5460

5561
// FloatingIPNetwork is the external network to use for floating ips, if there's only one external network it will be used by default
5662
// +optional
57-
FloatingIPNetwork NetworkFilter `json:"floatingIPNetwork"`
63+
FloatingIPNetwork v1alpha7.NetworkFilter `json:"floatingIPNetwork"`
5864

5965
// The name of the cloud to use from the clouds secret
6066
// +optional
@@ -82,7 +88,7 @@ type OpenStackFloatingIPPoolStatus struct {
8288

8389
// floatingIPNetwork contains information about the network used for floating ips
8490
// +optional
85-
FloatingIPNetwork *NetworkStatus `json:"floatingIPNetwork,omitempty"`
91+
FloatingIPNetwork *v1alpha7.NetworkStatus `json:"floatingIPNetwork,omitempty"`
8692

8793
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
8894
}

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 154 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha8/conditions_consts.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,4 @@ const (
5252
LoadBalancerMemberErrorReason = "LoadBalancerMemberError"
5353
// FloatingIPErrorReason used when the floating ip could not be created or attached.
5454
FloatingIPErrorReason = "FloatingIPError"
55-
56-
// OpenstackFloatingIPPoolReadyCondition reports on the current status of the floating ip pool. Ready indicates that the pool is ready to be used.
57-
OpenstackFloatingIPPoolReadyCondition = "OpenstackFloatingIPPoolReadyCondition"
5855
)

0 commit comments

Comments
 (0)