File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,17 @@ export async function applyK8sYaml(pathToYamlDeployment: string, namespace?: str
8989
9090export async function createPodFromImage ( name : string , image : string , namespace : string ) {
9191 console . log ( `Letting Kubernetes decide how to manage image ${ image } with name ${ name } ` ) ;
92- await exec ( `./kubectl run ${ name } --image=${ image } -n ${ namespace } -- sleep 999999999` ) ;
92+ /**
93+ * HACK! The newest version of kubectl does not support generators. However, "OpenShift 3" tests run on K8s 1.11 which supports generators.
94+ * The default behaviour there is to create a Deployment, whereas new versions of kubectl create Pods.
95+ * We can't use the default behaviour for both OpenShift 3 and other tests, because we would get different results.
96+ * Hence we need to specifically select the Pod generator on OS3 but it would default to Pod on anything else.
97+ */
98+ const generator =
99+ process . env [ 'TEST_PLATFORM' ] === 'openshift3'
100+ ? '--generator=run-pod/v1'
101+ : '' ;
102+ await exec ( `./kubectl run ${ name } ${ generator } --image=${ image } -n ${ namespace } -- sleep 999999999` ) ;
93103 console . log ( `Done Letting Kubernetes decide how to manage image ${ image } with name ${ name } ` ) ;
94104}
95105
You can’t perform that action at this time.
0 commit comments