-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove deprecated v1 provider id format #2122
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1084,7 +1084,8 @@ func (m *MachineScope) SetProviderID(id *string) error { | |||||||
} | ||||||||
m.IBMVPCMachine.Spec.ProviderID = ptr.To(fmt.Sprintf("ibm://%s///%s/%s", accountID, m.Machine.Spec.ClusterName, *id)) | ||||||||
} else { | ||||||||
m.IBMVPCMachine.Spec.ProviderID = ptr.To(fmt.Sprintf("ibmvpc://%s/%s", m.Machine.Spec.ClusterName, m.IBMVPCMachine.Name)) | ||||||||
var err error | ||||||||
m.Logger.Error(err, "invalid value for ProviderIDFormat") | ||||||||
Comment on lines
+1087
to
+1088
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
} | ||||||||
return nil | ||||||||
} | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -912,16 +912,6 @@ func TestGetMachineInternalIP(t *testing.T) { | |
func TestSetProviderID(t *testing.T) { | ||
providerID := "foo-provider-id" | ||
|
||
t.Run("Set Provider ID in v1 format", func(t *testing.T) { | ||
g := NewWithT(t) | ||
scope := setupPowerVSMachineScope(clusterName, machineName, ptr.To(pvsImage), ptr.To(pvsNetwork), true, nil) | ||
options.ProviderIDFormat = string(options.ProviderIDFormatV1) | ||
err := scope.SetProviderID("foo-providerID") | ||
expectedProviderID := ptr.To(fmt.Sprintf("ibmpowervs://%s/%s", scope.Machine.Spec.ClusterName, scope.IBMPowerVSMachine.Name)) | ||
g.Expect(*scope.IBMPowerVSMachine.Spec.ProviderID).To(Equal(*expectedProviderID)) | ||
g.Expect(err).To(BeNil()) | ||
}) | ||
|
||
t.Run("failed to get service instance ID", func(t *testing.T) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a test case for the invalid provider format if it doesn't exist already |
||
g := NewWithT(t) | ||
scope := PowerVSMachineScope{ | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in main.go we have a check to make sure only v2 provider id is valid, So couple of things here