Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nil pointer error found in the kurtosis clean -a cmd, adding remove reverse proxy container function when it already exists #1995

Merged
merged 2 commits into from
Dec 20, 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 @@ -32,9 +32,16 @@ func CreateReverseProxy(
}
if found {
logrus.Debugf("Found existing reverse proxy; cannot start a new one.")
reverseProxyObj, _, getProxyObjErr := getReverseProxyObjectAndContainerId(ctx, dockerManager)
reverseProxyObj, proxyContainerId, getProxyObjErr := getReverseProxyObjectAndContainerId(ctx, dockerManager)
if getProxyObjErr == nil {
return reverseProxyObj, nil, nil
leoporoli marked this conversation as resolved.
Show resolved Hide resolved
removeProxyFunc := func() {
removeCtx := context.Background()
if err := dockerManager.RemoveContainer(removeCtx, proxyContainerId); err != nil {
logrus.Errorf("an error occurred to remove the current reverse proxy container with ID '%s' failed. Error was:\n%v", proxyContainerId, err)
logrus.Errorf("ACTION REQUIRED: You'll need to manually remove the reverse proxy server with Docker container ID '%v'!!!!!!", proxyContainerId)
}
}
return reverseProxyObj, removeProxyFunc, nil
}
logrus.Debugf("Something failed while trying to create the reverse proxy object using container with ID '%s'. Error was:\n%s", proxyDockerContainer.GetId(), getProxyObjErr.Error())
logrus.Debugf("Destroying the failing reverse proxy to create a new one...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
func DestroyReverseProxy(ctx context.Context, dockerManager *docker_manager.DockerManager) error {
_, maybeReverseProxyContainerId, err := getReverseProxyObjectAndContainerId(ctx, dockerManager)
if err != nil {
logrus.Warnf("Attempted to destroy reverse proxy but no reverse proxy container was found.")
logrus.Warnf("Attempted to destroy reverse proxy but no reverse proxy container was found. Error was:\n%s", err.Error())
return nil
}

Expand Down
Loading