Skip to content

Commit f761026

Browse files
authored
Merge pull request #8 from weaveworks/drop-cluster-id
Drop UID field from test fixtures.
2 parents 29bbde9 + 23240fb commit f761026

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

controllers/bootstrap_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const (
2525
testConfigName = "test-config"
2626
testClusterName = "test-cluster"
2727
testNamespace = "testing"
28-
testClusterUID = "ecf40f3f-9341-4b1c-bc58-69ff2602d31b"
2928
)
3029

3130
func Test_bootstrapClusterWithConfig(t *testing.T) {
@@ -80,7 +79,6 @@ func Test_bootstrapClusterWithConfig_sets_owner(t *testing.T) {
8079
APIVersion: "cluster.x-k8s.io/v1beta1",
8180
Kind: "Cluster",
8281
Name: testClusterName,
83-
UID: testClusterUID,
8482
},
8583
}
8684
if diff := cmp.Diff(want, jobList.Items[0].ObjectMeta.OwnerReferences); diff != "" {
@@ -127,7 +125,6 @@ func makeTestCluster(opts ...func(*clusterv1.Cluster)) *clusterv1.Cluster {
127125
ObjectMeta: metav1.ObjectMeta{
128126
Name: testClusterName,
129127
Namespace: testNamespace,
130-
UID: testClusterUID,
131128
},
132129
Spec: clusterv1.ClusterSpec{},
133130
}

controllers/cluster_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
corev1 "k8s.io/api/core/v1"
88
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
99
"k8s.io/apimachinery/pkg/runtime"
10-
"k8s.io/apimachinery/pkg/types"
1110
"sigs.k8s.io/controller-runtime/pkg/client"
1211
"sigs.k8s.io/controller-runtime/pkg/client/fake"
1312
)
@@ -74,7 +73,6 @@ func makeNode(labels map[string]string, conds ...corev1.NodeCondition) *corev1.N
7473
ObjectMeta: metav1.ObjectMeta{
7574
Name: "test-control-plane",
7675
Labels: labels,
77-
UID: types.UID("f046e20e-df55-40d0-ab3a-76ff56617575"),
7876
},
7977
Spec: corev1.NodeSpec{},
8078
Status: corev1.NodeStatus{

controllers/clusterbootstrapconfig_controller_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ func TestReconcile_when_cluster_ready(t *testing.T) {
101101
})
102102
readyNode := makeNode(map[string]string{
103103
"node-role.kubernetes.io/control-plane": "",
104-
}, corev1.NodeCondition{Type: "Ready", Status: "True", LastHeartbeatTime: metav1.Now(), LastTransitionTime: metav1.Now(), Reason: "KubeletReady", Message: "kubelet is posting ready status"})
104+
}, corev1.NodeCondition{
105+
Type: "Ready", Status: "True", LastHeartbeatTime: metav1.Now(), LastTransitionTime: metav1.Now(), Reason: "KubeletReady", Message: "kubelet is posting ready status"})
105106

106107
cl := makeTestCluster(func(c *clusterv1.Cluster) {
107108
c.ObjectMeta.Labels = bc.Spec.ClusterSelector.MatchLabels
@@ -209,7 +210,9 @@ func TestReconcile_when_cluster_ready_and_old_label(t *testing.T) {
209210
})
210211
readyNode := makeNode(map[string]string{
211212
"node-role.kubernetes.io/master": "",
212-
}, corev1.NodeCondition{Type: "Ready", Status: "True", LastHeartbeatTime: metav1.Now(), LastTransitionTime: metav1.Now(), Reason: "KubeletReady", Message: "kubelet is posting ready status"})
213+
}, corev1.NodeCondition{Type: "Ready", Status: "True", LastHeartbeatTime: metav1.Now(),
214+
LastTransitionTime: metav1.Now(), Reason: "KubeletReady",
215+
Message: "kubelet is posting ready status"})
213216

214217
cl := makeTestCluster(func(c *clusterv1.Cluster) {
215218
c.ObjectMeta.Labels = bc.Spec.ClusterSelector.MatchLabels

0 commit comments

Comments
 (0)