Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
d5904e7a
Commit
d5904e7a
authored
Mar 20, 2018
by
Ashley Gau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove validation of Alpha Feature Gates
parent
52ed0368
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
98 deletions
+23
-98
gce.go
pkg/cloudprovider/providers/gce/gce.go
+2
-16
gce_alpha.go
pkg/cloudprovider/providers/gce/gce_alpha.go
+4
-10
gce_disks_test.go
pkg/cloudprovider/providers/gce/gce_disks_test.go
+13
-52
gce_loadbalancer_utils_test.go
...loudprovider/providers/gce/gce_loadbalancer_utils_test.go
+1
-1
gce_test.go
pkg/cloudprovider/providers/gce/gce_test.go
+1
-10
e2e.go
test/e2e/e2e.go
+1
-4
ingress_scale.go
test/e2e/network/scale/localrun/ingress_scale.go
+1
-5
No files found.
pkg/cloudprovider/providers/gce/gce.go
View file @
d5904e7a
...
@@ -269,9 +269,7 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
...
@@ -269,9 +269,7 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
// By default, fetch token from GCE metadata server
// By default, fetch token from GCE metadata server
cloudConfig
.
TokenSource
=
google
.
ComputeTokenSource
(
""
)
cloudConfig
.
TokenSource
=
google
.
ComputeTokenSource
(
""
)
cloudConfig
.
UseMetadataServer
=
true
cloudConfig
.
UseMetadataServer
=
true
cloudConfig
.
AlphaFeatureGate
=
NewAlphaFeatureGate
([]
string
{})
featureMap
:=
make
(
map
[
string
]
bool
)
cloudConfig
.
AlphaFeatureGate
=
&
AlphaFeatureGate
{
featureMap
}
if
configFile
!=
nil
{
if
configFile
!=
nil
{
if
configFile
.
Global
.
ApiEndpoint
!=
""
{
if
configFile
.
Global
.
ApiEndpoint
!=
""
{
cloudConfig
.
ApiEndpoint
=
configFile
.
Global
.
ApiEndpoint
cloudConfig
.
ApiEndpoint
=
configFile
.
Global
.
ApiEndpoint
...
@@ -289,19 +287,7 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
...
@@ -289,19 +287,7 @@ func generateCloudConfig(configFile *ConfigFile) (cloudConfig *CloudConfig, err
cloudConfig
.
NodeTags
=
configFile
.
Global
.
NodeTags
cloudConfig
.
NodeTags
=
configFile
.
Global
.
NodeTags
cloudConfig
.
NodeInstancePrefix
=
configFile
.
Global
.
NodeInstancePrefix
cloudConfig
.
NodeInstancePrefix
=
configFile
.
Global
.
NodeInstancePrefix
cloudConfig
.
AlphaFeatureGate
=
NewAlphaFeatureGate
(
configFile
.
Global
.
AlphaFeatures
)
alphaFeatureGate
,
err
:=
NewAlphaFeatureGate
(
configFile
.
Global
.
AlphaFeatures
)
if
err
!=
nil
{
glog
.
Errorf
(
"Encountered error for creating alpha feature gate: %v"
,
err
)
}
cloudConfig
.
AlphaFeatureGate
=
alphaFeatureGate
}
else
{
// initialize AlphaFeatureGate when no AlphaFeatures are configured.
alphaFeatureGate
,
err
:=
NewAlphaFeatureGate
([]
string
{})
if
err
!=
nil
{
glog
.
Errorf
(
"Encountered error for initializing alpha feature gate: %v"
,
err
)
}
cloudConfig
.
AlphaFeatureGate
=
alphaFeatureGate
}
}
// retrieve projectID and zone
// retrieve projectID and zone
...
...
pkg/cloudprovider/providers/gce/gce_alpha.go
View file @
d5904e7a
...
@@ -18,8 +18,6 @@ package gce
...
@@ -18,8 +18,6 @@ package gce
import
(
import
(
"fmt"
"fmt"
utilerrors
"k8s.io/apimachinery/pkg/util/errors"
)
)
const
(
const
(
...
@@ -33,10 +31,7 @@ const (
...
@@ -33,10 +31,7 @@ const (
)
)
// All known alpha features
// All known alpha features
var
knownAlphaFeatures
=
map
[
string
]
bool
{
var
knownAlphaFeatures
=
map
[
string
]
bool
{}
AlphaFeatureNetworkTiers
:
true
,
AlphaFeatureNetworkEndpointGroup
:
true
,
}
type
AlphaFeatureGate
struct
{
type
AlphaFeatureGate
struct
{
features
map
[
string
]
bool
features
map
[
string
]
bool
...
@@ -46,17 +41,16 @@ func (af *AlphaFeatureGate) Enabled(key string) bool {
...
@@ -46,17 +41,16 @@ func (af *AlphaFeatureGate) Enabled(key string) bool {
return
af
.
features
[
key
]
return
af
.
features
[
key
]
}
}
func
NewAlphaFeatureGate
(
features
[]
string
)
(
*
AlphaFeatureGate
,
error
)
{
func
NewAlphaFeatureGate
(
features
[]
string
)
*
AlphaFeatureGate
{
errList
:=
[]
error
{}
featureMap
:=
make
(
map
[
string
]
bool
)
featureMap
:=
make
(
map
[
string
]
bool
)
for
_
,
name
:=
range
features
{
for
_
,
name
:=
range
features
{
if
_
,
ok
:=
knownAlphaFeatures
[
name
];
!
ok
{
if
_
,
ok
:=
knownAlphaFeatures
[
name
];
!
ok
{
errList
=
append
(
errList
,
fmt
.
Errorf
(
"alpha feature %q is not supported."
,
name
))
featureMap
[
name
]
=
false
}
else
{
}
else
{
featureMap
[
name
]
=
true
featureMap
[
name
]
=
true
}
}
}
}
return
&
AlphaFeatureGate
{
featureMap
}
,
utilerrors
.
NewAggregate
(
errList
)
return
&
AlphaFeatureGate
{
featureMap
}
}
}
func
(
gce
*
GCECloud
)
alphaFeatureEnabled
(
feature
string
)
error
{
func
(
gce
*
GCECloud
)
alphaFeatureEnabled
(
feature
string
)
error
{
...
...
pkg/cloudprovider/providers/gce/gce_disks_test.go
View file @
d5904e7a
...
@@ -39,10 +39,7 @@ func TestCreateDisk_Basic(t *testing.T) {
...
@@ -39,10 +39,7 @@ func TestCreateDisk_Basic(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
}
zonesWithNodes
:=
[]
string
{
"zone1"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
[]
string
{
"zone1"
},
managedZones
:
[]
string
{
"zone1"
},
...
@@ -157,10 +154,7 @@ func TestCreateDisk_DiskAlreadyExists(t *testing.T) {
...
@@ -157,10 +154,7 @@ func TestCreateDisk_DiskAlreadyExists(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
}
zonesWithNodes
:=
[]
string
{
"zone1"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -266,10 +260,7 @@ func TestCreateDisk_MultiZone(t *testing.T) {
...
@@ -266,10 +260,7 @@ func TestCreateDisk_MultiZone(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
,
"zone2"
,
"zone3"
}
zonesWithNodes
:=
[]
string
{
"zone1"
,
"zone2"
,
"zone3"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -298,10 +289,7 @@ func TestDeleteDisk_Basic(t *testing.T) {
...
@@ -298,10 +289,7 @@ func TestDeleteDisk_Basic(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
}
zonesWithNodes
:=
[]
string
{
"zone1"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -338,10 +326,7 @@ func TestDeleteDisk_NotFound(t *testing.T) {
...
@@ -338,10 +326,7 @@ func TestDeleteDisk_NotFound(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
}
zonesWithNodes
:=
[]
string
{
"zone1"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -366,10 +351,7 @@ func TestDeleteDisk_ResourceBeingUsed(t *testing.T) {
...
@@ -366,10 +351,7 @@ func TestDeleteDisk_ResourceBeingUsed(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
}
zonesWithNodes
:=
[]
string
{
"zone1"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -400,10 +382,7 @@ func TestDeleteDisk_SameDiskMultiZone(t *testing.T) {
...
@@ -400,10 +382,7 @@ func TestDeleteDisk_SameDiskMultiZone(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
,
"zone2"
,
"zone3"
}
zonesWithNodes
:=
[]
string
{
"zone1"
,
"zone2"
,
"zone3"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -437,10 +416,7 @@ func TestDeleteDisk_DiffDiskMultiZone(t *testing.T) {
...
@@ -437,10 +416,7 @@ func TestDeleteDisk_DiffDiskMultiZone(t *testing.T) {
gceRegion
:=
"fake-region"
gceRegion
:=
"fake-region"
zonesWithNodes
:=
[]
string
{
"zone1"
}
zonesWithNodes
:=
[]
string
{
"zone1"
}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -478,10 +454,7 @@ func TestGetAutoLabelsForPD_Basic(t *testing.T) {
...
@@ -478,10 +454,7 @@ func TestGetAutoLabelsForPD_Basic(t *testing.T) {
diskName
:=
"disk"
diskName
:=
"disk"
diskType
:=
DiskTypeSSD
diskType
:=
DiskTypeSSD
const
sizeGb
int64
=
128
const
sizeGb
int64
=
128
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -518,10 +491,7 @@ func TestGetAutoLabelsForPD_NoZone(t *testing.T) {
...
@@ -518,10 +491,7 @@ func TestGetAutoLabelsForPD_NoZone(t *testing.T) {
diskName
:=
"disk"
diskName
:=
"disk"
diskType
:=
DiskTypeStandard
diskType
:=
DiskTypeStandard
const
sizeGb
int64
=
128
const
sizeGb
int64
=
128
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -576,10 +546,7 @@ func TestGetAutoLabelsForPD_DiskNotFoundAndNoZone(t *testing.T) {
...
@@ -576,10 +546,7 @@ func TestGetAutoLabelsForPD_DiskNotFoundAndNoZone(t *testing.T) {
zonesWithNodes
:=
[]
string
{}
zonesWithNodes
:=
[]
string
{}
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
fakeManager
:=
newFakeManager
(
gceProjectId
,
gceRegion
)
diskName
:=
"disk"
diskName
:=
"disk"
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -608,10 +575,7 @@ func TestGetAutoLabelsForPD_DupDisk(t *testing.T) {
...
@@ -608,10 +575,7 @@ func TestGetAutoLabelsForPD_DupDisk(t *testing.T) {
zone
:=
"us-west1-b"
zone
:=
"us-west1-b"
const
sizeGb
int64
=
128
const
sizeGb
int64
=
128
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
@@ -649,10 +613,7 @@ func TestGetAutoLabelsForPD_DupDiskNoZone(t *testing.T) {
...
@@ -649,10 +613,7 @@ func TestGetAutoLabelsForPD_DupDiskNoZone(t *testing.T) {
diskType
:=
DiskTypeStandard
diskType
:=
DiskTypeStandard
const
sizeGb
int64
=
128
const
sizeGb
int64
=
128
alphaFeatureGate
,
featureGateErr
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
featureGateErr
!=
nil
{
t
.
Error
(
featureGateErr
)
}
gce
:=
GCECloud
{
gce
:=
GCECloud
{
manager
:
fakeManager
,
manager
:
fakeManager
,
managedZones
:
zonesWithNodes
,
managedZones
:
zonesWithNodes
,
...
...
pkg/cloudprovider/providers/gce/gce_loadbalancer_utils_test.go
View file @
d5904e7a
...
@@ -79,7 +79,7 @@ func fakeGCECloud(vals TestClusterValues) (*GCECloud, error) {
...
@@ -79,7 +79,7 @@ func fakeGCECloud(vals TestClusterValues) (*GCECloud, error) {
fakeManager
:=
newFakeManager
(
vals
.
ProjectID
,
vals
.
Region
)
fakeManager
:=
newFakeManager
(
vals
.
ProjectID
,
vals
.
Region
)
zonesWithNodes
:=
createNodeZones
([]
string
{
vals
.
ZoneName
})
zonesWithNodes
:=
createNodeZones
([]
string
{
vals
.
ZoneName
})
alphaFeatureGate
,
err
:=
NewAlphaFeatureGate
([]
string
{})
alphaFeatureGate
:=
NewAlphaFeatureGate
([]
string
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
pkg/cloudprovider/providers/gce/gce_test.go
View file @
d5904e7a
...
@@ -538,26 +538,22 @@ func TestNewAlphaFeatureGate(t *testing.T) {
...
@@ -538,26 +538,22 @@ func TestNewAlphaFeatureGate(t *testing.T) {
alphaFeatures
[]
string
alphaFeatures
[]
string
expectEnabled
[]
string
expectEnabled
[]
string
expectDisabled
[]
string
expectDisabled
[]
string
expectError
bool
}{
}{
// enable foo bar
// enable foo bar
{
{
alphaFeatures
:
[]
string
{
"foo"
,
"bar"
},
alphaFeatures
:
[]
string
{
"foo"
,
"bar"
},
expectEnabled
:
[]
string
{
"foo"
,
"bar"
},
expectEnabled
:
[]
string
{
"foo"
,
"bar"
},
expectDisabled
:
[]
string
{
"aaa"
},
expectDisabled
:
[]
string
{
"aaa"
},
expectError
:
false
,
},
},
// no alpha feature
// no alpha feature
{
{
alphaFeatures
:
[]
string
{},
alphaFeatures
:
[]
string
{},
expectEnabled
:
[]
string
{},
expectEnabled
:
[]
string
{},
expectDisabled
:
[]
string
{
"foo"
,
"bar"
},
expectDisabled
:
[]
string
{
"foo"
,
"bar"
},
expectError
:
false
,
},
},
// unsupported alpha feature
// unsupported alpha feature
{
{
alphaFeatures
:
[]
string
{
"aaa"
,
"foo"
},
alphaFeatures
:
[]
string
{
"aaa"
,
"foo"
},
expectError
:
true
,
expectEnabled
:
[]
string
{
"foo"
},
expectEnabled
:
[]
string
{
"foo"
},
expectDisabled
:
[]
string
{
"aaa"
},
expectDisabled
:
[]
string
{
"aaa"
},
},
},
...
@@ -566,16 +562,11 @@ func TestNewAlphaFeatureGate(t *testing.T) {
...
@@ -566,16 +562,11 @@ func TestNewAlphaFeatureGate(t *testing.T) {
alphaFeatures
:
[]
string
{
"foo"
},
alphaFeatures
:
[]
string
{
"foo"
},
expectEnabled
:
[]
string
{
"foo"
},
expectEnabled
:
[]
string
{
"foo"
},
expectDisabled
:
[]
string
{
"bar"
},
expectDisabled
:
[]
string
{
"bar"
},
expectError
:
false
,
},
},
}
}
for
_
,
tc
:=
range
testCases
{
for
_
,
tc
:=
range
testCases
{
featureGate
,
err
:=
NewAlphaFeatureGate
(
tc
.
alphaFeatures
)
featureGate
:=
NewAlphaFeatureGate
(
tc
.
alphaFeatures
)
if
(
tc
.
expectError
&&
err
==
nil
)
||
(
!
tc
.
expectError
&&
err
!=
nil
)
{
t
.
Errorf
(
"Expect error to be %v, but got error %v"
,
tc
.
expectError
,
err
)
}
for
_
,
key
:=
range
tc
.
expectEnabled
{
for
_
,
key
:=
range
tc
.
expectEnabled
{
if
!
featureGate
.
Enabled
(
key
)
{
if
!
featureGate
.
Enabled
(
key
)
{
...
...
test/e2e/e2e.go
View file @
d5904e7a
...
@@ -72,12 +72,9 @@ func setupProviderConfig() error {
...
@@ -72,12 +72,9 @@ func setupProviderConfig() error {
managedZones
=
[]
string
{
zone
}
managedZones
=
[]
string
{
zone
}
}
}
gceAlphaFeatureGate
,
err
:=
gcecloud
.
NewAlphaFeatureGate
([]
string
{
gceAlphaFeatureGate
:=
gcecloud
.
NewAlphaFeatureGate
([]
string
{
gcecloud
.
AlphaFeatureNetworkEndpointGroup
,
gcecloud
.
AlphaFeatureNetworkEndpointGroup
,
})
})
if
err
!=
nil
{
glog
.
Errorf
(
"Encountered error for creating alpha feature gate: %v"
,
err
)
}
gceCloud
,
err
:=
gcecloud
.
CreateGCECloud
(
&
gcecloud
.
CloudConfig
{
gceCloud
,
err
:=
gcecloud
.
CreateGCECloud
(
&
gcecloud
.
CloudConfig
{
ApiEndpoint
:
framework
.
TestContext
.
CloudConfig
.
ApiEndpoint
,
ApiEndpoint
:
framework
.
TestContext
.
CloudConfig
.
ApiEndpoint
,
...
...
test/e2e/network/scale/localrun/ingress_scale.go
View file @
d5904e7a
...
@@ -106,11 +106,7 @@ func main() {
...
@@ -106,11 +106,7 @@ func main() {
}
}
// Initializing a GCE client.
// Initializing a GCE client.
gceAlphaFeatureGate
,
err
:=
gcecloud
.
NewAlphaFeatureGate
([]
string
{})
gceAlphaFeatureGate
:=
gcecloud
.
NewAlphaFeatureGate
([]
string
{})
if
err
!=
nil
{
glog
.
Errorf
(
"Encountered error for creating alpha feature gate: %v"
,
err
)
os
.
Exit
(
1
)
}
gceCloud
,
err
:=
gcecloud
.
CreateGCECloud
(
&
gcecloud
.
CloudConfig
{
gceCloud
,
err
:=
gcecloud
.
CreateGCECloud
(
&
gcecloud
.
CloudConfig
{
ProjectID
:
cloudConfig
.
ProjectID
,
ProjectID
:
cloudConfig
.
ProjectID
,
Region
:
cloudConfig
.
Region
,
Region
:
cloudConfig
.
Region
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment