@@ -30,7 +30,9 @@ func setNetworkInfoVPCStatus(client client.Client, ctx context.Context, obj clie
3030 if args [0 ] == nil {
3131 // if createdVPC is empty, remove the VPC from networkInfo
3232 networkInfo .VPCs = []v1alpha1.VPCState {}
33- client .Update (ctx , networkInfo )
33+ if err := client .Update (ctx , networkInfo ); err != nil {
34+ log .Error (err , "Failed to update NetworkInfo CR" , "NetworkInfo" , networkInfo )
35+ }
3436 return
3537 } else {
3638 createdVPC = args [0 ].(* v1alpha1.VPCState )
@@ -45,7 +47,9 @@ func setNetworkInfoVPCStatus(client client.Client, ctx context.Context, obj clie
4547 return
4648 }
4749 networkInfo .VPCs = []v1alpha1.VPCState {* createdVPC }
48- client .Update (ctx , networkInfo )
50+ if err := client .Update (ctx , networkInfo ); err != nil {
51+ log .Error (err , "Failed to update NetworkInfo CR" , "NetworkInfo" , networkInfo )
52+ }
4953 return
5054}
5155
@@ -71,7 +75,7 @@ func setVPCNetworkConfigurationStatusWithLBS(ctx context.Context, client client.
7175 log .Error (err , "Update VPCNetworkConfiguration status failed" , "ncName" , ncName , "vpcName" , vpcName , "nc.Status.VPCs" , nc .Status .VPCs )
7276 return
7377 }
74- log .Info ("Updated VPCNetworkConfiguration status" , "ncName" , ncName , "vpcName" , vpcName , "nc.Status.VPCs" , nc .Status .VPCs )
78+ log .Debug ("Updated VPCNetworkConfiguration status" , "ncName" , ncName , "vpcName" , vpcName , "nc.Status.VPCs" , nc .Status .VPCs )
7579}
7680
7781func setVPCNetworkConfigurationStatusWithGatewayConnection (ctx context.Context , client client.Client , nc * v1alpha1.VPCNetworkConfiguration , connectionStatus * common.VPCConnectionStatus ) {
@@ -102,8 +106,12 @@ func setVPCNetworkConfigurationStatusWithGatewayConnection(ctx context.Context,
102106 }
103107 }
104108 if conditionsUpdated {
105- client .Status ().Update (ctx , nc )
106- log .Info ("Set VPCNetworkConfiguration status" , "ncName" , nc .Name , "condition" , newConditions )
109+ err := client .Status ().Update (ctx , nc )
110+ if err != nil {
111+ log .Error (err , "Failed to update VPCNetworkConfiguration status" , "Name" , nc .Name )
112+ return
113+ }
114+ log .Debug ("Updated VPCNetworkConfiguration" , "Name" , nc .Name , "New Conditions" , newConditions )
107115 }
108116}
109117
@@ -125,7 +133,12 @@ func setVPCNetworkConfigurationStatusWithSnatEnabled(ctx context.Context, client
125133 }
126134 }
127135 if conditionsUpdated {
128- client .Status ().Update (ctx , nc )
136+ err := client .Status ().Update (ctx , nc )
137+ if err != nil {
138+ log .Error (err , "Failed to update VPCNetworkConfiguration status" , "Name" , nc .Name )
139+ return
140+ }
141+ log .Debug ("Updated VPCNetworkConfiguration" , "Name" , nc .Name , "New Conditions" , newConditions )
129142 }
130143}
131144
@@ -147,7 +160,7 @@ func setVPCNetworkConfigurationStatusWithNoExternalIPBlock(ctx context.Context,
147160 return
148161 }
149162 }
150- log .Info ("Updated VPCNetworkConfiguration status" , "VPCNetworkConfiguration" , nc .Name , "status" , newCondition )
163+ log .Debug ("Updated VPCNetworkConfiguration status" , "VPCNetworkConfiguration" , nc .Name , "status" , newCondition )
151164}
152165
153166// TODO: abstract the logic of merging condition for common, which can be used by the other controller, e.g. security policy
@@ -252,7 +265,7 @@ func updateVPCNetworkConfigurationStatusWithAliveVPCs(ctx context.Context, clien
252265 log .Error (err , "Failed to update VPCNetworkConfiguration status" , "Name" , ncName , "nc.Status.VPCs" , nc .Status .VPCs )
253266 return
254267 }
255- log .Info ("Updated VPCNetworkConfiguration status" , "Name" , ncName , "nc.Status.VPCs" , nc .Status .VPCs )
268+ log .Debug ("Updated VPCNetworkConfiguration status" , "Name" , ncName , "nc.Status.VPCs" , nc .Status .VPCs )
256269 }
257270}
258271
@@ -301,7 +314,7 @@ func setNSNetworkReadyCondition(ctx context.Context, kubeClient client.Client, n
301314 log .Error (err , "Failed to update Namespace status" , "Namespace" , nsName )
302315 return
303316 }
304- log .Info ("Updated Namespace network condition" , "Namespace" , nsName , "status" , condition .Status , "reason" , condition .Reason , "message" , condition .Message )
317+ log .Debug ("Updated Namespace network condition" , "Namespace" , nsName , "status" , condition .Status , "reason" , condition .Reason , "message" , condition .Message )
305318}
306319
307320// nsConditionEquals compares the old and new Namespace condition. The compare ignores the differences in field
0 commit comments