Skip to content

Commit

Permalink
Linter fixes and go version bump
Browse files Browse the repository at this point in the history
Small changes:
* Upgrade to latest go and golint version, to ease development
* Explicitely ask for watch bookmarks where possible
* Filter out `managedFields` (k8s 1.19 noise) as this severely bloat archives, and has little value being backuped

Not sure if we should keep the `mispell` linter (which just broke
travis tests on master), as they are of low value.
  • Loading branch information
bpineau committed Nov 29, 2020
1 parent d76ec88 commit ad486d8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- "1.13.x"
- "1.15.x"

# needed for e2e tests (so we can start minikube)
sudo: required
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.13 as builder
FROM golang:1.15 as builder
WORKDIR /go/src/github.com/bpineau/katafygio
COPY . .
RUN make build
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GOLANGCI_VERSION=1.21.0
GOLANGCI_VERSION=1.33.0
export GO111MODULE := on

all: build
Expand Down
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/bpineau/katafygio

go 1.13
go 1.15

require (
github.com/ghodss/yaml v1.0.0
Expand Down
6 changes: 3 additions & 3 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
var (
maxProcessRetry = 6
canaryKey = "$katafygio canary$"
unexported = []string{"selfLink", "uid", "resourceVersion", "generation"}
unexported = []string{"selfLink", "uid", "resourceVersion", "generation", "managedFields"}
)

// Interface describe a standard kubernetes controller
Expand Down Expand Up @@ -77,7 +77,7 @@ func New(client cache.ListerWatcher,
excludednamespace []string,
) *Controller {

selector := metav1.ListOptions{LabelSelector: filter, ResourceVersion: "0"}
selector := metav1.ListOptions{LabelSelector: filter, ResourceVersion: "0", AllowWatchBookmarks: true}
lw := &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
return client.List(selector)
Expand Down Expand Up @@ -234,7 +234,7 @@ func (c *Controller) processItem(key string) error {
for _, nsre := range c.excludedns {
if nsre.MatchString(namespace) {
// Rely on the background sync to delete these excluded files if
// we previously had aquired them
// we previously had acquired them
return nil
}
}
Expand Down

0 comments on commit ad486d8

Please sign in to comment.