diff --git a/Makefile b/Makefile index 814fd8b113..f8e5c36d05 100644 --- a/Makefile +++ b/Makefile @@ -93,7 +93,7 @@ RELEASE_CONTROLLER_IMG := $(RELEASE_REGISTRY)/$(IMAGE_NAME) # Development Docker variables DEV_REGISTRY ?= gcr.io/spectro-dev-public/release/cluster-api-provider-vsphere DEV_CONTROLLER_IMG ?= $(DEV_REGISTRY)/cluster-api-vsphere-controller -DEV_TAG ?= spectro-v0.8.1-20220607 +DEV_TAG ?= spectro-v0.8.1-20220723 DEV_MANIFEST_IMG := $(DEV_CONTROLLER_IMG) # Set build time variables including git version details diff --git a/pkg/session/session.go b/pkg/session/session.go index 09cc7da119..dab23afa95 100644 --- a/pkg/session/session.go +++ b/pkg/session/session.go @@ -235,29 +235,16 @@ func clearCache(logger logr.Logger, sessionKey string) { if cachedSession, ok := sessionCache.Load(sessionKey); ok { s := cachedSession.(*Session) - // check for the presence of tagmanager session - // since calling Logout on an expired session blocks - session, err := s.TagManager.Session(context.Background()) + logger.V(0).Info("tag manager session, logging out") + err := s.TagManager.Logout(context.Background()) if err != nil { - logger.Error(err, "unable to get tag manager session") - } - if session != nil { - logger.V(6).Info("found active tag manager session, logging out") - err := s.TagManager.Logout(context.Background()) - if err != nil { - logger.Error(err, "unable to logout tag manager session") - } + logger.Error(err, "unable to logout tag manager session") } - vimSessionActive, err := s.SessionManager.SessionIsActive(context.Background()) + logger.V(0).Info("vim session, logging out") + err = s.SessionManager.Logout(context.Background()) if err != nil { - logger.Error(err, "unable to get vim client session") - } else if vimSessionActive { - logger.V(0).Info("found active vim session, logging out") - err := s.SessionManager.Logout(context.Background()) - if err != nil { - logger.Error(err, "unable to logout vim session") - } + logger.Error(err, "unable to logout vim session") } } logger.V(0).Info("session cache flushed")