Skip to content

Commit

Permalink
Merge pull request #426 from nicolehanjing/nicoleh-nsxt-fix
Browse files Browse the repository at this point in the history
Fix nil pointer error if the connector manager config is not set
  • Loading branch information
k8s-ci-robot authored Jan 14, 2021
2 parents e10646e + a48c578 commit cf55170
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/nsxt/connector_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ func (cm *ConnectorManager) GetConnector() client.Connector {

// AddSecretListener adds secret informer add, update, delete callbacks
func (cm *ConnectorManager) AddSecretListener(secretInformer v1.SecretInformer) error {
if cm.config == nil {
return errors.New("config is not available for NSXT connector manager")
}
if cm.config.SecretName == "" || cm.config.SecretNamespace == "" {
klog.V(6).Infof("No need to initialize NSXT secret manager as secret is not provided")
return nil
Expand Down

0 comments on commit cf55170

Please sign in to comment.