Skip to content

Commit

Permalink
Add fenced env var for new gardener tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Schrodi committed Apr 1, 2020
1 parent ddbda3a commit a9b3efc
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 256 deletions.
5 changes: 5 additions & 0 deletions pkg/testrun_renderer/default/testrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func testrun(cfg *Config, shoots []*shoot) (*v1beta1.Testrun, error) {
},
Config: []v1beta1.ConfigElement{
templates.GetConfigGardenerPrefix(),
{
Type: v1beta1.ConfigTypeEnv,
Name: "FENCED",
Value: "false", // todo: schrodit - currently only public cloudproviders are supported.
},
},
TestFlow: v1beta1.TestFlow{
&prepareHostCluster,
Expand Down
21 changes: 2 additions & 19 deletions pkg/testrun_renderer/templates/shoots.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package templates
import (
"path"

"github.com/Masterminds/semver"
"github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1"
"github.com/gardener/test-infra/pkg/common"
"github.com/gardener/test-infra/pkg/testmachinery"
Expand Down Expand Up @@ -56,24 +55,8 @@ type CreateShootConfig struct {
// GetStepCreateShoot generates the shoot creation step for a specific cloudprovider
// A shoot in a specific version is created depending on the gardener configuration whereas
// the default for commits is the new api.
func GetStepCreateShoot(gardenerConfig GardenerConfig, cloudprovider common.CloudProvider, name string, dependencies []string, cfg *CreateShootConfig) ([]*v1beta1.DAGStep, string, error) {
if gardenerConfig.Version != "" {
// all tests before gardener 0.31.0 have to use the old shoot test structure
// tests afterwards use the new gardener v1alpha1 api which also results in a different tm structure
oldShootVersion, err := semver.NewVersion("0.31.0")
if err != nil {
return nil, "", err
}

v, err := semver.NewVersion(gardenerConfig.Version)
if err != nil {
return nil, "", err
}
if v.LessThan(oldShootVersion) {
return stepCreateShootV1beta1(cloudprovider, name, dependencies, cfg)
}
}
return stepCreateShootV1alpha1(cloudprovider, name, dependencies, cfg)
func GetStepCreateShoot(_ GardenerConfig, cloudprovider common.CloudProvider, name string, dependencies []string, cfg *CreateShootConfig) ([]*v1beta1.DAGStep, string, error) {
return stepCreateShootV1beta1(cloudprovider, name, dependencies, cfg)
}

func GetStepDeleteShoot(name, createShootStepName, shootName string, dependencies []string) v1beta1.DAGStep {
Expand Down
227 changes: 0 additions & 227 deletions pkg/testrun_renderer/templates/shoots_v1alpha1.go

This file was deleted.

Loading

0 comments on commit a9b3efc

Please sign in to comment.