Open morvencao opened 1 year ago
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: morvencao
Once this PR has been reviewed and has the lgtm label, please assign qiujian16 for approval by writing /assign @qiujian16
in a comment. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
/hold
is the integration test failure relevant?
/hold cancel
it seems not, restart the test to have a try
@qiujian16 Another look? all comments addressed except the one set to nil for label key
, because labels is known type(map[string]string)
, set value to nil, it will complain:
pkg/hub/addon/discovery_controller.go:144:17: cannot use nil as string value in assignment
pkg/hub/addon/discovery_controller.go:148:17: cannot use nil as string value in assignment
pkg/hub/addon/discovery_controller.go:219:23: cannot use nil as string value in assignment
pkg/hub/addon/discovery_controller.go:234:23: cannot use nil as string value in assignment
you cannot set nil in map[string]string, but you can do it in map[string]interface{}. The patch you generate should be based on a map[string]interface{}.
Any benefit to use map[string]interface{}
instead of map[string]string
?
In labels update case, the labels field is known type, and the JSON encoding can also generate patch bytes based on map[string]string
type. We can convert map[string]string
to map[string]interface{}
, but that will also make it more complicated, especially we need to check whether labels are actually updated before launch patch request.
I tried to use map[string]interface{}
, it is more complicated and the UT cases are also need to updated accordingly.
you can delete a key with map[string]interface{}
fix cluster labels update conflict:
Signed-off-by: morvencao lcao@redhat.com