Merge pull request #51761 from karataliu/ccmupdatenode
Automatic merge from submit-queue (batch tested with PRs 51819, 51706, 51761, 51818, 51500) Fix providerID update validation **What this PR does / why we need it**: Cloud controller manager supports updating providerID in #50730, but the node updating was blocked by validation rule. This is to propose a fix for updating the validation rule by allowing altering spec.providerID if not set. Please check #51596 for detail **Which issue this PR fixes** fixes #51596 **Special notes for your reviewer**: **Release note**: ```release-note ```
This commit is contained in:
@@ -8375,6 +8375,33 @@ func TestValidateNodeUpdate(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}, false},
|
||||
{api.Node{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "update-provider-id-when-not-set",
|
||||
},
|
||||
}, api.Node{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "update-provider-id-when-not-set",
|
||||
},
|
||||
Spec: api.NodeSpec{
|
||||
ProviderID: "provider:///new",
|
||||
},
|
||||
}, true},
|
||||
{api.Node{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "update-provider-id-when-set",
|
||||
},
|
||||
Spec: api.NodeSpec{
|
||||
ProviderID: "provider:///old",
|
||||
},
|
||||
}, api.Node{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "update-provider-id-when-set",
|
||||
},
|
||||
Spec: api.NodeSpec{
|
||||
ProviderID: "provider:///new",
|
||||
},
|
||||
}, false},
|
||||
}
|
||||
for i, test := range tests {
|
||||
test.oldNode.ObjectMeta.ResourceVersion = "1"
|
||||
|
Reference in New Issue
Block a user