Skip to content
Open
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
3 changes: 2 additions & 1 deletion graduated/helm/lib/EntrypointScriptBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, env):
self.chart = env.get('CHART_JSON')
self.helm_version = env.get('HELM_VERSION')
self.azure_helm_token = None
self.skip_kubectl_config_init = env.get('SKIP_KUBECTL_CONFIG_INIT')

# Save chart data in files
if not self.chart is None:
Expand Down Expand Up @@ -173,7 +174,7 @@ def _get_azure_service_principal_helm_token(self, repo_url):

def _build_kubectl_commands(self):
lines = []
if self.action in ['install', 'promotion', 'auth']:
if self.action in ['install', 'promotion', 'auth'] and not self.skip_kubectl_config_init:
if self.kube_context is None:
raise Exception('Must set KUBE_CONTEXT in environment (Name of Kubernetes cluster as named in Codefresh)')
kubectl_cmd = 'kubectl config use-context "%s"' % self.kube_context
Expand Down
6 changes: 5 additions & 1 deletion graduated/helm/step.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ spec:
"chart_subdir": {
"type": "string",
"description": "optional subfolder (inside JFrog Artifactory helm repository)"
}
},
"skip_kubectl_config_init": {
"type": "boolean",
"description": "Don't run kubectl config use-context <context>"
},
}
}
stepsTemplate: |-
Expand Down