Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

fix: no cleanup of config if not updated #67

Merged
merged 9 commits into from
Apr 10, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public void stop() {
log.debug("Stopping");
kubeApiServerProcess.stopApiServer();
etcdProcess.stopEtcd();
kubeConfig.restoreKubeConfig();
if (config.isUpdateKubeConfig()) {
kubeConfig.restoreKubeConfig();
}
etcdProcess.cleanEtcdData();
log.debug("Stopped");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ public void stopEtcd() {
}
stopped = true;
if (etcdProcess != null) {
etcdProcess.destroyForcibly();
try {
etcdProcess.destroyForcibly();
etcdProcess.waitFor();
} catch (InterruptedException e) {
throw new JenvtestException(e);
}
}
log.debug("etcd stopped");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public void waitUntilDefaultNamespaceCreated() {
private boolean ready(HttpClient client, HttpRequest request) {
try {
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
log.trace("Ready Response message:{} code: {}", response.body(), response.statusCode());
log.debug("Ready Response message:{} code: {} Api Server Port: {}", response.body(),
response.statusCode(),
apiServerPort);
return response.statusCode() == 200;
} catch (ConnectException e) {
// still want to retry
Expand Down Expand Up @@ -208,7 +210,12 @@ public void stopApiServer() {
}
stopped = true;
if (apiServerProcess != null) {
apiServerProcess.destroyForcibly();
try {
apiServerProcess.destroyForcibly();
apiServerProcess.waitFor();
} catch (InterruptedException e) {
throw new JenvtestException(e);
}
}
log.debug("API Server stopped");
}
Expand Down