Feature-gate vsphere

This commit is contained in:
Justin Santa Barbara 2017-04-30 11:23:57 -04:00
parent 17ecc757f2
commit f3f7809d54
1 changed files with 7 additions and 0 deletions

View File

@ -60,6 +60,9 @@ const starline = "**************************************************************
// AlphaAllowGCE is a feature flag that gates GCE support while it is alpha
var AlphaAllowGCE = featureflag.New("AlphaAllowGCE", featureflag.Bool(false))
// AlphaAllowVsphere is a feature flag that gates vsphere support while it is alpha
var AlphaAllowVsphere = featureflag.New("AlphaAllowVsphere", featureflag.Bool(false))
var CloudupModels = []string{"config", "proto", "cloudup"}
type ApplyClusterCmd struct {
@ -370,6 +373,10 @@ func (c *ApplyClusterCmd) Run() error {
case fi.CloudProviderVSphere:
{
if !AlphaAllowVsphere.Enabled() {
return fmt.Errorf("Vsphere support is currently alpha, and is feature-gated. export KOPS_FEATURE_FLAGS=AlphaAllowVsphere")
}
vsphereCloud := cloud.(*vsphere.VSphereCloud)
// TODO: map region with vCenter cluster, or datacenter, or datastore?
region = vsphereCloud.Cluster