Skip to content

Commit c74563a

Browse files
ycliuhwmitechie
authored andcommitted
Do nothing in HandleCredentialError if error is nil;
1 parent 0eb63cd commit c74563a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

provider/vsphere/errors.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func IsAuthorisationFailure(err error) bool {
4848
// HandleCredentialError marks the current credential as invalid if
4949
// the passed vsphere error indicates it should be.
5050
func HandleCredentialError(err error, env *sessionEnviron, ctx context.ProviderCallContext) {
51+
if err == nil {
52+
return
53+
}
5154
// LP #1849194: fell into a situation where we can either have an invalid
5255
// credential OR user issued a VM spec that has no rights to, e.g. on a
5356
// Resource Pool that it has no permissions on using "zone" on add-machine.

0 commit comments

Comments
 (0)