Test include: more recent log dates
parent
0ae8dc9a20
commit
bec61120bd
|
|
@ -1036,7 +1036,7 @@ class Kubernetes {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
let running = true;
|
let running = true;
|
||||||
let logQueryTime = 999;
|
let mostRecentLogTime = 999;
|
||||||
let mostRecentLine = '';
|
let mostRecentLine = '';
|
||||||
while (running) {
|
while (running) {
|
||||||
const pod = yield this.kubeClient.readNamespacedPod(name, namespace);
|
const pod = yield this.kubeClient.readNamespacedPod(name, namespace);
|
||||||
|
|
@ -1045,7 +1045,7 @@ class Kubernetes {
|
||||||
core.info('Polling logs...');
|
core.info('Polling logs...');
|
||||||
let logs;
|
let logs;
|
||||||
try {
|
try {
|
||||||
logs = yield this.kubeClient.readNamespacedPodLog(name, namespace, undefined, undefined, undefined, undefined, undefined, undefined, logQueryTime, undefined, true);
|
logs = yield this.kubeClient.readNamespacedPodLog(name, namespace, undefined, undefined, undefined, undefined, undefined, undefined, mostRecentLogTime, undefined, true);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.info(error);
|
core.info(error);
|
||||||
|
|
@ -1060,9 +1060,9 @@ class Kubernetes {
|
||||||
const [time, ...line] = element.split(' ');
|
const [time, ...line] = element.split(' ');
|
||||||
const lineString = line.join(' ');
|
const lineString = line.join(' ');
|
||||||
const lineDate = Date.parse(time);
|
const lineDate = Date.parse(time);
|
||||||
if (mostRecentLine !== lineString || lineDate !== logQueryTime) {
|
if (mostRecentLine !== lineString || lineDate > mostRecentLogTime) {
|
||||||
core.info(lineString);
|
core.info(lineString);
|
||||||
logQueryTime = lineDate;
|
mostRecentLogTime = lineDate;
|
||||||
mostRecentLine = lineString;
|
mostRecentLine = lineString;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -319,7 +319,7 @@ class Kubernetes {
|
||||||
static async streamLogs(name: string, namespace: string) {
|
static async streamLogs(name: string, namespace: string) {
|
||||||
try {
|
try {
|
||||||
let running = true;
|
let running = true;
|
||||||
let logQueryTime: number = 999;
|
let mostRecentLogTime: number = 999;
|
||||||
let mostRecentLine: string = '';
|
let mostRecentLine: string = '';
|
||||||
while (running) {
|
while (running) {
|
||||||
const pod = await this.kubeClient.readNamespacedPod(name, namespace);
|
const pod = await this.kubeClient.readNamespacedPod(name, namespace);
|
||||||
|
|
@ -337,7 +337,7 @@ class Kubernetes {
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
logQueryTime,
|
mostRecentLogTime,
|
||||||
undefined,
|
undefined,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
@ -354,9 +354,9 @@ class Kubernetes {
|
||||||
const [time, ...line] = element.split(' ');
|
const [time, ...line] = element.split(' ');
|
||||||
const lineString: string = line.join(' ');
|
const lineString: string = line.join(' ');
|
||||||
const lineDate: number = Date.parse(time);
|
const lineDate: number = Date.parse(time);
|
||||||
if (mostRecentLine !== lineString || lineDate !== logQueryTime) {
|
if (mostRecentLine !== lineString || lineDate > mostRecentLogTime) {
|
||||||
core.info(lineString);
|
core.info(lineString);
|
||||||
logQueryTime = lineDate;
|
mostRecentLogTime = lineDate;
|
||||||
mostRecentLine = lineString;
|
mostRecentLine = lineString;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue