-
Notifications
You must be signed in to change notification settings - Fork 12
Kubebuilder update from v4.11.1 to v4.12.0 #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8b20830
chore(kubebuilder): (:warning: manual conflict resolution required) u…
github-actions[bot] 50c71fe
Fix conflicts and resolve some linter issues
afritzler ddd90f3
Fix logcheck linting issues
afritzler 0d6beb9
Cleanup
afritzler 5273f9b
Update reuse configuration
afritzler 4ec9dce
add .custom-gcl.yml to reuse exceptions
asergeant01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # This file configures golangci-lint with module plugins. | ||
| # When you run 'make lint', it will automatically build a custom golangci-lint binary | ||
| # with all the plugins listed below. | ||
| # | ||
| # See: https://golangci-lint.run/plugins/module-plugins/ | ||
| version: v2.8.0 | ||
| plugins: | ||
| # logcheck validates structured logging calls and parameters (e.g., balanced key-value pairs) | ||
| - module: "sigs.k8s.io/logtools" | ||
| import: "sigs.k8s.io/logtools/logcheck/gclplugin" | ||
| version: latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "Kubebuilder DevContainer", | ||
| "image": "golang:1.25", | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/docker-in-docker:2": { | ||
| "moby": false, | ||
| "dockerDefaultAddressPool": "base=172.30.0.0/16,size=24" | ||
| }, | ||
| "ghcr.io/devcontainers/features/git:1": {}, | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "upgradePackages": true | ||
| } | ||
| }, | ||
|
|
||
| "runArgs": ["--privileged", "--init"], | ||
|
|
||
| "customizations": { | ||
| "vscode": { | ||
| "settings": { | ||
| "terminal.integrated.shell.linux": "/bin/bash" | ||
| }, | ||
| "extensions": [ | ||
| "ms-kubernetes-tools.vscode-kubernetes-tools", | ||
| "ms-azuretools.vscode-docker" | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| "remoteEnv": { | ||
| "GO111MODULE": "on" | ||
| }, | ||
|
|
||
| "onCreateCommand": "bash .devcontainer/post-install.sh" | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| echo "====================================" | ||
| echo "Kubebuilder DevContainer Setup" | ||
| echo "====================================" | ||
|
|
||
| # Verify running as root (required for installing to /usr/local/bin and /etc) | ||
| if [ "$(id -u)" -ne 0 ]; then | ||
| echo "ERROR: This script must be run as root" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "Detecting system architecture..." | ||
| # Detect architecture using uname | ||
| MACHINE=$(uname -m) | ||
| case "${MACHINE}" in | ||
| x86_64) | ||
| ARCH="amd64" | ||
| ;; | ||
| aarch64|arm64) | ||
| ARCH="arm64" | ||
| ;; | ||
| *) | ||
| echo "WARNING: Unsupported architecture ${MACHINE}, defaulting to amd64" | ||
| ARCH="amd64" | ||
| ;; | ||
| esac | ||
| echo "Architecture: ${ARCH}" | ||
|
|
||
| echo "" | ||
| echo "------------------------------------" | ||
| echo "Setting up bash completion..." | ||
| echo "------------------------------------" | ||
|
|
||
| BASH_COMPLETIONS_DIR="/usr/share/bash-completion/completions" | ||
|
|
||
| # Enable bash-completion in root's .bashrc (devcontainer runs as root) | ||
| if ! grep -q "source /usr/share/bash-completion/bash_completion" ~/.bashrc 2>/dev/null; then | ||
| echo 'source /usr/share/bash-completion/bash_completion' >> ~/.bashrc | ||
| echo "Added bash-completion to .bashrc" | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "------------------------------------" | ||
| echo "Installing development tools..." | ||
| echo "------------------------------------" | ||
|
|
||
| # Install kind | ||
| if ! command -v kind &> /dev/null; then | ||
| echo "Installing kind..." | ||
| curl -Lo /usr/local/bin/kind "https://kind.sigs.k8s.io/dl/latest/kind-linux-${ARCH}" | ||
| chmod +x /usr/local/bin/kind | ||
| echo "kind installed successfully" | ||
| fi | ||
|
|
||
| # Generate kind bash completion | ||
| if command -v kind &> /dev/null; then | ||
| if kind completion bash > "${BASH_COMPLETIONS_DIR}/kind" 2>/dev/null; then | ||
| echo "kind completion installed" | ||
| else | ||
| echo "WARNING: Failed to generate kind completion" | ||
| fi | ||
| fi | ||
|
|
||
| # Install kubebuilder | ||
| if ! command -v kubebuilder &> /dev/null; then | ||
| echo "Installing kubebuilder..." | ||
| curl -Lo /usr/local/bin/kubebuilder "https://go.kubebuilder.io/dl/latest/linux/${ARCH}" | ||
| chmod +x /usr/local/bin/kubebuilder | ||
| echo "kubebuilder installed successfully" | ||
| fi | ||
|
|
||
| # Generate kubebuilder bash completion | ||
| if command -v kubebuilder &> /dev/null; then | ||
| if kubebuilder completion bash > "${BASH_COMPLETIONS_DIR}/kubebuilder" 2>/dev/null; then | ||
| echo "kubebuilder completion installed" | ||
| else | ||
| echo "WARNING: Failed to generate kubebuilder completion" | ||
| fi | ||
| fi | ||
|
|
||
| # Install kubectl | ||
| if ! command -v kubectl &> /dev/null; then | ||
| echo "Installing kubectl..." | ||
| KUBECTL_VERSION=$(curl -Ls https://dl.k8s.io/release/stable.txt) | ||
| curl -Lo /usr/local/bin/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl" | ||
| chmod +x /usr/local/bin/kubectl | ||
| echo "kubectl installed successfully" | ||
| fi | ||
|
|
||
| # Generate kubectl bash completion | ||
| if command -v kubectl &> /dev/null; then | ||
| if kubectl completion bash > "${BASH_COMPLETIONS_DIR}/kubectl" 2>/dev/null; then | ||
| echo "kubectl completion installed" | ||
| else | ||
| echo "WARNING: Failed to generate kubectl completion" | ||
| fi | ||
| fi | ||
|
|
||
| # Generate Docker bash completion | ||
| if command -v docker &> /dev/null; then | ||
| if docker completion bash > "${BASH_COMPLETIONS_DIR}/docker" 2>/dev/null; then | ||
| echo "docker completion installed" | ||
| else | ||
| echo "WARNING: Failed to generate docker completion" | ||
| fi | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "------------------------------------" | ||
| echo "Configuring Docker environment..." | ||
| echo "------------------------------------" | ||
|
|
||
| # Wait for Docker to be ready | ||
| echo "Waiting for Docker to be ready..." | ||
| for i in {1..30}; do | ||
| if docker info >/dev/null 2>&1; then | ||
| echo "Docker is ready" | ||
| break | ||
| fi | ||
| if [ "$i" -eq 30 ]; then | ||
| echo "WARNING: Docker not ready after 30s" | ||
| fi | ||
| sleep 1 | ||
| done | ||
afritzler marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Create kind network (ignore if already exists) | ||
| if ! docker network inspect kind >/dev/null 2>&1; then | ||
| if docker network create kind >/dev/null 2>&1; then | ||
| echo "Created kind network" | ||
| else | ||
| echo "WARNING: Failed to create kind network (may already exist)" | ||
| fi | ||
| fi | ||
|
|
||
| echo "" | ||
| echo "------------------------------------" | ||
| echo "Verifying installations..." | ||
| echo "------------------------------------" | ||
| kind version | ||
| kubebuilder version | ||
| kubectl version --client | ||
| docker --version | ||
| go version | ||
|
|
||
| echo "" | ||
| echo "====================================" | ||
| echo "DevContainer ready!" | ||
| echo "====================================" | ||
| echo "All development tools installed successfully." | ||
| echo "You can now start building Kubernetes operators." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.