Assert PVC created name is === input name
parent
adf74e9bde
commit
d1dc644ccf
|
|
@ -1513,8 +1513,8 @@ class Kubernetes {
|
||||||
command: [
|
command: [
|
||||||
'bin/bash',
|
'bin/bash',
|
||||||
'-c',
|
'-c',
|
||||||
`cd /data/builder/action/steps;
|
`cd /data/builder/action/steps;
|
||||||
chmod +x /return_license.sh;
|
chmod +x /return_license.sh;
|
||||||
/return_license.sh;`,
|
/return_license.sh;`,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -1571,16 +1571,16 @@ class Kubernetes {
|
||||||
yield this.runJob([
|
yield this.runJob([
|
||||||
'/bin/ash',
|
'/bin/ash',
|
||||||
'-c',
|
'-c',
|
||||||
`apk update;
|
`apk update;
|
||||||
apk add git-lfs;
|
apk add git-lfs;
|
||||||
ls /credentials/
|
ls /credentials/
|
||||||
export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);
|
export GITHUB_TOKEN=$(cat /credentials/GITHUB_TOKEN);
|
||||||
cd /data;
|
cd /data;
|
||||||
git clone https://github.com/${process.env.GITHUB_REPOSITORY}.git repo;
|
git clone https://github.com/${process.env.GITHUB_REPOSITORY}.git repo;
|
||||||
git clone https://github.com/webbertakken/unity-builder.git builder;
|
git clone https://github.com/webbertakken/unity-builder.git builder;
|
||||||
cd repo;
|
cd repo;
|
||||||
git checkout $GITHUB_SHA;
|
git checkout $GITHUB_SHA;
|
||||||
ls
|
ls
|
||||||
echo "end"`,
|
echo "end"`,
|
||||||
], 'alpine/git');
|
], 'alpine/git');
|
||||||
});
|
});
|
||||||
|
|
@ -1590,17 +1590,17 @@ class Kubernetes {
|
||||||
yield this.runJob([
|
yield this.runJob([
|
||||||
'bin/bash',
|
'bin/bash',
|
||||||
'-c',
|
'-c',
|
||||||
`ls
|
`ls
|
||||||
for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done
|
for f in ./credentials/*; do export $(basename $f)="$(cat $f)"; done
|
||||||
ls /data
|
ls /data
|
||||||
ls /data/builder
|
ls /data/builder
|
||||||
ls /data/builder/dist
|
ls /data/builder/dist
|
||||||
cp -r /data/builder/dist/default-build-script /UnityBuilderAction
|
cp -r /data/builder/dist/default-build-script /UnityBuilderAction
|
||||||
cp -r /data/builder/dist/entrypoint.sh /entrypoint.sh
|
cp -r /data/builder/dist/entrypoint.sh /entrypoint.sh
|
||||||
cp -r /data/builder/dist/steps /steps
|
cp -r /data/builder/dist/steps /steps
|
||||||
chmod -R +x /entrypoint.sh
|
chmod -R +x /entrypoint.sh
|
||||||
chmod -R +x /steps
|
chmod -R +x /steps
|
||||||
/entrypoint.sh
|
/entrypoint.sh
|
||||||
`,
|
`,
|
||||||
], this.baseImage.toString());
|
], this.baseImage.toString());
|
||||||
});
|
});
|
||||||
|
|
@ -1720,6 +1720,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
const async_wait_until_1 = __importDefault(__webpack_require__(41299));
|
const async_wait_until_1 = __importDefault(__webpack_require__(41299));
|
||||||
const core = __importStar(__webpack_require__(42186));
|
const core = __importStar(__webpack_require__(42186));
|
||||||
const k8s = __importStar(__webpack_require__(89679));
|
const k8s = __importStar(__webpack_require__(89679));
|
||||||
|
const assert_1 = __webpack_require__(42357);
|
||||||
class KubernetesStorage {
|
class KubernetesStorage {
|
||||||
static getPVCPhase(kubeClient, name, namespace) {
|
static getPVCPhase(kubeClient, name, namespace) {
|
||||||
var _a;
|
var _a;
|
||||||
|
|
@ -1736,7 +1737,7 @@ class KubernetesStorage {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static createPersistentVolumeClaim(buildParameters, pvcName, kubeClient, namespace) {
|
static createPersistentVolumeClaim(buildParameters, pvcName, kubeClient, namespace) {
|
||||||
var _a;
|
var _a, _b;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (buildParameters.kubeVolume) {
|
if (buildParameters.kubeVolume) {
|
||||||
core.info(buildParameters.kubeVolume);
|
core.info(buildParameters.kubeVolume);
|
||||||
|
|
@ -1760,6 +1761,7 @@ class KubernetesStorage {
|
||||||
};
|
};
|
||||||
const result = yield kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
const result = yield kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
||||||
core.info(`Persistent Volume Claim ${(_a = result.body.metadata) === null || _a === void 0 ? void 0 : _a.name} created`);
|
core.info(`Persistent Volume Claim ${(_a = result.body.metadata) === null || _a === void 0 ? void 0 : _a.name} created`);
|
||||||
|
assert_1.strict(((_b = result.body.metadata) === null || _b === void 0 ? void 0 : _b.name) === pvcName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -2,6 +2,7 @@ import waitUntil from 'async-wait-until';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as k8s from '@kubernetes/client-node';
|
import * as k8s from '@kubernetes/client-node';
|
||||||
import BuildParameters from '../build-parameters';
|
import BuildParameters from '../build-parameters';
|
||||||
|
import { strict as assert } from 'assert';
|
||||||
|
|
||||||
class KubernetesStorage {
|
class KubernetesStorage {
|
||||||
public static async getPVCPhase(kubeClient: k8s.CoreV1Api, name: string, namespace: string) {
|
public static async getPVCPhase(kubeClient: k8s.CoreV1Api, name: string, namespace: string) {
|
||||||
|
|
@ -42,6 +43,7 @@ class KubernetesStorage {
|
||||||
};
|
};
|
||||||
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
||||||
core.info(`Persistent Volume Claim ${result.body.metadata?.name} created`);
|
core.info(`Persistent Volume Claim ${result.body.metadata?.name} created`);
|
||||||
|
assert(result.body.metadata?.name === pvcName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue