Skip to content

Commit 525a2d7

Browse files
authored
Merge pull request #851 from vincepri/release-0.5
Release for v0.5.1
2 parents 0fcf28e + 5747307 commit 525a2d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2606
-448
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919

2020
# Vscode files
2121
.vscode
22+
23+
# Tools binaries.
24+
hack/tools/bin

.golangci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
- misspell
5+
- structcheck
6+
- golint
7+
- govet
8+
- deadcode
9+
- errcheck
10+
- varcheck
11+
- goconst
12+
- unparam
13+
- ineffassign
14+
- nakedret
15+
- interfacer
16+
- gocyclo
17+
- lll
18+
- dupl
19+
- goimports
20+
121
linters-settings:
222
lll:
323
line-length: 170
424
dupl:
525
threshold: 400
26+
27+
run:
28+
timeout: 5m

Makefile

Lines changed: 70 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# Copyright 2019 The Kubernetes Authors.
3+
# Copyright 2020 The Kubernetes Authors.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -14,11 +14,30 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
#
18-
# Makefile with some common workflow for dev, build and test
19-
#
17+
# If you update this file, please follow
18+
# https://suva.sh/posts/well-documented-makefiles
19+
20+
## --------------------------------------
21+
## General
22+
## --------------------------------------
23+
24+
SHELL:=/usr/bin/env bash
25+
.DEFAULT_GOAL:=help
2026

21-
##@ General
27+
# Use GOPROXY environment variable if set
28+
GOPROXY := $(shell go env GOPROXY)
29+
ifeq ($(GOPROXY),)
30+
GOPROXY := https://proxy.golang.org
31+
endif
32+
export GOPROXY
33+
34+
# Active module mode, as we use go modules to manage dependencies
35+
export GO111MODULE=on
36+
37+
# Tools.
38+
TOOLS_DIR := hack/tools
39+
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
40+
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/golangci-lint)
2241

2342
# The help will print out all targets with their descriptions organized bellow their categories. The categories are represented by `##@` and the target descriptions by `##`.
2443
# The awk commands is responsible to read the entire set of makefiles included in this invocation, looking for lines of the file as xyz: ## something, and then pretty-format the target and help. Then, if there's a line with ##@ something, that gets pretty-printed as a category.
@@ -28,9 +47,52 @@
2847
help: ## Display this help
2948
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
3049

31-
##@ Tests
50+
## --------------------------------------
51+
## Testing
52+
## --------------------------------------
3253

3354
.PHONY: test
34-
test: ## Run the script check-everything.sh which will check all
35-
GO111MODULE=on TRACE=1 ./hack/check-everything.sh
55+
test: ## Run the script check-everything.sh which will check all.
56+
TRACE=1 ./hack/check-everything.sh
57+
58+
## --------------------------------------
59+
## Binaries
60+
## --------------------------------------
61+
62+
$(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod # Build golangci-lint from tools folder.
63+
cd $(TOOLS_DIR); go build -tags=tools -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
64+
65+
## --------------------------------------
66+
## Linting
67+
## --------------------------------------
68+
69+
.PHONY: lint
70+
lint: $(GOLANGCI_LINT) ## Lint codebase.
71+
$(GOLANGCI_LINT) run -v
72+
73+
## --------------------------------------
74+
## Generate
75+
## --------------------------------------
76+
77+
.PHONY: modules
78+
modules: ## Runs go mod to ensure modules are up to date.
79+
go mod tidy
80+
cd $(TOOLS_DIR); go mod tidy
81+
82+
## --------------------------------------
83+
## Cleanup / Verification
84+
## --------------------------------------
85+
86+
.PHONY: clean
87+
clean: ## Cleanup.
88+
$(MAKE) clean-bin
89+
90+
.PHONY: clean-bin
91+
clean-bin: ## Remove all generated binaries.
92+
rm -rf hack/tools/bin
3693

94+
.PHONY: verify-modules
95+
verify-modules: modules
96+
@if !(git diff --quiet HEAD -- go.sum go.mod); then \
97+
echo "go module files are out of date"; exit 1; \
98+
fi

OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
approvers:
44
- controller-runtime-admins
5+
- controller-runtime-maintainers
56
- controller-runtime-approvers
67
reviewers:
78
- controller-runtime-admins

OWNERS_ALIASES

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ aliases:
88
- droot
99
- mengqiy
1010

11+
# non-admin folks who have write-access and can approve any PRs in the repo
12+
controller-runtime-maintainers:
13+
- vincepri
14+
1115
# non-admin folks who can approve any PRs in the repo
1216
controller-runtime-approvers:
1317
- gerred
18+
- shawn-hurley
1419

1520
# folks who can review and LGTM any PRs in the repo (doesn't
1621
# include approvers & admins -- those count too via the OWNERS
1722
# file)
1823
controller-runtime-reviewers:
1924
- alvaroaleman
20-
- shawn-hurley
2125
- joelanford
2226
- alenkacz
2327
- vincepri

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
# Kubernetes controller-runtime Project
44

5-
The Kubernetes controller-runtime Project is a set of go libraries for building Controllers.
5+
The Kubernetes controller-runtime Project is a set of go libraries for building
6+
Controllers. It is leveraged by [Kubebuilder](https://book.kubebuilder.io/) and
7+
[Operator SDK](https://github.com/operator-framework/operator-sdk). Both are
8+
a great place to start for new projects. See
9+
[Kubebuilder's Quick Start](https://book.kubebuilder.io/quick-start.html) to
10+
see how it can be used.
611

712
Documentation:
813

@@ -11,6 +16,7 @@ Documentation:
1116
- [Creating a manager](https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/manager#example-New)
1217
- [Creating a controller](https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/controller#example-New)
1318
- [Examples](https://github.com/kubernetes-sigs/controller-runtime/blob/master/examples)
19+
- [Designs](https://github.com/kubernetes-sigs/controller-runtime/blob/master/designs)
1420

1521
# Versioning, Maintenance, and Compatibility
1622

designs/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Designs
2+
=======
3+
4+
These are design documents for changes to Controller Runtime They exist
5+
to help document the design processes that go into writing Controller
6+
Runtime, but may not be up-to-date (more below).
7+
8+
Not all changes to Controller Runtime need a design document -- only major
9+
ones. use your best judgement.
10+
11+
When submitting a design document, we encourage having written
12+
a proof-of-concept, and it's perfectly acceptable to submit the
13+
proof-of-concept PR simultaneously with the design document, as the
14+
proof-of-concept process can help iron out wrinkles and can help with the
15+
`Example` section of the template.
16+
17+
## Out-of-Date Designs
18+
19+
**Controller Runtime documentation
20+
[GoDoc](https://godoc.org/sigs.k8s.io/controller-runtime) should be
21+
considered the canonical, update-to-date reference and architectural
22+
documentation** for Controller Runtime.
23+
24+
However, if you see an out-of-date design document, feel free to submit
25+
a PR marking it as such, and add an addendum linking to issues documenting
26+
why things changed. For example:
27+
28+
```markdown
29+
30+
# Out of Date
31+
32+
This change is out of date. It turns out curly braces a frustrating to
33+
type, so we had to abandon functions entirely, and have users specify
34+
custom functionality using strings of Common LISP instead. See #000 for
35+
more information.
36+
```

designs/template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Title of the Design
2+
===================
3+
4+
<!-- Describe your change here. This is purposefully freeform: we want
5+
enough information to evaluate the design, but not so much that you're
6+
annoyed by the overall design process and decide to bake cookies instead.
7+
-->
8+
9+
## Example
10+
11+
<!-- Specify an example of how the user would use this. It helps other
12+
contributors get a feel for how this will look in real code, and provides
13+
a good opportunity to evaluate the end-user feel of the code for yourself.
14+
15+
If you find yourself groaning at verbosity, copy-and-pasting a lot, or
16+
writing a bunch of tiny helper functions, it's a good indication that you
17+
might need to re-evaluate the user experience of your design.
18+
19+
This is also a good opportunity to stop and write a proof-of-concept, if
20+
you haven't already, which should help catch practical nits with the
21+
design. -->

go.mod

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@ require (
66
github.com/evanphx/json-patch v4.5.0+incompatible
77
github.com/go-logr/logr v0.1.0
88
github.com/go-logr/zapr v0.1.0
9-
github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7 // indirect
9+
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef // indirect
1010
github.com/googleapis/gnostic v0.3.1 // indirect
1111
github.com/imdario/mergo v0.3.6 // indirect
1212
github.com/onsi/ginkgo v1.11.0
1313
github.com/onsi/gomega v1.8.1
1414
github.com/prometheus/client_golang v1.0.0
1515
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
16+
go.uber.org/atomic v1.4.0 // indirect
1617
go.uber.org/zap v1.10.0
18+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 // indirect
19+
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 // indirect
1720
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
18-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7
1921
gomodules.xyz/jsonpatch/v2 v2.0.1
22+
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
2023
gopkg.in/fsnotify.v1 v1.4.7
24+
gopkg.in/yaml.v2 v2.2.7 // indirect
2125
k8s.io/api v0.17.2
2226
k8s.io/apiextensions-apiserver v0.17.2
2327
k8s.io/apimachinery v0.17.2

0 commit comments

Comments
 (0)