Enable Go artifact repositories
Configure Go to use a module proxy by setting environment variables in your workspaces.
Prerequisites
-
You are not running any Go workspace.
|
Applying a ConfigMap that sets environment variables might cause a workspace boot loop. If you encounter this behavior, remove the |
Procedure
-
Create a Secret to store the TLS certificate:
kind: Secret apiVersion: v1 metadata: name: tls-cer annotations: controller.devfile.io/mount-path: /home/user/certs controller.devfile.io/mount-as: file labels: controller.devfile.io/mount-to-devworkspace: 'true' controller.devfile.io/watch-secret: 'true' data: tls.cer: >- <Base64_encoded_content_of_public_cert> (1)1 Base64 encoding with disabled line wrapping. -
Create a ConfigMap to set the following environment variables in the
toolscontainer:kind: ConfigMap apiVersion: v1 metadata: name: disconnected-env annotations: controller.devfile.io/mount-as: env labels: controller.devfile.io/mount-to-devworkspace: 'true' controller.devfile.io/watch-configmap: 'true' data: GOPROXY: >- http://<athens_proxy_route> SSL_CERT_FILE: /home/user/certs/tls.cer