diff --git a/Makefile b/Makefile index f72ab00b..8fad8077 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ NAME := popeye PACKAGE := github.com/derailed/$(NAME) -VERSION := v0.22.1 +VERSION := v0.22.2 GIT := $(shell git rev-parse --short HEAD) DATE := $(shell date +%FT%T%Z) IMG_NAME := derailed/popeye diff --git a/README.md b/README.md index 3d8f8c5b..226310d7 100644 --- a/README.md +++ b/README.md @@ -513,9 +513,14 @@ spec: image: derailed/popeye:vX.Y.Z imagePullPolicy: IfNotPresent args: - - -o + - --out - yaml - --force-exit-zero + - --logs + - none + - --cluster-name + - my-cluster + - --all-namespaces resources: limits: cpu: 500m @@ -523,6 +528,9 @@ spec: ``` The `--force-exit-zero` should be set. Otherwise, the pods will end up in an error state. +The `--logs none` argument must be set to output the log to stdout. Otherwise `kubectl logs -f` will return an empty result. +The `--cluster-name` should be set to the name of your cluster for in-cluster usage. + > NOTE! Popeye exits with a non-zero error code if any lint errors are detected. diff --git a/k8s/popeye/cronjob.yml b/k8s/popeye/cronjob.yml index cff405b5..1404704b 100644 --- a/k8s/popeye/cronjob.yml +++ b/k8s/popeye/cronjob.yml @@ -20,10 +20,16 @@ spec: imagePullPolicy: IfNotPresent command: ["/bin/popeye"] args: - - -f + - --file - /etc/config/popeye/spinach.yml - - -o + - --out - yaml + - --force-exit-zero + - --logs + - none + - --cluster-name + - my-cluster + - --all-namespaces resources: limits: cpu: 500m diff --git a/pkg/config/s3.go b/pkg/config/s3.go index cce15a3a..be253b49 100644 --- a/pkg/config/s3.go +++ b/pkg/config/s3.go @@ -90,6 +90,17 @@ func (s *S3Info) minioUpload(ctx context.Context, bucket, key, asset string, rwc } contentType := "application/octet-stream" + fileExtension := filepath.Ext(asset) + + switch fileExtension { + case ".html": + contentType = "text/html" + case ".json": + contentType = "application/json" + case ".yaml", ".yml": + contentType = "application/yaml" + } + info, err := minioClient.PutObject(ctx, bucket, filepath.Join(key, asset),