Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmd/ci-operator-prowgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func generateCiOperatorPodSpec(info *config.Info, target string, additionalArgs
}

func generatePodSpecTemplate(info *config.Info, release string, test *cioperatorapi.TestStepConfiguration) *kubeapi.PodSpec {
var template string
var testImageStreamTag, template string
var clusterProfile cioperatorapi.ClusterProfile
var needsReleaseRpms bool
if conf := test.OpenshiftAnsibleClusterTestConfiguration; conf != nil {
Expand Down Expand Up @@ -208,6 +208,10 @@ func generatePodSpecTemplate(info *config.Info, release string, test *cioperator
} else if conf := test.OpenshiftInstallerConsoleClusterTestConfiguration; conf != nil {
template = "cluster-launch-installer-console"
clusterProfile = conf.ClusterProfile
} else if conf := test.OpenshiftInstallerCustomTestImageClusterTestConfiguration; conf != nil {
template = "cluster-launch-installer-custom-test-image"
clusterProfile = conf.ClusterProfile
testImageStreamTag = conf.From
}
var targetCloud string
switch clusterProfile {
Expand Down Expand Up @@ -256,6 +260,10 @@ func generatePodSpecTemplate(info *config.Info, release string, test *cioperator
kubeapi.EnvVar{Name: "CLUSTER_TYPE", Value: targetCloud},
kubeapi.EnvVar{Name: "JOB_NAME_SAFE", Value: strings.Replace(test.As, "_", "-", -1)},
kubeapi.EnvVar{Name: "TEST_COMMAND", Value: test.Commands})
if len(testImageStreamTag) > 0 {
container.Env = append(container.Env,
kubeapi.EnvVar{Name: "TEST_IMAGESTREAM_TAG", Value: testImageStreamTag})
}
}
if needsReleaseRpms && (info.Org != "openshift" || info.Repo != "origin") {
var repoPath = fmt.Sprintf("https://rpms.svc.ci.openshift.org/openshift-origin-v%s/", release)
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ func validateTestConfigurationType(fieldRoot string, test TestStepConfiguration,
typeCount++
validationErrors = append(validationErrors, validateClusterProfile(fmt.Sprintf("%s", fieldRoot), testConfig.ClusterProfile)...)
}
if testConfig := test.OpenshiftInstallerCustomTestImageClusterTestConfiguration; testConfig != nil {
typeCount++
validationErrors = append(validationErrors, validateClusterProfile(fmt.Sprintf("%s", fieldRoot), testConfig.ClusterProfile)...)
}
if test.OpenshiftInstallerRandomClusterTestConfiguration != nil {
typeCount++
}
Expand Down
33 changes: 22 additions & 11 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,17 +293,18 @@ type TestStepConfiguration struct {
Secret *Secret `json:"secret,omitempty"`

// Only one of the following can be not-null.
ContainerTestConfiguration *ContainerTestConfiguration `json:"container,omitempty"`
OpenshiftAnsibleClusterTestConfiguration *OpenshiftAnsibleClusterTestConfiguration `json:"openshift_ansible,omitempty"`
OpenshiftAnsibleSrcClusterTestConfiguration *OpenshiftAnsibleSrcClusterTestConfiguration `json:"openshift_ansible_src,omitempty"`
OpenshiftAnsibleCustomClusterTestConfiguration *OpenshiftAnsibleCustomClusterTestConfiguration `json:"openshift_ansible_custom,omitempty"`
OpenshiftAnsible40ClusterTestConfiguration *OpenshiftAnsible40ClusterTestConfiguration `json:"openshift_ansible_40,omitempty"`
OpenshiftAnsibleUpgradeClusterTestConfiguration *OpenshiftAnsibleUpgradeClusterTestConfiguration `json:"openshift_ansible_upgrade,omitempty"`
OpenshiftInstallerClusterTestConfiguration *OpenshiftInstallerClusterTestConfiguration `json:"openshift_installer,omitempty"`
OpenshiftInstallerSrcClusterTestConfiguration *OpenshiftInstallerSrcClusterTestConfiguration `json:"openshift_installer_src,omitempty"`
OpenshiftInstallerUPIClusterTestConfiguration *OpenshiftInstallerUPIClusterTestConfiguration `json:"openshift_installer_upi,omitempty"`
OpenshiftInstallerConsoleClusterTestConfiguration *OpenshiftInstallerConsoleClusterTestConfiguration `json:"openshift_installer_console,omitempty"`
OpenshiftInstallerRandomClusterTestConfiguration *OpenshiftInstallerRandomClusterTestConfiguration `json:"openshift_installer_random,omitempty"`
ContainerTestConfiguration *ContainerTestConfiguration `json:"container,omitempty"`
OpenshiftAnsibleClusterTestConfiguration *OpenshiftAnsibleClusterTestConfiguration `json:"openshift_ansible,omitempty"`
OpenshiftAnsibleSrcClusterTestConfiguration *OpenshiftAnsibleSrcClusterTestConfiguration `json:"openshift_ansible_src,omitempty"`
OpenshiftAnsibleCustomClusterTestConfiguration *OpenshiftAnsibleCustomClusterTestConfiguration `json:"openshift_ansible_custom,omitempty"`
OpenshiftAnsible40ClusterTestConfiguration *OpenshiftAnsible40ClusterTestConfiguration `json:"openshift_ansible_40,omitempty"`
OpenshiftAnsibleUpgradeClusterTestConfiguration *OpenshiftAnsibleUpgradeClusterTestConfiguration `json:"openshift_ansible_upgrade,omitempty"`
OpenshiftInstallerClusterTestConfiguration *OpenshiftInstallerClusterTestConfiguration `json:"openshift_installer,omitempty"`
OpenshiftInstallerSrcClusterTestConfiguration *OpenshiftInstallerSrcClusterTestConfiguration `json:"openshift_installer_src,omitempty"`
OpenshiftInstallerUPIClusterTestConfiguration *OpenshiftInstallerUPIClusterTestConfiguration `json:"openshift_installer_upi,omitempty"`
OpenshiftInstallerConsoleClusterTestConfiguration *OpenshiftInstallerConsoleClusterTestConfiguration `json:"openshift_installer_console,omitempty"`
OpenshiftInstallerRandomClusterTestConfiguration *OpenshiftInstallerRandomClusterTestConfiguration `json:"openshift_installer_random,omitempty"`
OpenshiftInstallerCustomTestImageClusterTestConfiguration *OpenshiftInstallerCustomTestImageClusterTestConfiguration `json:"openshift_installer_custom_test_image,omitempty"`
}

// Secret describes a secret to be mounted inside a test
Expand Down Expand Up @@ -440,6 +441,16 @@ type OpenshiftInstallerUPIClusterTestConfiguration struct {
// chosen randomly and runs conformance tests.
type OpenshiftInstallerRandomClusterTestConfiguration struct{}

// OpenshiftInstallerCustomTestImageClusterTestConfiguration describes a
// test that provisions a cluster using openshift-installer and
// executes a command in the image specified by the job configuration.
type OpenshiftInstallerCustomTestImageClusterTestConfiguration struct {
ClusterTestConfiguration `json:",inline"`
// From defines the imagestreamtag that will be used to run the
// provided test command. e.g. stable:console-test
From string `json:"from"`
}

// PipelineImageStreamTagReference is a tag on the
// ImageStream corresponding to the code under test.
// This tag will identify an image but not use any
Expand Down