Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⚠️ Deprecate v1alpha7 #2026

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/v1alpha7/openstackcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ type OpenStackClusterStatus struct {
// +kubebuilder:object:root=true
// +kubebuilder:resource:path=openstackclusters,scope=Namespaced,categories=cluster-api,shortName=osc
// +kubebuilder:subresource:status
// +kubebuilder:deprecatedversion:warning="The v1alpha7 version of OpenStackCluster has been deprecated and will be removed in a future release."
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this OpenStackCluster belongs"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for OpenStack instances"
// +kubebuilder:printcolumn:name="Network",type="string",JSONPath=".status.network.id",description="Network the cluster is using"
Expand All @@ -242,6 +243,8 @@ type OpenStackClusterStatus struct {
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStackCluster"

// OpenStackCluster is the Schema for the openstackclusters API.
//
// Deprecated: v1alpha7.OpenStackCluster has been replaced by v1beta1.OpenStackCluster.
type OpenStackCluster struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -253,6 +256,8 @@ type OpenStackCluster struct {
// +kubebuilder:object:root=true

// OpenStackClusterList contains a list of OpenStackCluster.
//
// Deprecated: v1alpha7.OpenStackClusterList has been replaced by v1beta1.OpenStackClusterList.
type OpenStackClusterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha7/openstackclustertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ type OpenStackClusterTemplateSpec struct {
// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true
// +kubebuilder:deprecatedversion:warning="The v1alpha7 version of OpenStackClusterTemplate has been deprecated and will be removed in a future release."
// +kubebuilder:resource:path=openstackclustertemplates,scope=Namespaced,categories=cluster-api,shortName=osct

// OpenStackClusterTemplate is the Schema for the openstackclustertemplates API.
//
// Deprecated: v1alpha7.OpenStackClusterTemplate has been replaced by v1beta1.OpenStackClusterTemplate.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also need to add the Deprecated note to OpenStackClusterTemplateList, OpenStackMachineList and OpenStackMachineTemplateList?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment was addressed. Thanks Matt!

type OpenStackClusterTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -46,6 +49,8 @@ type OpenStackClusterTemplate struct {
//+kubebuilder:object:root=true

// OpenStackClusterTemplateList contains a list of OpenStackClusterTemplate.
//
// Deprecated: v1alpha7.OpenStackClusterTemplateList has been replaced by v1beta1.OpenStackClusterTemplateList.
type OpenStackClusterTemplateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha7/openstackmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ type OpenStackMachineStatus struct {
// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true
// +kubebuilder:deprecatedversion:warning="The v1alpha7 version of OpenStackMachine has been deprecated and will be removed in a future release."
// +kubebuilder:resource:path=openstackmachines,scope=Namespaced,categories=cluster-api,shortName=osm
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this OpenStackMachine belongs"
Expand All @@ -149,6 +150,8 @@ type OpenStackMachineStatus struct {
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of OpenStackMachine"

// OpenStackMachine is the Schema for the openstackmachines API.
//
// Deprecated: v1alpha7.OpenStackMachine has been replaced by v1beta1.OpenStackMachine.
type OpenStackMachine struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -160,6 +163,8 @@ type OpenStackMachine struct {
// +kubebuilder:object:root=true

// OpenStackMachineList contains a list of OpenStackMachine.
//
// Deprecated: v1alpha7.OpenStackMachineList has been replaced by v1beta1.OpenStackMachineList.
type OpenStackMachineList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha7/openstackmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ type OpenStackMachineTemplateSpec struct {
// +genclient
// +genclient:Namespaced
// +kubebuilder:object:root=true
// +kubebuilder:deprecatedversion:warning="The v1alpha7 version of OpenStackMachineTemplate has been deprecated and will be removed in a future release."
// +kubebuilder:resource:path=openstackmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=osmt

// OpenStackMachineTemplate is the Schema for the openstackmachinetemplates API.
//
// Deprecated: v1alpha7.OpenStackMachineTemplate has been replaced by v1beta1.OpenStackMachineTemplate.
type OpenStackMachineTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -41,6 +44,8 @@ type OpenStackMachineTemplate struct {
// +kubebuilder:object:root=true

// OpenStackMachineTemplateList contains a list of OpenStackMachineTemplate.
//
// Deprecated: v1alpha7.OpenStackMachineTemplateList has been replaced by v1beta1.OpenStackMachineTemplateList.
type OpenStackMachineTemplateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Expand Down

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

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

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

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

4 changes: 4 additions & 0 deletions docs/book/src/api/v1alpha7/api.md

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

6 changes: 3 additions & 3 deletions test/e2e/suites/apivalidations/openstackcluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ var _ = Describe("OpenStackCluster API validations", func() {
})

Context("v1alpha7", func() {
var cluster *infrav1alpha7.OpenStackCluster
var cluster *infrav1alpha7.OpenStackCluster //nolint: staticcheck

BeforeEach(func() {
// Initialise a basic cluster object in the correct namespace
cluster = &infrav1alpha7.OpenStackCluster{}
cluster = &infrav1alpha7.OpenStackCluster{} //nolint: staticcheck
cluster.Namespace = namespace.Name
cluster.GenerateName = clusterNamePrefix
})
Expand All @@ -210,7 +210,7 @@ var _ = Describe("OpenStackCluster API validations", func() {
Expect(k8sClient.Update(ctx, infrav1Cluster)).To(Succeed(), "Setting control plane endpoint should succeed")

// Fetch the v1alpha7 version of the cluster and ensure that both the new control plane endpoint and the identityRef.Kind are present
cluster = &infrav1alpha7.OpenStackCluster{}
cluster = &infrav1alpha7.OpenStackCluster{} //nolint:staticcheck
Expect(k8sClient.Get(ctx, types.NamespacedName{Name: infrav1Cluster.Name, Namespace: infrav1Cluster.Namespace}, cluster)).To(Succeed(), "OpenStackCluster fetch should succeed")
Expect(cluster.Spec.ControlPlaneEndpoint).To(Equal(*infrav1Cluster.Spec.ControlPlaneEndpoint), "Control plane endpoint should be restored")
Expect(cluster.Spec.IdentityRef.Kind).To(Equal("FakeKind"), "IdentityRef.Kind should be restored")
Expand Down