code: func newOpenstackAuthProvider(_ string, config map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
  	var ttlDuration time.Duration
  	var err error
  
  	klog.Warningf("WARNING: in-tree openstack auth plugin is now deprecated. please use the \"client-keystone-auth\" kubectl/client-go credential plugin instead")
  	ttl, found := config["ttl"]
  	if !found {
  		ttlDuration = DefaultTTLDuration
  		// persist to config
  		config["ttl"] = ttlDuration.String()
  		if err = persister.Persist(config); err != nil {
  			return nil, fmt.Errorf("failed to persist config: %s", err)
  		}
  	} else {
  		ttlDuration, err = time.ParseDuration(ttl)
  		if err != nil {
  			return nil, fmt.Errorf("failed to parse ttl config: %s", err)
  		}
  	}
  
  	authOpt := gophercloud.AuthOptions{
  		IdentityEndpoint: config["identityEndpoint"],
  		Username:         config["username"],
  		Password:         config["password"],
  		DomainName:       config["name"],
  		TenantID:         config["tenantId"],
  		TenantName:       config["tenantName"],
  	}
  
  	getter := tokenGetter{}
  	// not empty
  	if (authOpt != gophercloud.AuthOptions{}) {
  		if len(authOpt.IdentityEndpoint) == 0 {
  			return nil, fmt.Errorf("empty %q in the config for openstack auth provider", "identityEndpoint")
  		}
  		getter.authOpt = &authOpt
  	}
  
  	return &openstackAuthProvider{
  		ttl:         ttlDuration,
  		tokenGetter: &getter,
  	}, nil
  }
docs: // newOpenstackAuthProvider creates an auth provider which works with openstack
  // environment.