Skip to content

Commit 78eac7a

Browse files
camilamacedo86vitorflorianok8s-ci-robotv47dependabot[bot]
authored
📖 Update book-v4 with changes from release 4.13.0 (#5519)
* (infra/demos): Remove asciicinema demos The asciicinema demos add tooling debt, maintenance burden, poor UX, and provides little value to users, making it not worth the effort. * fix(go/v4): CI lint by using make lint instead of golangci-lint-action so the custom binary (with logcheck plugin) is built and used. * fix(helm/v2-alpha): use manager.replicas from values in chart template Generated-by: Cursor/Claude * ✨ (helm/v2-alpha): Add manager.envOverrides for CLI env overrides * fix(helm/v2-alpha): use sigs.k8s.io/yaml for 2-space YAML indentation in generated value files * 🌱 Bump goreleaser/goreleaser-action from 6 to 7 Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 6 to 7. - [Release notes](https://github.com/goreleaser/goreleaser-action/releases) - [Commits](goreleaser/goreleaser-action@v6...v7) --- updated-dependencies: - dependency-name: goreleaser/goreleaser-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * 🐛 fix: resolve panic when multiple plugins define the same flag (e.g. edit with go/v4 + helm) (#5506) fix: resolve panic when multiple plugins define the same flag (e.g. edit with go/v4 + helm) - Merge duplicate flags instead of binding twice; sync parsed value to all plugins in PreRunE. - Aggregate flag help as "For plugin (key): desc AND for plugin (key): desc". - Return a clear error when the same flag name is used with different types (e.g. bool vs string). Generated-by: Cursor/Claude * ✨ chore(go/v4): Upgrade cert-manager from 1.19.3 to 1.19.4 (#5509) chore(go/v4): Upgrade cert-manager from 1.19.3 to 1.19.4 * 🌱 cleanup(docs): remove script no longer used to build samples under books (#5511) cleanup(docs): remove script no longer used to build samples under books * 🌱 chore: add yamllint config for 2-space indentation and Kubernetes YAML best practices (#5507) chore: add yamllint config for 2-space indentation and Kubernetes YAML best practices * 🌱 infra: Remove pkg/internal/validation (#5512) infra: remove validation package Package validation was copied from k8s.io/apimachinery/utils/validation to avoid adding a dependency. Considering that kubebuilder already depends on apimachinery, using the original package requires less maintainance. * 🌱 Bump actions/upload-artifact from 6.0.0 to 7.0.0 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * 🐛 fix(go/v4,helm/v2-alpha): use 0644/0755 for generated files (#5508) fix(go/v4,helm/v2-alpha): use 0644/0755 for generated files --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Vitor Floriano <107767584+vitorfloriano@users.noreply.github.com> Co-authored-by: Kubernetes Prow Robot <20407524+k8s-ci-robot@users.noreply.github.com> Co-authored-by: v47 <victor.verg@hotmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent ab0aed6 commit 78eac7a

File tree

149 files changed

+15182
-15163
lines changed

Some content is hidden

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

149 files changed

+15182
-15163
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v6.0.2
35-
- name: Run yamllint make target
35+
- name: Install Helm
36+
run: make install-helm
37+
- name: Run yamllint (YAML + Helm chart output 2-space indentation)
3638
run: make yamllint
39+
- name: Check sample permissions
40+
run: make check-sample-permissions
3741

3842
license:
3943
runs-on: ubuntu-latest

.github/workflows/release-version-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
echo "$HOME/bin" >> $GITHUB_PATH
3939
4040
- name: Run GoReleaser in mock mode using tag
41-
uses: goreleaser/goreleaser-action@v6
41+
uses: goreleaser/goreleaser-action@v7
4242
with:
4343
version: v2.7.0
4444
args: release --skip=publish --clean -f ./build/.goreleaser.yml

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ jobs:
2929
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b $HOME/bin
3030
echo "$HOME/bin" >> $GITHUB_PATH
3131
- name: Run GoReleaser
32-
uses: goreleaser/goreleaser-action@v6
32+
uses: goreleaser/goreleaser-action@v7
3333
with:
3434
version: v2.7.0
3535
args: release -f ./build/.goreleaser.yml
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
- name: Upload assets
39-
uses: actions/upload-artifact@v6.0.0
39+
uses: actions/upload-artifact@v7.0.0
4040
with:
4141
name: kubebuilder
4242
path: dist/*

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6161
# format to the repository Actions tab.
6262
- name: "Upload artifact"
63-
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
63+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
6464
with:
6565
name: SARIF file
6666
path: results.sarif

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ docs/book/src/docs
3131

3232
## Skip testdata files that generate by tests using TestContext
3333
**/e2e-*/**
34+
# Optional rendered chart output (e.g. from make yamllint-helm when debugging)
35+
testdata/.helm-rendered.yaml

.yamllint

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# yamllint configuration for Kubebuilder
2+
# Aligns with Kubernetes YAML best practices:
3+
# - 2-space indentation, spaces only (no tabs)
4+
# - true/false over yes/no for booleans (truthy)
5+
# - Newline at end of file, no trailing spaces (POSIX)
6+
# - Unix newlines, consistent colons/hyphens
7+
# - No duplicate keys (key-duplicates)
8+
# - Document start (---) recommended for manifests; not enforced to allow existing testdata
9+
extends: default
10+
rules:
11+
line-length:
12+
max: 120
13+
allow-non-breakable-words: true
14+
# Generated CRDs and Prometheus manifests often have long lines
15+
ignore: |
16+
**/config/crd/bases/*.yaml
17+
**/config/prometheus/*.yaml
18+
indentation:
19+
spaces: 2
20+
# Kubernetes manifests often use list items at same indent as key (rules:\n- apiGroups:)
21+
indent-sequences: whatever
22+
# Uncommented replacement blocks in config/default/kustomization.yaml use 1-space for list items
23+
ignore: |
24+
**/config/default/kustomization.yaml
25+
# Kubernetes: prefer true/false over yes/no; do not check keys (e.g. "on" in workflows)
26+
truthy:
27+
check-keys: false
28+
# Allow single trailing blank line (common in editors)
29+
empty-lines:
30+
max-end: 1
31+
# Optional: document-start (---) is K8s best practice but not enforced for testdata
32+
document-start: disable
33+
document-end: disable

.yamllint-helm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# yamllint config for Helm-rendered manifest output (stdin or temp files).
2+
# Extends repo .yamllint; relaxes rules that are noisy for generated/template output.
3+
extends: .yamllint
4+
rules:
5+
line-length: disable
6+
trailing-spaces: disable

Makefile

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ check-docs: ## Run the script to ensure that the docs are updated
104104
./hack/docs/check.sh
105105

106106
.PHONY: lint
107-
lint: golangci-lint yamllint ## Run golangci-lint linter & yamllint
107+
lint: golangci-lint yamllint check-sample-permissions ## Run golangci-lint linter, yamllint & sample permissions check
108108
$(GOLANGCI_LINT) run
109109

110110
.PHONY: lint-fix
@@ -115,10 +115,36 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
115115
lint-config: golangci-lint ## Verify golangci-lint linter configuration
116116
$(GOLANGCI_LINT) config verify
117117

118-
.PHONY: yamllint
119-
yamllint:
120-
@files=$$(find testdata -name '*.yaml' ! -path 'testdata/*/dist/*'); \
121-
docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/yamllint:latest $$files -d "{extends: relaxed, rules: {line-length: {max: 120}}}" --no-warnings
118+
# Lint all YAML: testdata files (yamllint-yaml) + Helm-rendered charts (yamllint-helm).
119+
# Repo YAML uses .yamllint; Helm output uses .yamllint-helm.
120+
YAMLLINT_FILES := $(shell find testdata -name '*.yaml' ! -path 'testdata/.helm-rendered.yaml' \( ! -path 'testdata/*/dist/*' -o -path 'testdata/*/dist/chart/Chart.yaml' -o -path 'testdata/*/dist/chart/values.yaml' \) 2>/dev/null)
121+
HELM_CHARTS := $(shell find testdata docs/book -type d -path '*/dist/chart' 2>/dev/null)
122+
123+
.PHONY: yamllint yamllint-yaml yamllint-helm
124+
yamllint: yamllint-yaml yamllint-helm
125+
126+
yamllint-yaml:
127+
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data -w /data cytopia/yamllint:latest $(YAMLLINT_FILES) -c .yamllint --no-warnings
128+
129+
yamllint-helm:
130+
@for chart in $(HELM_CHARTS); do \
131+
helm template release $$chart --namespace=release-system 2>/dev/null | \
132+
docker run --rm -i -v $(PWD):/data -w /data cytopia/yamllint:latest -c .yamllint-helm --no-warnings - || (echo "yamllint-helm: $$chart failed"; exit 1); \
133+
done
134+
135+
# All Kubebuilder-generated samples (go/v4, kustomize, helm use machinery defaults 0755/0644).
136+
SAMPLE_ROOTS := testdata \
137+
docs/book/src/getting-started/testdata \
138+
docs/book/src/cronjob-tutorial/testdata \
139+
docs/book/src/multiversion-tutorial/testdata
140+
141+
.PHONY: check-sample-permissions
142+
check-sample-permissions: ## Fail if any file/dir under testdata or docs samples has wrong permissions (expect 0644/0755). bin/ excluded.
143+
@for d in $(SAMPLE_ROOTS); do \
144+
test -d "$$d" || continue; \
145+
bad=$$(find "$$d" -path '*/bin' -prune -o \( \( -type f ! -perm 0644 \) -o \( -type d ! -perm 0755 \) \) -print 2>/dev/null); \
146+
if [ -n "$$bad" ]; then echo "Invalid permissions under $$d (expect 0644/0755):"; echo "$$bad"; exit 1; fi; \
147+
done
122148

123149
.PHONY: golangci-lint
124150
golangci-lint:

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ Follow the [instructions](https://book.kubebuilder.io/quick-start.html#installat
3838

3939
See the [Getting Started](https://book.kubebuilder.io/quick-start.html) documentation.
4040

41-
![Quick Start](docs/gif/kb-demo.v3.11.1.svg)
42-
4341
Also, ensure that you check out the [Deploy Image](./docs/book/src/plugins/available/deploy-image-plugin-v1-alpha.md)
4442
Plugin. This plugin allows users to scaffold API/Controllers to deploy and manage an
4543
Operand (image) on the cluster following the guidelines and best practices. It abstracts the

docs/book/src/cronjob-tutorial/testdata/generate_cronjob.sh

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)