Skip to content

Commit

Permalink
Stop serving v1alpha5 API Versions
Browse files Browse the repository at this point in the history
Signed-off-by: Kashif Khan <kashif.khan@est.tech>
  • Loading branch information
kashifest committed Dec 19, 2023
1 parent 24e63ad commit 8672b2a
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 53 deletions.
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ type Metal3ClusterStatus struct {
// +kubebuilder:resource:path=metal3clusters,scope=Namespaced,categories=cluster-api,shortName=m3c;m3cluster;m3clusters;metal3c;metal3cluster
// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3Cluster"
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="metal3Cluster is Ready"
// +kubebuilder:printcolumn:name="Error",type="string",JSONPath=".status.failureReason",description="Most recent error"
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3data_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ type Metal3DataStatus struct {
// +kubebuilder:resource:path=metal3datas,scope=Namespaced,categories=cluster-api,shortName=m3d;m3data;m3datas;metal3d;metal3data
// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3Data"
// Metal3Data is the Schema for the metal3datas API.
type Metal3Data struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3dataclaim_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ type Metal3DataClaimStatus struct {
// +kubebuilder:resource:path=metal3dataclaims,scope=Namespaced,categories=cluster-api,shortName=m3dc;m3dataclaim;m3dataclaims;metal3dc;metal3dataclaim
// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3DataClaim"
// Metal3DataClaim is the Schema for the metal3datas API.
type Metal3DataClaim struct {
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3datatemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ type Metal3DataTemplateStatus struct {
// +kubebuilder:resource:path=metal3datatemplates,scope=Namespaced,categories=cluster-api,shortName=m3dt;m3datatemplate;m3datatemplates;metal3dt;metal3datatemplate
// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this template belongs"
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3DataTemplate"

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ type Metal3MachineStatus struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:path=metal3machines,scope=Namespaced,categories=cluster-api,shortName=m3m;m3machine;m3machines;metal3m;metal3machine
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3Machine"
// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID"
Expand Down
44 changes: 0 additions & 44 deletions api/v1alpha5/metal3machine_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ package v1alpha5
import (
"testing"

"github.com/onsi/gomega"
"golang.org/x/net/context"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
)

func TestSpecIsValid(t *testing.T) {
Expand Down Expand Up @@ -160,43 +156,3 @@ func TestSpecIsValid(t *testing.T) {
}
}
}

func TestStorageMetal3MachineSpec(t *testing.T) {
key := types.NamespacedName{
Name: "foo",
Namespace: "default",
}

created := &Metal3Machine{
ObjectMeta: metav1.ObjectMeta{
Name: "foo",
Namespace: "default",
},
Spec: Metal3MachineSpec{
UserData: &corev1.SecretReference{
Name: "foo",
},
},
}

g := gomega.NewGomegaWithT(t)

// Test Create
fetched := &Metal3Machine{}
g.Expect(c.Create(context.TODO(), created)).NotTo(gomega.HaveOccurred())

g.Expect(c.Get(context.TODO(), key, fetched)).NotTo(gomega.HaveOccurred())
g.Expect(fetched).To(gomega.Equal(created))

// Test Updating the Labels
updated := fetched.DeepCopy()
updated.Labels = map[string]string{"hello": "world"}
g.Expect(c.Update(context.TODO(), updated)).NotTo(gomega.HaveOccurred())

g.Expect(c.Get(context.TODO(), key, fetched)).NotTo(gomega.HaveOccurred())
g.Expect(fetched).To(gomega.Equal(updated))

// Test Delete
g.Expect(c.Delete(context.TODO(), fetched)).NotTo(gomega.HaveOccurred())
g.Expect(c.Get(context.TODO(), key, fetched)).To(gomega.HaveOccurred())
}
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3machinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ type Metal3MachineTemplateSpec struct {

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Metal3MachineTemplate"
// +kubebuilder:resource:path=metal3machinetemplates,scope=Namespaced,categories=cluster-api,shortName=m3mt;m3machinetemplate;m3machinetemplates;metal3mt;metal3machinetemplate

Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3remediation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ type Metal3RemediationStatus struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:resource:path=metal3remediations,scope=Namespaced,categories=cluster-api,shortName=m3r;m3remediation
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Retry limit",type=string,JSONPath=".spec.strategy.retryLimit",description="How many times remediation controller should attempt to remediate the host"
// +kubebuilder:printcolumn:name="Retry count",type=string,JSONPath=".status.retryCount",description="How many times remediation controller has tried to remediate the node"
Expand Down
2 changes: 2 additions & 0 deletions api/v1alpha5/metal3remediationtemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type Metal3RemediationTemplateStatus struct {
// +kubebuilder:resource:path=metal3remediationtemplates,scope=Namespaced,categories=cluster-api,shortName=m3rt;m3remediationtemplate;m3remediationtemplates;metal3rt;metal3remediationtemplate
// +kubebuilder:subresource:status
// +kubebuilder:object:root=true
// +kubebuilder:unservedversion
// +kubebuilder:deprecatedversion

// Metal3RemediationTemplate is the Schema for the metal3remediationtemplates API.
type Metal3RemediationTemplate struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
jsonPath: .spec.controlPlaneEndpoint
name: Endpoint
type: string
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -113,7 +114,7 @@ spec:
- ready
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
jsonPath: .metadata.creationTimestamp
name: Age
type: date
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -133,7 +134,7 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
jsonPath: .metadata.creationTimestamp
name: Age
type: date
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -174,7 +175,7 @@ spec:
type: boolean
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
jsonPath: .metadata.creationTimestamp
name: Age
type: date
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -848,7 +849,7 @@ spec:
type: string
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -376,7 +377,7 @@ spec:
x-kubernetes-map-type: atomic
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ spec:
jsonPath: .metadata.creationTimestamp
name: Age
type: date
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -232,7 +233,7 @@ spec:
- template
type: object
type: object
served: true
served: false
storage: false
subresources: {}
- additionalPrinterColumns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ spec:
jsonPath: .status.phase
name: Phase
type: string
deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -93,7 +94,7 @@ spec:
type: integer
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ spec:
singular: metal3remediationtemplate
scope: Namespaced
versions:
- name: v1alpha5
- deprecated: true
name: v1alpha5
schema:
openAPIV3Schema:
description: Metal3RemediationTemplate is the Schema for the metal3remediationtemplates
Expand Down Expand Up @@ -98,7 +99,7 @@ spec:
- status
type: object
type: object
served: true
served: false
storage: false
subresources:
status: {}
Expand Down

0 comments on commit 8672b2a

Please sign in to comment.