diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/Dockerfile b/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/devcontainer.json b/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/post-install.sh b/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide diff --git a/docs/book/src/getting-started/testdata/project/.devcontainer/Dockerfile b/docs/book/src/getting-started/testdata/project/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/docs/book/src/getting-started/testdata/project/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/docs/book/src/getting-started/testdata/project/.devcontainer/devcontainer.json b/docs/book/src/getting-started/testdata/project/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/docs/book/src/getting-started/testdata/project/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/docs/book/src/getting-started/testdata/project/.devcontainer/post-install.sh b/docs/book/src/getting-started/testdata/project/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/docs/book/src/getting-started/testdata/project/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide diff --git a/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/Dockerfile b/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/devcontainer.json b/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/post-install.sh b/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/testdata/project-v4-multigroup-with-deploy-image/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide diff --git a/testdata/project-v4-multigroup/.devcontainer/Dockerfile b/testdata/project-v4-multigroup/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/testdata/project-v4-multigroup/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/testdata/project-v4-multigroup/.devcontainer/devcontainer.json b/testdata/project-v4-multigroup/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/testdata/project-v4-multigroup/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/testdata/project-v4-multigroup/.devcontainer/post-install.sh b/testdata/project-v4-multigroup/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/testdata/project-v4-multigroup/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide diff --git a/testdata/project-v4-with-deploy-image/.devcontainer/Dockerfile b/testdata/project-v4-with-deploy-image/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/testdata/project-v4-with-deploy-image/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/testdata/project-v4-with-deploy-image/.devcontainer/devcontainer.json b/testdata/project-v4-with-deploy-image/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/testdata/project-v4-with-deploy-image/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/testdata/project-v4-with-deploy-image/.devcontainer/post-install.sh b/testdata/project-v4-with-deploy-image/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/testdata/project-v4-with-deploy-image/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide diff --git a/testdata/project-v4-with-grafana/.devcontainer/Dockerfile b/testdata/project-v4-with-grafana/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/testdata/project-v4-with-grafana/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/testdata/project-v4-with-grafana/.devcontainer/devcontainer.json b/testdata/project-v4-with-grafana/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/testdata/project-v4-with-grafana/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/testdata/project-v4-with-grafana/.devcontainer/post-install.sh b/testdata/project-v4-with-grafana/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/testdata/project-v4-with-grafana/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide diff --git a/testdata/project-v4/.devcontainer/Dockerfile b/testdata/project-v4/.devcontainer/Dockerfile new file mode 100644 index 00000000000..d02dad718c4 --- /dev/null +++ b/testdata/project-v4/.devcontainer/Dockerfile @@ -0,0 +1,18 @@ +# Build the manager binary +# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): +# 1, 1.19, 1.18, 1-bullseye, 1.19-bullseye, 1.18-bullseye, 1-buster, 1.19-buster, 1.18-buster +ARG TAG=1.22 +FROM golang:${TAG} + +COPY post-install.sh . + +# Install dependencies +RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ + install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + +RUN go install sigs.k8s.io/kind@v0.23.0 && \ + curl -o kubebuilder \ + -L https://github.com/kubernetes-sigs/kubebuilder/releases/latest/download/kubebuilder_linux_amd64 && \ + chmod +x kubebuilder && \ + mv kubebuilder /usr/local/bin/ && \ + chmod +x post-install.sh diff --git a/testdata/project-v4/.devcontainer/devcontainer.json b/testdata/project-v4/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..02aae1b553a --- /dev/null +++ b/testdata/project-v4/.devcontainer/devcontainer.json @@ -0,0 +1,42 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-in-docker +{ + "name": "Kubebuilder DevContainer", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2.11.0": { + "moby": true, + "azureDnsAutoDetection": true, + "version": "latest" + }, + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": false, + "upgradePackages": true, + "username": "devcontainer", + "userUid": "1001", + "userGid": "1001" + }, + "ghcr.io/devcontainers/features/git:1": { + "ppa": true, + "version": "system" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.22.0" + } + }, + + "runArgs": ["--network=host"], + // "forwardPorts": [], + + "postCreateCommand": "bash ./.devcontainer/post-install.sh" + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/testdata/project-v4/.devcontainer/post-install.sh b/testdata/project-v4/.devcontainer/post-install.sh new file mode 100644 index 00000000000..57e0f2d6493 --- /dev/null +++ b/testdata/project-v4/.devcontainer/post-install.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -e + +go version +kubectl version --client + +# Check if Kind cluster already exists. +if kubectl cluster-info &>/dev/null; then + echo "Kind cluster already exists." +else + echo "Kind cluster doesn't exist. Creating new cluster...." + kind create cluster +fi + +kubectl get nodes -o wide