Skip to content

Commit

Permalink
Fix run-once segfault (#101)
Browse files Browse the repository at this point in the history
* Fix run-once segfault

* update golang version
  • Loading branch information
sudermanjr authored Jul 11, 2023
1 parent e79b7e6 commit aebd4af
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
test:
working_directory: /home/circleci/go/src/github.com/fairwindsops/vault-token-injector
docker:
- image: cimg/go:1.19
- image: cimg/go:1.20
steps:
- checkout
- run:
Expand All @@ -32,7 +32,7 @@ jobs:
path: /tmp/test_results
release:
docker:
- image: goreleaser/goreleaser:v1.16.1
- image: goreleaser/goreleaser:v1.19.2
resource_class: large
shell: /bin/bash
steps:
Expand All @@ -49,7 +49,7 @@ jobs:
- run: goreleaser
snapshot:
docker:
- image: goreleaser/goreleaser:v1.16.1
- image: goreleaser/goreleaser:v1.19.2
steps:
- checkout
- setup_remote_docker
Expand Down
3 changes: 0 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ dockers:
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:{{ .Tag }}-amd64"
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:v{{ .Major }}-amd64"
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:v{{ .Major }}.{{ .Minor }}-amd64"
use: buildx
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- image_templates:
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:{{ .Tag }}-arm64v8"
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:v{{ .Major }}-arm64v8"
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:v{{ .Major }}.{{ .Minor }}-arm64v8"
use: buildx
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
Expand All @@ -71,7 +69,6 @@ dockers:
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:{{ .Tag }}-armv7"
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:v{{ .Major }}-armv7"
- "us-docker.pkg.dev/fairwinds-ops/oss/vault-token-injector:v{{ .Major }}.{{ .Minor }}-armv7"
use: buildx
goarch: arm64
dockerfile: Dockerfile
build_flag_templates:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ clean:
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME) -ldflags "-X main.version=$(VERSION) -X main.commit=$(COMMIT) -s -w" -v
build-docker:
goreleaser --snapshot --rm-dist
goreleaser --snapshot --clean --skip-sign
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fairwindsops/vault-token-injector

go 1.19
go 1.20

require (
github.com/hashicorp/go-tfe v1.18.0
Expand Down
6 changes: 6 additions & 0 deletions pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ func (a *App) RunOnce() error {

klog.Info("running the token injection once")

a.registerMetrics()
if a.EnableMetrics {
http.Handle("/metrics", promhttp.Handler())
go http.ListenAndServe(":4329", nil)
}

if err := a.refreshVaultToken(); err != nil {
return err
}
Expand Down

0 comments on commit aebd4af

Please sign in to comment.