Skip to content

Commit

Permalink
Add Kind constants for CAPX
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickstruyf3 committed Dec 8, 2023
1 parent d0096cf commit 678afbe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
3 changes: 3 additions & 0 deletions api/v1beta1/nutanixcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
)

const (
// NutanixClusterKind represents the Kind of NutanixCluster
NutanixClusterKind = "NutanixClusterKind"

// NutanixClusterFinalizer allows NutanixClusterReconciler to clean up AHV
// resources associated with NutanixCluster before removing it from the
// API Server.
Expand Down
3 changes: 3 additions & 0 deletions api/v1beta1/nutanixmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

const (
// NutanixMachineKind represents the Kind of NutanixMachine
NutanixMachineKind = "NutanixMachineKind"

// NutanixMachineFinalizer allows NutanixMachineReconciler to clean up AHV
// resources associated with NutanixMachine before removing it from the
// API Server.
Expand Down
5 changes: 5 additions & 0 deletions api/v1beta1/nutanixmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ import (

// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

const (
// NutanixMachineTemplateKind represents the Kind of NutanixMachineTemplate
NutanixMachineTemplateKind = "NutanixMachineTemplateKind"
)

// NutanixMachineTemplateSpec defines the desired state of NutanixMachineTemplate
type NutanixMachineTemplateSpec struct {
Template NutanixMachineTemplateResource `json:"template"`
Expand Down
14 changes: 7 additions & 7 deletions controllers/nutanixcluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ func TestNutanixClusterReconciler(t *testing.T) {

_ = Describe("NutanixClusterReconciler", func() {
const (
fd1Name = "fd-1"
fd2Name = "fd-2"
nutanixClusterKind = "NutanixCluster"
clusterKind = "Cluster"
fd1Name = "fd-1"
fd2Name = "fd-2"
// To be replaced with capiv1.ClusterKind
clusterKind = "Cluster"
)

var (
Expand All @@ -74,7 +74,7 @@ func TestNutanixClusterReconciler(t *testing.T) {
}
ntnxCluster = &infrav1.NutanixCluster{
TypeMeta: metav1.TypeMeta{
Kind: nutanixClusterKind,
Kind: infrav1.NutanixClusterKind,
APIVersion: infrav1.GroupVersion.String(),
},
ObjectMeta: metav1.ObjectMeta{
Expand Down Expand Up @@ -264,7 +264,7 @@ func TestNutanixClusterReconciler(t *testing.T) {
ntnxSecret.OwnerReferences = []metav1.OwnerReference{
{
APIVersion: infrav1.GroupVersion.String(),
Kind: nutanixClusterKind,
Kind: infrav1.NutanixClusterKind,
UID: additionalNtnxCluster.UID,
Name: additionalNtnxCluster.Name,
},
Expand Down Expand Up @@ -314,7 +314,7 @@ func TestNutanixClusterReconciler(t *testing.T) {
ntnxSecret.OwnerReferences = []metav1.OwnerReference{
{
APIVersion: infrav1.GroupVersion.String(),
Kind: nutanixClusterKind,
Kind: infrav1.NutanixClusterKind,
UID: ntnxCluster.UID,
Name: ntnxCluster.Name,
},
Expand Down

0 comments on commit 678afbe

Please sign in to comment.