Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04

ENV WORKDIR="/home/vscode/add-controller"

WORKDIR ${WORKDIR}

COPY . .

ARG ARCH

ARG GO_VERSION
RUN export ARCH=${ARCH:-$(dpkg --print-architecture)} && \
curl -fsSL "https://golang.org/dl/go${GO_VERSION}.linux-${ARCH}.tar.gz" | tar -C /usr/local -xzf - && \
echo 'export PATH=$PATH:/usr/local/go/bin:/home/vscode/go/bin' >> /home/vscode/.bashrc

ENV PATH="${PATH}:/usr/local/go/bin:/home/vscode/go/bin"
ENV GOPATH="/home/vscode/go"
ENV GOROOT="/usr/local/go"

RUN make tools
ENV PATH="${PATH}:/home/vscode/project-sveltos/hack/tools/bin"

ARG KUBECTX_VERSION
RUN export ARCH=${ARCH:-$(dpkg --print-architecture)} && \
echo "Installing kubectx version ${KUBECTX_VERSION}..." && \
curl -sLo /usr/local/bin/kubectx https://github.com/ahmetb/kubectx/releases/download/v${KUBECTX_VERSION}/kubectx && \
chmod +x /usr/local/bin/kubectx

ARG SVELTOSCTL_VERSION
RUN export ARCH=${ARCH:-$(dpkg --print-architecture)} && \
echo "Installing svletosctl version ${SVELTOSCTL_VERSION}..." && \
curl -sLo /usr/local/bin/sveltosctl https://github.com/projectsveltos/sveltosctl/releases/download/v${SVELTOSCTL_VERSION}/sveltosctl-linux-${ARCH} && \
chmod +x /usr/local/bin/sveltosctl

32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Project Sveltos",
"containerEnv": {
"KUBECONFIG": "/vscode/.kube/config",
"WORKDIR": "${localWorkspaceFolder}"
},
"build": {
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
"context": "${localWorkspaceFolder}",
"args": {
"GO_VERSION": "1.24.1",
"KUBECTX_VERSION": "0.9.5",
"SVELTOSCTL_VERSION": "0.53.0"
}
},
"workspaceFolder": "${localWorkspaceFolder}",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"mounts": [
"source=${localWorkspaceFolder}/test/.kube,target=/vscode/.kube,type=bind"
],
"runArgs": [],
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"customizations": {
"vscode": {
"extensions": [],
"settings": {}
}
},
"initializeCommand": "mkdir -p ${localWorkspaceFolder}/test/.kube"
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ pkg/drift-detection/drift-detection-manager-in-mgmt-cluster.yaml-e
pkg/drift-detection/drift-detection-manager.yaml-e

version.txt

# Test Kubernetes config files
test/.kube