@@ -30,6 +30,10 @@ func NewClient() *Client {
30
30
testPod1 .Labels = make (map [string ]string )
31
31
testPod1 .Labels [configuration .LabelPodSwiftV2 ] = podNetwork
32
32
33
+ testPod2 := v1.Pod {}
34
+ testPod2 .Labels = make (map [string ]string )
35
+ testPod2 .Labels [configuration .LabelPodSwiftV2 ] = podNetwork
36
+
33
37
testPod3 := v1.Pod {}
34
38
testPod3 .Labels = make (map [string ]string )
35
39
testPod3 .Labels [configuration .LabelPodSwiftV2 ] = podNetwork
@@ -38,19 +42,24 @@ func NewClient() *Client {
38
42
testPod4 .Labels = make (map [string ]string )
39
43
testPod4 .Labels [configuration .LabelPodSwiftV2 ] = podNetwork
40
44
41
- testMTPNC1 := v1alpha1.MultitenantPodNetworkConfig {}
45
+ testMTPNC1 := v1alpha1.MultitenantPodNetworkConfig {
46
+ Status : v1alpha1.MultitenantPodNetworkConfigStatus {
47
+ PrimaryIP : "192.168.0.1/32" ,
48
+ MacAddress : "00:00:00:00:00:00" ,
49
+ GatewayIP : "10.0.0.1" ,
50
+ NCID : "testncid" ,
51
+ },
52
+ }
42
53
43
- testMTPNC1 .Status .PrimaryIP = "192.168.0.1/32"
44
- testMTPNC1 .Status .MacAddress = "00:00:00:00:00:00"
45
- testMTPNC1 .Status .GatewayIP = "10.0.0.1"
46
- testMTPNC1 .Status .NCID = "testncid"
54
+ testMTPNC2 := v1alpha1.MultitenantPodNetworkConfig {}
47
55
48
56
testMTPNC4 := v1alpha1.MultitenantPodNetworkConfig {}
49
57
50
58
return & Client {
51
59
mtPodCache : map [string ]* v1.Pod {"testpod1namespace/testpod1" : & testPod1 , "testpod3namespace/testpod3" : & testPod3 , "testpod4namespace/testpod4" : & testPod4 },
52
60
mtpncCache : map [string ]* v1alpha1.MultitenantPodNetworkConfig {
53
61
"testpod1namespace/testpod1" : & testMTPNC1 ,
62
+ "testpod2namespace/testpod2" : & testMTPNC2 ,
54
63
"testpod4namespace/testpod4" : & testMTPNC4 ,
55
64
},
56
65
}
@@ -74,3 +83,17 @@ func (c *Client) Get(_ context.Context, key client.ObjectKey, obj client.Object,
74
83
}
75
84
return nil
76
85
}
86
+
87
+ func (c * Client ) SetMTPNCReady () {
88
+ testMTPNC1 := v1alpha1.MultitenantPodNetworkConfig {}
89
+ testMTPNC1 .Status .PrimaryIP = "192.168.0.1/32"
90
+ testMTPNC1 .Status .MacAddress = "00:00:00:00:00:00"
91
+ testMTPNC1 .Status .GatewayIP = "10.0.0.1"
92
+ testMTPNC1 .Status .NCID = "testncid"
93
+ c .mtpncCache ["testpod1namespace/testpod1" ] = & testMTPNC1
94
+ }
95
+
96
+ func (c * Client ) SetMTPNCNotReady () {
97
+ testMTPNC1 := v1alpha1.MultitenantPodNetworkConfig {}
98
+ c .mtpncCache ["testpod1namespace/testpod1" ] = & testMTPNC1
99
+ }
0 commit comments