diff --git a/Makefile b/Makefile index 76d501488..e5dbd6137 100644 --- a/Makefile +++ b/Makefile @@ -268,7 +268,7 @@ oss-image: ## Build agent container image for NGINX OSS @echo Building image with $(CONTAINER_CLITOOL); \ $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t ${IMAGE_TAG} . \ --no-cache -f ./scripts/docker/nginx-oss/${CONTAINER_OS_TYPE}/Dockerfile \ - --target install-agent-local + --target install-agent-local \ --build-arg PACKAGE_NAME=${PACKAGE_NAME} \ --build-arg PACKAGES_REPO=${OSS_PACKAGES_REPO} \ --build-arg BASE_IMAGE=${BASE_IMAGE} \ diff --git a/main.go b/main.go index fc84bdde4..5bd5a1c88 100644 --- a/main.go +++ b/main.go @@ -137,8 +137,10 @@ func handleSignals( log.Errorf("Error sending AgentStopped event to command channel: %v", err) } - if err := controller.Close(); err != nil { - log.Errorf("Unable to close controller: %v", err) + if controller != nil { + if err := controller.Close(); err != nil { + log.Warnf("Unable to close controller: %v", err) + } } log.Warn("NGINX Agent exiting")