Skip to content

Commit ad486d8

Browse files
committed
Linter fixes and go version bump
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.
1 parent d76ec88 commit ad486d8

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- "1.13.x"
3+
- "1.15.x"
44

55
# needed for e2e tests (so we can start minikube)
66
sudo: required

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.13 as builder
1+
FROM golang:1.15 as builder
22
WORKDIR /go/src/github.com/bpineau/katafygio
33
COPY . .
44
RUN make build

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GOLANGCI_VERSION=1.21.0
1+
GOLANGCI_VERSION=1.33.0
22
export GO111MODULE := on
33

44
all: build

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/bpineau/katafygio
22

3-
go 1.13
3+
go 1.15
44

55
require (
66
github.com/ghodss/yaml v1.0.0

pkg/controller/controller.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
var (
2929
maxProcessRetry = 6
3030
canaryKey = "$katafygio canary$"
31-
unexported = []string{"selfLink", "uid", "resourceVersion", "generation"}
31+
unexported = []string{"selfLink", "uid", "resourceVersion", "generation", "managedFields"}
3232
)
3333

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

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

0 commit comments

Comments
 (0)