Skip to content

Commit

Permalink
Merge pull request #2932 from alexeldeib/ace/tiltExtra
Browse files Browse the repository at this point in the history
🏃 allow extra args with tilt
  • Loading branch information
k8s-ci-robot authored Apr 22, 2020
2 parents 99a95aa + 476434e commit 92e71e1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ allow_k8s_contexts(settings.get("allowed_contexts"))
default_registry(settings.get("default_registry"))

always_enable_providers = ["core"]
extra_args = settings.get("extra_args", {})

providers = {
"core": {
Expand Down Expand Up @@ -96,6 +97,7 @@ COPY --from=tilt-helper /go/kubernetes/client/bin/kubectl /usr/bin/kubectl
# }
def load_provider_tiltfiles():
provider_repos = settings.get("provider_repos", [])

for repo in provider_repos:
file = repo + "/tilt-provider.json"
provider_details = read_json(file, default = {})
Expand Down Expand Up @@ -158,12 +160,17 @@ def enable_provider(name):

# Set up an image build for the provider. The live update configuration syncs the output from the local_resource
# build into the container.
entrypoint = ["sh", "/start.sh", "/manager"]
provider_args = extra_args.get(name)
if provider_args:
entrypoint.extend(provider_args)

docker_build(
ref = p.get("image"),
context = context + "/.tiltbuild/",
dockerfile_contents = dockerfile_contents,
target = "tilt",
entrypoint = ["sh", "/start.sh", "/manager"],
entrypoint = entrypoint,
only = "manager",
live_update = [
sync(context + "/.tiltbuild/manager", "/manager"),
Expand Down
22 changes: 22 additions & 0 deletions docs/book/src/developer/tilt.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,28 @@ COPY --from=tilt-helper /usr/bin/docker /usr/bin/docker
COPY --from=tilt-helper /go/kubernetes/client/bin/kubectl /usr/bin/kubectl
```
**extra_args** (Object, default={}): A mapping of provider to additional arguments to pass to the main binary configured
for this provider. Each item in the array will be passed in to the manager.
Example:
```json
{
"extra_args": {
"core": ["--feature-gates=MachinePool=true"],
"kubeadm-bootstrap": ["--feature-gates=MachinePool=true"],
"azure": ["--feature-gates=MachinePool=true"]
}
}
```
With this config, the manager will be invoked with:
```bash
manager --feature-gates=MachinePool=true
```
## Customizing Tilt
If you need to customize Tilt's behavior, you can create files in cluster-api's `tilt.d` directory. This file is ignored
Expand Down

0 comments on commit 92e71e1

Please sign in to comment.