Skip to content

Commit e06fca3

Browse files
committed
Adjust to CR not setting TypeMeta anymore
1 parent 8f2def1 commit e06fca3

File tree

3 files changed

+0
-34
lines changed

3 files changed

+0
-34
lines changed

internal/controllers/clusterresourceset/clusterresourceset_helpers_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func TestGetorCreateClusterResourceSetBinding(t *testing.T) {
117117
func TestGetSecretFromNamespacedName(t *testing.T) {
118118
existingSecretName := types.NamespacedName{Name: "my-secret", Namespace: metav1.NamespaceDefault}
119119
existingSecret := &corev1.Secret{
120-
TypeMeta: metav1.TypeMeta{Kind: "Secret", APIVersion: "v1"},
121120
ObjectMeta: metav1.ObjectMeta{
122121
Name: existingSecretName.Name,
123122
Namespace: existingSecretName.Namespace,
@@ -173,7 +172,6 @@ func TestGetConfigMapFromNamespacedName(t *testing.T) {
173172

174173
existingConfigMapName := types.NamespacedName{Name: "my-configmap", Namespace: metav1.NamespaceDefault}
175174
existingConfigMap := &corev1.ConfigMap{
176-
TypeMeta: metav1.TypeMeta{Kind: "ConfigMap", APIVersion: "v1"},
177175
ObjectMeta: metav1.ObjectMeta{
178176
Name: existingConfigMapName.Name,
179177
Namespace: existingConfigMapName.Namespace,

internal/controllers/machinehealthcheck/machinehealthcheck_targets_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,6 @@ func newTestMachine(name, namespace, clusterName, nodeName string, labels map[st
582582

583583
bootstrap := "bootstrap"
584584
return &clusterv1.Machine{
585-
TypeMeta: metav1.TypeMeta{
586-
APIVersion: clusterv1.GroupVersion.String(),
587-
Kind: "Machine",
588-
},
589585
ObjectMeta: metav1.ObjectMeta{
590586
Name: name,
591587
Namespace: namespace,
@@ -612,10 +608,6 @@ func newTestMachine(name, namespace, clusterName, nodeName string, labels map[st
612608

613609
func newTestNode(name string) *corev1.Node {
614610
return &corev1.Node{
615-
TypeMeta: metav1.TypeMeta{
616-
APIVersion: "v1",
617-
Kind: "Node",
618-
},
619611
ObjectMeta: metav1.ObjectMeta{
620612
Name: name,
621613
},

util/test/builder/builders.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,6 @@ func (c *ClusterClassBuilder) WithWorkerMachinePoolClasses(mpcs ...clusterv1.Mac
483483
// Build takes the objects and variables in the ClusterClass builder and uses them to create a ClusterClass object.
484484
func (c *ClusterClassBuilder) Build() *clusterv1.ClusterClass {
485485
obj := &clusterv1.ClusterClass{
486-
TypeMeta: metav1.TypeMeta{
487-
Kind: "ClusterClass",
488-
APIVersion: clusterv1.GroupVersion.String(),
489-
},
490486
ObjectMeta: metav1.ObjectMeta{
491487
Name: c.name,
492488
Namespace: c.namespace,
@@ -1703,10 +1699,6 @@ func (m *MachinePoolBuilder) WithMinReadySeconds(minReadySeconds int32) *Machine
17031699
// Build creates a new MachinePool with the variables and objects passed to the MachinePoolBuilder.
17041700
func (m *MachinePoolBuilder) Build() *clusterv1.MachinePool {
17051701
obj := &clusterv1.MachinePool{
1706-
TypeMeta: metav1.TypeMeta{
1707-
Kind: "MachinePool",
1708-
APIVersion: clusterv1.GroupVersion.String(),
1709-
},
17101702
ObjectMeta: metav1.ObjectMeta{
17111703
Name: m.name,
17121704
Namespace: m.namespace,
@@ -1833,10 +1825,6 @@ func (m *MachineDeploymentBuilder) WithMinReadySeconds(minReadySeconds int32) *M
18331825
// Build creates a new MachineDeployment with the variables and objects passed to the MachineDeploymentBuilder.
18341826
func (m *MachineDeploymentBuilder) Build() *clusterv1.MachineDeployment {
18351827
obj := &clusterv1.MachineDeployment{
1836-
TypeMeta: metav1.TypeMeta{
1837-
Kind: "MachineDeployment",
1838-
APIVersion: clusterv1.GroupVersion.String(),
1839-
},
18401828
ObjectMeta: metav1.ObjectMeta{
18411829
Name: m.name,
18421830
Namespace: m.namespace,
@@ -1940,10 +1928,6 @@ func (m *MachineSetBuilder) WithOwnerReferences(ownerRefs []metav1.OwnerReferenc
19401928
// Build creates a new MachineSet with the variables and objects passed to the MachineSetBuilder.
19411929
func (m *MachineSetBuilder) Build() *clusterv1.MachineSet {
19421930
obj := &clusterv1.MachineSet{
1943-
TypeMeta: metav1.TypeMeta{
1944-
Kind: "MachineSet",
1945-
APIVersion: clusterv1.GroupVersion.String(),
1946-
},
19471931
ObjectMeta: metav1.ObjectMeta{
19481932
Name: m.name,
19491933
Namespace: m.namespace,
@@ -2015,10 +1999,6 @@ func (m *MachineBuilder) WithLabels(labels map[string]string) *MachineBuilder {
20151999
// Build produces a Machine object from the information passed to the MachineBuilder.
20162000
func (m *MachineBuilder) Build() *clusterv1.Machine {
20172001
machine := &clusterv1.Machine{
2018-
TypeMeta: metav1.TypeMeta{
2019-
Kind: "Machine",
2020-
APIVersion: clusterv1.GroupVersion.String(),
2021-
},
20222002
ObjectMeta: metav1.ObjectMeta{
20232003
Namespace: m.namespace,
20242004
Name: m.name,
@@ -2150,10 +2130,6 @@ func (m *MachineHealthCheckBuilder) WithMaxUnhealthy(maxUnhealthy *intstr.IntOrS
21502130
func (m *MachineHealthCheckBuilder) Build() *clusterv1.MachineHealthCheck {
21512131
// create a MachineHealthCheck with the spec given in the ClusterClass
21522132
mhc := &clusterv1.MachineHealthCheck{
2153-
TypeMeta: metav1.TypeMeta{
2154-
Kind: "MachineHealthCheck",
2155-
APIVersion: clusterv1.GroupVersion.String(),
2156-
},
21572133
ObjectMeta: metav1.ObjectMeta{
21582134
Name: m.name,
21592135
Namespace: m.namespace,

0 commit comments

Comments
 (0)