Skip to content

Commit

Permalink
Fix controller crash caused by glog attempting to write to /tmp (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesuen authored and dthomson25 committed Jun 12, 2019
1 parent aa4bb1d commit fb880c1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 18 deletions.
6 changes: 6 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
####################################################################################################
# argo-rollouts-dev
####################################################################################################
FROM scratch
COPY dist/rollouts-controller-linux-amd64 /bin/rollouts-controller
ENTRYPOINT [ "/bin/rollouts-controller" ]
24 changes: 8 additions & 16 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ required = [
[[override]]
name = "k8s.io/apiserver"
branch = "release-1.12"

[[override]]
name = "k8s.io/apimachinery"
branch = "release-1.12"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ GIT_TAG=$(shell if [ -z "`git status --porcelain`" ]; then git describe --exact-
GIT_TREE_STATE=$(shell if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)
TEST_CMD=$(shell [ "`which gotestsum`" != "" ] && echo gotestsum -- || echo go test)

# build development images
DEV_IMAGE=false

override LDFLAGS += \
-X ${PACKAGE}.version=${VERSION} \
-X ${PACKAGE}.buildDate=${BUILD_DATE} \
Expand Down Expand Up @@ -57,7 +60,12 @@ builder-image:

.PHONY: image
image:
ifeq ($(DEV_IMAGE), true)
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/rollouts-controller-linux-amd64 ./cmd/rollouts-controller
docker build -t $(IMAGE_PREFIX)argo-rollouts:$(IMAGE_TAG) -f Dockerfile.dev .
else
docker build -t $(IMAGE_PREFIX)argo-rollouts:$(IMAGE_TAG) .
endif
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argo-rollouts:$(IMAGE_TAG) ; fi

.PHONY: lint
Expand Down
3 changes: 1 addition & 2 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"reflect"
"time"

"github.com/golang/glog"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
appsv1 "k8s.io/api/apps/v1"
Expand Down Expand Up @@ -106,7 +105,7 @@ func NewController(
utilruntime.Must(rolloutscheme.AddToScheme(scheme.Scheme))
log.Info("Creating event broadcaster")
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartLogging(glog.Infof)
eventBroadcaster.StartLogging(log.Infof)
eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeclientset.CoreV1().Events("")})
recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerAgentName})
replicaSetControl := controller.RealRSControl{
Expand Down

0 comments on commit fb880c1

Please sign in to comment.