Skip to content

Commit

Permalink
Update libs and goreleaser
Browse files Browse the repository at this point in the history
Update to k8s v1.21, and latest goreleaser version.
  • Loading branch information
bpineau committed Jul 3, 2021
1 parent 71da77b commit 6968fb0
Show file tree
Hide file tree
Showing 8 changed files with 695 additions and 224 deletions.
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
3 changes: 1 addition & 2 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
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

0 comments on commit 6968fb0

Please sign in to comment.