From 65da2a92be5a03c64c55c407aabeb7d89528295f Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Thu, 15 Feb 2024 05:10:38 +0000 Subject: [PATCH 01/19] (feat): Add codespaces/devpod support Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 26 +++++++++++++++++++++ .devcontainer/postCreateCommand.sh | 36 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/postCreateCommand.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..2437057f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +{ + "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers/features/go:1": { + "version": "1.21" + }, + "ghcr.io/devcontainers/features/node:1": { + "version": "20" + }, + "ghcr.io/devcontainers/features/docker-in-docker:2": {}, + "ghcr.io/devcontainers/features/python:1": {} + }, + "forwardPorts": [ + 8443 + ], + "hostRequirements": { + "cpus": 8 + }, + "postCreateCommand": ".devcontainer/postCreateCommand.sh", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/cnoe-io/idpbuilder,type=bind", + "workspaceFolder": "/home/vscode/go/src/github.com/cnoe-io/idpbuilder", + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/home/vscode/go/bin", + "GOPATH": "/home/vscode/go" + } +} \ No newline at end of file diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh new file mode 100755 index 00000000..61e7c81b --- /dev/null +++ b/.devcontainer/postCreateCommand.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env sh +set -eux + +TARGETOS=linux +TARGETARCH=amd64 + +# Install Kind +curl -L -o kind "https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-${TARGETARCH}" && chmod +x ./kind +sudo mv ./kind /usr/local/bin + +# Install kubectl +curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl && chmod +x ./kubectl +sudo mv ./kubectl /usr/local/bin + +# Install helm +bash -c "curl -s https://get.helm.sh/helm-v3.14.1-linux-${TARGETARCH}.tar.gz > helm3.tar.gz" && tar -zxvf helm3.tar.gz linux-${TARGETARCH}/helm && chmod +x linux-${TARGETARCH}/helm +sudo mv linux-${TARGETARCH}/helm /usr/local/bin && rm helm3.tar.gz && rm -R linux-${TARGETARCH} + +# Install kubebuilder +curl -L -o kubebuilder "https://go.kubebuilder.io/dl/latest/${TARGETOS}/${TARGETARCH}" && chmod +x kubebuilder +sudo mv kubebuilder /usr/local/bin/ + + +# install protocol buffer compiler (protoc) +sudo apt update +sudo apt install -y protobuf-compiler + +sudo apt install bash-completion + +printf " +source <(kubectl completion bash) +alias k=kubectl +complete -F __start_kubectl k +" >> $HOME/.bashrc + + From 0b659f392ef9f01f91e4909b802b7b4af40d1361 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Thu, 15 Feb 2024 20:22:45 +0000 Subject: [PATCH 02/19] add gh cli Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 2 +- .devcontainer/postCreateCommand.sh | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2437057f..0570356d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,7 @@ 8443 ], "hostRequirements": { - "cpus": 8 + "cpus": 4 }, "postCreateCommand": ".devcontainer/postCreateCommand.sh", "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/cnoe-io/idpbuilder,type=bind", diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 61e7c81b..6a43c61c 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -20,13 +20,16 @@ sudo mv linux-${TARGETARCH}/helm /usr/local/bin && rm helm3.tar.gz && rm -R linu curl -L -o kubebuilder "https://go.kubebuilder.io/dl/latest/${TARGETOS}/${TARGETARCH}" && chmod +x kubebuilder sudo mv kubebuilder /usr/local/bin/ - -# install protocol buffer compiler (protoc) -sudo apt update -sudo apt install -y protobuf-compiler - +# Install Github CLI +type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) +curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ +&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ +&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ +&& sudo apt update \ +&& sudo apt install gh -y + +# Setup kubectl and k autocompletion sudo apt install bash-completion - printf " source <(kubectl completion bash) alias k=kubectl From be315e2c450b01865301bf009eb0bc29718a8c87 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Thu, 15 Feb 2024 16:35:04 -0500 Subject: [PATCH 03/19] remove curl install Signed-off-by: Carlos Santana --- .devcontainer/postCreateCommand.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 6a43c61c..5a915877 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -21,7 +21,6 @@ curl -L -o kubebuilder "https://go.kubebuilder.io/dl/latest/${TARGETOS}/${TARGET sudo mv kubebuilder /usr/local/bin/ # Install Github CLI -type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y) curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ From d82aeb1ae0d65d846e432c3e1452f9df7b6a50fc Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Thu, 15 Feb 2024 16:50:21 -0500 Subject: [PATCH 04/19] add the vscode chmod Signed-off-by: Carlos Santana --- .devcontainer/postCreateCommand.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 5a915877..6cb4b061 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -27,6 +27,10 @@ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo && sudo apt update \ && sudo apt install gh -y +# Make sure go path is owned by vscode +sudo chown -R vscode:vscode /home/vscode/go + + # Setup kubectl and k autocompletion sudo apt install bash-completion printf " From be0ee3f7bcb7ba1275979000232af6540bf35812 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Sat, 17 Feb 2024 13:16:26 -0500 Subject: [PATCH 05/19] improve decontainer script Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 5 +-- .devcontainer/postCreateCommand.sh | 68 +++++++++++++++++------------- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0570356d..abaf910a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/go:1": { - "version": "1.21" + "version": "1.22" }, "ghcr.io/devcontainers/features/node:1": { "version": "20" @@ -13,9 +13,6 @@ "forwardPorts": [ 8443 ], - "hostRequirements": { - "cpus": 4 - }, "postCreateCommand": ".devcontainer/postCreateCommand.sh", "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/cnoe-io/idpbuilder,type=bind", "workspaceFolder": "/home/vscode/go/src/github.com/cnoe-io/idpbuilder", diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 6cb4b061..95ae615f 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,42 +1,50 @@ #!/usr/bin/env sh -set -eux -TARGETOS=linux TARGETARCH=amd64 # Install Kind -curl -L -o kind "https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-${TARGETARCH}" && chmod +x ./kind -sudo mv ./kind /usr/local/bin +if ! command -v kubectl &> /dev/null; then + echo "kind not found in PATH, installing" + curl -sL -o kind "https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-${TARGETARCH}" && chmod +x ./kind + sudo mv ./kind /usr/local/bin +fi # Install kubectl -curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl && chmod +x ./kubectl -sudo mv ./kubectl /usr/local/bin +if ! command -v kubectl &> /dev/null; then + echo "kubectl not found in PATH, installing" + curl -sLO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl && chmod +x ./kubectl + sudo mv ./kubectl /usr/local/bin + # Setup kubectl and k autocompletion + sudo apt update + sudo apt install bash-completion -y + printf " + source <(kubectl completion bash) + alias k=kubectl + complete -F __start_kubectl k + " >> $HOME/.bashrc +fi # Install helm -bash -c "curl -s https://get.helm.sh/helm-v3.14.1-linux-${TARGETARCH}.tar.gz > helm3.tar.gz" && tar -zxvf helm3.tar.gz linux-${TARGETARCH}/helm && chmod +x linux-${TARGETARCH}/helm -sudo mv linux-${TARGETARCH}/helm /usr/local/bin && rm helm3.tar.gz && rm -R linux-${TARGETARCH} - -# Install kubebuilder -curl -L -o kubebuilder "https://go.kubebuilder.io/dl/latest/${TARGETOS}/${TARGETARCH}" && chmod +x kubebuilder -sudo mv kubebuilder /usr/local/bin/ - -# Install Github CLI -curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ -&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ -&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ -&& sudo apt update \ -&& sudo apt install gh -y +if ! command -v helm &> /dev/null; then + set -e + echo "helm not found in PATH, installing" + bash -c "curl -s https://get.helm.sh/helm-v3.14.1-linux-${TARGETARCH}.tar.gz > helm3.tar.gz" && tar -zxvf helm3.tar.gz linux-${TARGETARCH}/helm && chmod +x linux-${TARGETARCH}/helm + sudo mv linux-${TARGETARCH}/helm /usr/local/bin && rm helm3.tar.gz && rm -R linux-${TARGETARCH} +fi + + +# Install Github CLI when using ubuntu +if ! command -v gh &> /dev/null; then + . /etc/os-release + if [ "$ID" = "ubuntu" ]; then + echo "Installing Github CLI" + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ + && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && sudo apt update \ + && sudo apt install gh -y + fi +fi # Make sure go path is owned by vscode sudo chown -R vscode:vscode /home/vscode/go - - -# Setup kubectl and k autocompletion -sudo apt install bash-completion -printf " -source <(kubectl completion bash) -alias k=kubectl -complete -F __start_kubectl k -" >> $HOME/.bashrc - - From c427b810155764fb77781d82eb1cb7d975ae42e7 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Sat, 17 Feb 2024 15:16:04 -0500 Subject: [PATCH 06/19] set the version of go to 1.21 Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index abaf910a..8975bc16 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,7 +2,7 @@ "image": "mcr.microsoft.com/vscode/devcontainers/base:ubuntu", "features": { "ghcr.io/devcontainers/features/go:1": { - "version": "1.22" + "version": "1.21" }, "ghcr.io/devcontainers/features/node:1": { "version": "20" From 915d5e3875b83d30f8c23252fe30992145ce15b1 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Sat, 17 Feb 2024 17:14:44 -0500 Subject: [PATCH 07/19] compile idbbuilder on bootstrap Signed-off-by: Carlos Santana --- .devcontainer/postCreateCommand.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 95ae615f..baf79c61 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -48,3 +48,10 @@ fi # Make sure go path is owned by vscode sudo chown -R vscode:vscode /home/vscode/go + +# Compile idpbuilder +echo "Compiling idpbuilder" +export PATH=$PATH:/usr/local/go/bin +make build +# Add idpbuilder to PATH +echo "export PATH=\$PATH:/home/vscode/go/src/github.com/cnoe-io/idpbuilder" >> $HOME/.bashrc From ce8666b5b84425659f71a0b1930b2b29707d2fc0 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Sat, 17 Feb 2024 17:17:03 -0500 Subject: [PATCH 08/19] remove node and python Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8975bc16..1779b898 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,11 +4,7 @@ "ghcr.io/devcontainers/features/go:1": { "version": "1.21" }, - "ghcr.io/devcontainers/features/node:1": { - "version": "20" - }, - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, - "ghcr.io/devcontainers/features/python:1": {} + "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, "forwardPorts": [ 8443 From bc83fdbe962bc88715c2cf64aab8e3620ba8a8ee Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Sat, 17 Feb 2024 20:13:57 -0500 Subject: [PATCH 09/19] remove forwardPorts as they don't work on codespaces Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1779b898..dc04f99e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,9 +6,6 @@ }, "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, - "forwardPorts": [ - 8443 - ], "postCreateCommand": ".devcontainer/postCreateCommand.sh", "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/cnoe-io/idpbuilder,type=bind", "workspaceFolder": "/home/vscode/go/src/github.com/cnoe-io/idpbuilder", From 62424f5284794c9ec9216b97bbcba71841eacdcb Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Tue, 20 Feb 2024 11:06:40 -0500 Subject: [PATCH 10/19] simplify codespaces setup Signed-off-by: Carlos Santana --- .devcontainer/postCreateCommand.sh | 56 ++++-------------------------- 1 file changed, 7 insertions(+), 49 deletions(-) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index baf79c61..c99ab0ba 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,57 +1,15 @@ #!/usr/bin/env sh -TARGETARCH=amd64 +curl -sLS https://get.arkade.dev | sudo sh -# Install Kind -if ! command -v kubectl &> /dev/null; then - echo "kind not found in PATH, installing" - curl -sL -o kind "https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-${TARGETARCH}" && chmod +x ./kind - sudo mv ./kind /usr/local/bin -fi - -# Install kubectl -if ! command -v kubectl &> /dev/null; then - echo "kubectl not found in PATH, installing" - curl -sLO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl && chmod +x ./kubectl - sudo mv ./kubectl /usr/local/bin - # Setup kubectl and k autocompletion - sudo apt update - sudo apt install bash-completion -y - printf " - source <(kubectl completion bash) - alias k=kubectl - complete -F __start_kubectl k - " >> $HOME/.bashrc -fi - -# Install helm -if ! command -v helm &> /dev/null; then - set -e - echo "helm not found in PATH, installing" - bash -c "curl -s https://get.helm.sh/helm-v3.14.1-linux-${TARGETARCH}.tar.gz > helm3.tar.gz" && tar -zxvf helm3.tar.gz linux-${TARGETARCH}/helm && chmod +x linux-${TARGETARCH}/helm - sudo mv linux-${TARGETARCH}/helm /usr/local/bin && rm helm3.tar.gz && rm -R linux-${TARGETARCH} -fi - - -# Install Github CLI when using ubuntu -if ! command -v gh &> /dev/null; then - . /etc/os-release - if [ "$ID" = "ubuntu" ]; then - echo "Installing Github CLI" - curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \ - && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && sudo apt update \ - && sudo apt install gh -y - fi -fi +arkade get kind +arkade get kubectl +arkade get helm +arkade get gh +echo "export PATH=\$PATH:/home/vscode/.arkade/bin" >> $HOME/.bashrc # Make sure go path is owned by vscode sudo chown -R vscode:vscode /home/vscode/go -# Compile idpbuilder -echo "Compiling idpbuilder" -export PATH=$PATH:/usr/local/go/bin -make build -# Add idpbuilder to PATH +# Add idpbuilder to path echo "export PATH=\$PATH:/home/vscode/go/src/github.com/cnoe-io/idpbuilder" >> $HOME/.bashrc From 30f1d9db241fe74267b00cea587b5e855cb82660 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Tue, 20 Feb 2024 13:47:05 -0500 Subject: [PATCH 11/19] setup port 8443 Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 8 ++++++++ .devcontainer/postCreateCommand.sh | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dc04f99e..8d7f528a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,5 +12,13 @@ "remoteEnv": { "PATH": "${containerEnv:PATH}:/home/vscode/go/bin", "GOPATH": "/home/vscode/go" + }, + "forwardPorts": [8443], + "portsAttributes": { + "8443": { + "label": "CNOE", + "onAutoForward": "notify", + "protocol": "http" + } } } \ No newline at end of file diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index c99ab0ba..20c2c907 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -13,3 +13,9 @@ sudo chown -R vscode:vscode /home/vscode/go # Add idpbuilder to path echo "export PATH=\$PATH:/home/vscode/go/src/github.com/cnoe-io/idpbuilder" >> $HOME/.bashrc + +# setup autocomplete for kubectl and alias k +echo "source <(kubectl completion bash)" >> $HOME/.bashrc +echo "alias k=kubectl" >> $HOME/.bashrc +echo "complete -F __start_kubectl k" >> $HOME/.bashrc + From 965f2a0cd615c8e4b719698bc4fff243364b242f Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Tue, 20 Feb 2024 13:47:17 -0500 Subject: [PATCH 12/19] add protocol to empty for 8443 Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8d7f528a..4e8a1914 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,7 @@ "8443": { "label": "CNOE", "onAutoForward": "notify", - "protocol": "http" + "protocol": "" } } } \ No newline at end of file From 615c1b73e9669b2df9cdedf6dec8624b358b4784 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Tue, 20 Feb 2024 16:32:28 -0500 Subject: [PATCH 13/19] try http protocol Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4e8a1914..8d7f528a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,7 +18,7 @@ "8443": { "label": "CNOE", "onAutoForward": "notify", - "protocol": "" + "protocol": "http" } } } \ No newline at end of file From f948909695c4f4f0b9923461a9d493042e1c0672 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Tue, 20 Feb 2024 17:35:38 -0500 Subject: [PATCH 14/19] remove port Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8d7f528a..dc04f99e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,13 +12,5 @@ "remoteEnv": { "PATH": "${containerEnv:PATH}:/home/vscode/go/bin", "GOPATH": "/home/vscode/go" - }, - "forwardPorts": [8443], - "portsAttributes": { - "8443": { - "label": "CNOE", - "onAutoForward": "notify", - "protocol": "http" - } } } \ No newline at end of file From c682b5da3dd6f21bf374631e6283b92d20941f1a Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Thu, 29 Feb 2024 03:16:19 +0000 Subject: [PATCH 15/19] remove extras Signed-off-by: Carlos Santana --- .devcontainer/postCreateCommand.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 20c2c907..e349972e 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -5,7 +5,6 @@ curl -sLS https://get.arkade.dev | sudo sh arkade get kind arkade get kubectl arkade get helm -arkade get gh echo "export PATH=\$PATH:/home/vscode/.arkade/bin" >> $HOME/.bashrc # Make sure go path is owned by vscode @@ -15,6 +14,7 @@ sudo chown -R vscode:vscode /home/vscode/go echo "export PATH=\$PATH:/home/vscode/go/src/github.com/cnoe-io/idpbuilder" >> $HOME/.bashrc # setup autocomplete for kubectl and alias k +mkdir $HOME/.kube echo "source <(kubectl completion bash)" >> $HOME/.bashrc echo "alias k=kubectl" >> $HOME/.bashrc echo "complete -F __start_kubectl k" >> $HOME/.bashrc From 415d12ae9419c39e8e7371127728a6519b16bab5 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Thu, 29 Feb 2024 14:29:15 -0500 Subject: [PATCH 16/19] changes based on feedback Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 3 +-- .devcontainer/postCreateCommand.sh | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index dc04f99e..aca382c5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -10,7 +10,6 @@ "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/cnoe-io/idpbuilder,type=bind", "workspaceFolder": "/home/vscode/go/src/github.com/cnoe-io/idpbuilder", "remoteEnv": { - "PATH": "${containerEnv:PATH}:/home/vscode/go/bin", - "GOPATH": "/home/vscode/go" + "PATH": "${containerEnv:PATH}:/home/vscode/go/bin" } } \ No newline at end of file diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index e349972e..b9b8d38e 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,18 +1,22 @@ -#!/usr/bin/env sh +#!/usr/bin/env bash -curl -sLS https://get.arkade.dev | sudo sh +# For Kubectl AMD64 / x86_64 +[ $(uname -m) = x86_64 ] && curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" +# For Kubectl ARM64 +[ $(uname -m) = aarch64 ] && curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl" +chmod +x ./kubectl +sudo mv ./kubectl /usr/local/bin/kubectl -arkade get kind -arkade get kubectl -arkade get helm -echo "export PATH=\$PATH:/home/vscode/.arkade/bin" >> $HOME/.bashrc +# For Kind AMD64 / x86_64 +[ $(uname -m) = x86_64 ] && curl -sLo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64 +# For Kind ARM64 +[ $(uname -m) = aarch64 ] && curl -sLo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-arm64 +chmod +x ./kind +sudo mv ./kind /usr/local/bin/kind # Make sure go path is owned by vscode sudo chown -R vscode:vscode /home/vscode/go -# Add idpbuilder to path -echo "export PATH=\$PATH:/home/vscode/go/src/github.com/cnoe-io/idpbuilder" >> $HOME/.bashrc - # setup autocomplete for kubectl and alias k mkdir $HOME/.kube echo "source <(kubectl completion bash)" >> $HOME/.bashrc From 9cc24db887ee39201103fe5c2db867bc9ad1f172 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Mon, 4 Mar 2024 11:13:59 -0500 Subject: [PATCH 17/19] simplify devcontainer based on feedback Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 6 +----- .devcontainer/postCreateCommand.sh | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index aca382c5..d953d34a 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,9 +7,5 @@ "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, "postCreateCommand": ".devcontainer/postCreateCommand.sh", - "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/go/src/github.com/cnoe-io/idpbuilder,type=bind", - "workspaceFolder": "/home/vscode/go/src/github.com/cnoe-io/idpbuilder", - "remoteEnv": { - "PATH": "${containerEnv:PATH}:/home/vscode/go/bin" - } + "workspaceFolder": "/home/vscode/idpbuilder" } \ No newline at end of file diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index b9b8d38e..a209da06 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -14,9 +14,6 @@ sudo mv ./kubectl /usr/local/bin/kubectl chmod +x ./kind sudo mv ./kind /usr/local/bin/kind -# Make sure go path is owned by vscode -sudo chown -R vscode:vscode /home/vscode/go - # setup autocomplete for kubectl and alias k mkdir $HOME/.kube echo "source <(kubectl completion bash)" >> $HOME/.bashrc From d7812ed1ef005cedf44719aa53d30f18adcc18f9 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Mon, 4 Mar 2024 11:21:59 -0500 Subject: [PATCH 18/19] fix EOLs Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 2 +- .devcontainer/postCreateCommand.sh | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d953d34a..3a5a6591 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -8,4 +8,4 @@ }, "postCreateCommand": ".devcontainer/postCreateCommand.sh", "workspaceFolder": "/home/vscode/idpbuilder" -} \ No newline at end of file +} diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index a209da06..3e1808a8 100755 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -19,4 +19,3 @@ mkdir $HOME/.kube echo "source <(kubectl completion bash)" >> $HOME/.bashrc echo "alias k=kubectl" >> $HOME/.bashrc echo "complete -F __start_kubectl k" >> $HOME/.bashrc - From fcabffe765158b140618e610175819d1a04a88c3 Mon Sep 17 00:00:00 2001 From: Carlos Santana Date: Mon, 4 Mar 2024 11:34:48 -0500 Subject: [PATCH 19/19] add /workspace/idpbuilder Signed-off-by: Carlos Santana --- .devcontainer/devcontainer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3a5a6591..f38df91f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,5 +7,6 @@ "ghcr.io/devcontainers/features/docker-in-docker:2": {} }, "postCreateCommand": ".devcontainer/postCreateCommand.sh", - "workspaceFolder": "/home/vscode/idpbuilder" + "workspaceFolder": "/home/vscode/idpbuilder", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/vscode/idpbuilder,type=bind" }