Skip to content

Commit

Permalink
Move OpenStackFloatingIPPool to v1alpha1
Browse files Browse the repository at this point in the history
  • Loading branch information
mdbooth authored and bilbobrovall committed Jan 15, 2024
1 parent b0a4a07 commit 5a5a51d
Show file tree
Hide file tree
Showing 14 changed files with 311 additions and 190 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ generate-go: $(MOCKGEN)
paths=./api/... \
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha1 \
--input-dirs=./api/v1alpha5 \
--input-dirs=./api/v1alpha6 \
--input-dirs=./api/v1alpha7 \
Expand Down
22 changes: 22 additions & 0 deletions api/v1alpha1/conditions_consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
Copyright 2023 The Kubernetes Authors.
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

const (
// OpenstackFloatingIPPoolReadyCondition reports on the current status of the floating ip pool. Ready indicates that the pool is ready to be used.
OpenstackFloatingIPPoolReadyCondition = "OpenstackFloatingIPPoolReadyCondition"
)
17 changes: 17 additions & 0 deletions api/v1alpha1/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Copyright 2023 The Kubernetes Authors.
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
36 changes: 36 additions & 0 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2023 The Kubernetes Authors.
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 infrastructure v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=infrastructure.cluster.x-k8s.io
package v1alpha1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects.
GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1alpha8
package v1alpha1

import (
"fmt"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"

// We use v1alpha7 here rather than anything newer because as of writing
// it is the newest API version we should no longer be making breaking
// changes to. If we bump this we need to look carefully for resulting
// CRD changes in v1alpha1 to ensure they are compatible.
"sigs.k8s.io/cluster-api-provider-openstack/api/v1alpha7"
)

const (
Expand Down Expand Up @@ -50,11 +56,11 @@ type OpenStackFloatingIPPoolSpec struct {

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

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

// The name of the cloud to use from the clouds secret
// +optional
Expand Down Expand Up @@ -82,7 +88,7 @@ type OpenStackFloatingIPPoolStatus struct {

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

Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}
Expand Down
154 changes: 154 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions api/v1alpha8/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,4 @@ const (
LoadBalancerMemberErrorReason = "LoadBalancerMemberError"
// FloatingIPErrorReason used when the floating ip could not be created or attached.
FloatingIPErrorReason = "FloatingIPError"

// OpenstackFloatingIPPoolReadyCondition reports on the current status of the floating ip pool. Ready indicates that the pool is ready to be used.
OpenstackFloatingIPPoolReadyCondition = "OpenstackFloatingIPPoolReadyCondition"
)
Loading

0 comments on commit 5a5a51d

Please sign in to comment.