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

Update libs and goreleaser #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-20.04
steps:

- name: Set up Go 1.15
- name: Set up Go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
id: go

- name: Check out code
Expand All @@ -28,9 +28,10 @@ jobs:
echo "${{ secrets.QUAY_IO_PASSWORD }}" | docker login -u ${{ secrets.QUAY_IO_USERNAME }} --password-stdin quay.io

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.4.0
uses: goreleaser/goreleaser-action@v2.6.1
with:
version: v0.148.0
distribution: goreleaser
version: v0.172.1
args: release --rm-dist --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ dist/*
profile.cov
katafygio.8.gz
katafygio
TODO.txt
18 changes: 11 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ builds:
- darwin
goarch:
- amd64
# TODO will be supported in go 1.16 (see https://github.com/goreleaser/goreleaser/issues/1903)
#- arm64
- arm64
hooks:
post: make man

Expand Down Expand Up @@ -75,7 +74,7 @@ dockers:
- "quay.io/bpineau/katafygio:v{{ .Major }}.{{ .Minor }}"
goos: linux
goarch: amd64
builds: [default]
ids: [default]
dockerfile: assets/Dockerfile.goreleaser
skip_push: false
build_flag_templates:
Expand All @@ -99,10 +98,12 @@ nfpms:
- rpm
dependencies:
- git
config_files:
"./assets/katafygio.yaml": "/etc/katafygio/katafygio.yaml"
files:
"./katafygio.8.gz": "/usr/share/man/man8/katafygio.8.gz"
contents:
- src: ./assets/katafygio.yaml
dst: /etc/katafygio/katafygio.yaml
type: config
- src: ./katafygio.8.gz
dst: /usr/share/man/man8/katafygio.8.gz
overrides:
rpm:
replacements:
Expand All @@ -129,6 +130,9 @@ brews:
license: MIT
skip_upload: false

install: |
bin.install "katafygio"

test: |
system "#{bin}/katafygio version"

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15 as builder
FROM golang:1.16 as builder
WORKDIR /go/src/github.com/bpineau/katafygio
COPY . .
RUN make build
Expand Down
6 changes: 3 additions & 3 deletions cmd/configfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func loadConfigFile() {
viper.SetConfigType("yaml")
viper.SetConfigName(appName)
viper.SetConfigName(appName + ".yaml")

// all possible config file paths, by priority
viper.AddConfigPath("/etc/katafygio/")
Expand All @@ -32,8 +32,8 @@ func loadConfigFile() {
viper.AutomaticEnv()

if err := viper.ReadInConfig(); err != nil {
_, ok := err.(viper.ConfigParseError)
if ok {
_, ok := err.(viper.ConfigFileNotFoundError)
if !ok {
log.Fatalf("Can't read config file: %v\n", err)
}
}
Expand Down
32 changes: 24 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
module github.com/bpineau/katafygio

go 1.15
go 1.16

require (
cloud.google.com/go v0.86.0 // indirect
github.com/Azure/go-autorest/autorest v0.11.19 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.14 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/ghodss/yaml v1.0.0
github.com/sirupsen/logrus v1.4.2
github.com/spf13/afero v1.2.2
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.4.0
k8s.io/api v0.17.0
k8s.io/apimachinery v0.17.0
k8s.io/client-go v0.17.0
github.com/google/gofuzz v1.2.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/afero v1.6.0
github.com/spf13/cobra v1.2.1
github.com/spf13/viper v1.8.1
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
golang.org/x/net v0.0.0-20210614182718-04defd469f4e // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 // indirect
k8s.io/api v0.21.2
k8s.io/apimachinery v0.21.2
k8s.io/client-go v0.21.2
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.9.0 // indirect
k8s.io/utils v0.0.0-20210629042839-4a2b36d8d73f // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect
)
861 changes: 657 additions & 204 deletions go.sum

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pkg/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package observer

import (
"context"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -147,10 +148,10 @@ func (c *Observer) refresh() error {
}
lw := &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
return c.cpool.Resource(resource).Namespace(namespace).List(options)
return c.cpool.Resource(resource).Namespace(namespace).List(context.Background(), options)
},
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
return c.cpool.Resource(resource).Namespace(namespace).Watch(options)
return c.cpool.Resource(resource).Namespace(namespace).Watch(context.Background(), options)
},
}

Expand Down