Fix: log all pvc info

pull/273/head
Frostebite 2021-06-18 23:06:24 +01:00
parent 70c81dfbe9
commit 2718db7a0f
3 changed files with 5 additions and 11 deletions

7
dist/index.js vendored
View File

@ -1715,7 +1715,7 @@ class KubernetesStorage {
static getPVCPhase(kubeClient, name, namespace) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
return (_a = (yield kubeClient.readNamespacedPersistentVolumeClaimStatus(name, namespace)).body.status) === null || _a === void 0 ? void 0 : _a.phase;
return (_a = (yield kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body.status) === null || _a === void 0 ? void 0 : _a.phase;
});
}
static watchPersistentVolumeClaimUntilBoundToContainer(kubeClient, name, namespace) {
@ -1748,10 +1748,7 @@ class KubernetesStorage {
},
};
yield kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
core.info(`Persistent Volume created, ${yield KubernetesStorage.getPVCPhase(kubeClient, pvcName, namespace)}`);
yield new Promise((resolve) => setTimeout(resolve, 100000));
// await this.watchPersistentVolumeClaimUntilBoundToContainer(kubeClient, pvcName, namespace);
core.info(JSON.stringify((yield kubeClient.listPersistentVolume(namespace)).body, undefined, 4));
core.info(`Persistent Volume Claim created`);
});
}
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ import BuildParameters from '../build-parameters';
class KubernetesStorage {
public static async getPVCPhase(kubeClient: k8s.CoreV1Api, name: string, namespace: string) {
return (await kubeClient.readNamespacedPersistentVolumeClaimStatus(name, namespace)).body.status?.phase;
return (await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body.status?.phase;
}
public static async watchPersistentVolumeClaimUntilBoundToContainer(
kubeClient: k8s.CoreV1Api,
@ -44,10 +44,7 @@ class KubernetesStorage {
},
};
await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
core.info(`Persistent Volume created, ${await KubernetesStorage.getPVCPhase(kubeClient, pvcName, namespace)}`);
await new Promise((resolve) => setTimeout(resolve, 100000));
// await this.watchPersistentVolumeClaimUntilBoundToContainer(kubeClient, pvcName, namespace);
core.info(JSON.stringify((await kubeClient.listPersistentVolume(namespace)).body, undefined, 4));
core.info(`Persistent Volume Claim created`);
}
}