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
14 changes: 12 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def enable_provider(name):
name = p.get("name", name)
context = p.get("context")
go_main = p.get("go_main")
label = p.get("label", name)

# Prefix each live reload dependency with context. For example, for if the context is
# test/infra/docker and main.go is listed as a dep, the result is test/infra/docker/main.go. This adjustment is
Expand All @@ -97,9 +98,10 @@ def enable_provider(name):
# Set up a local_resource build of the provider's manager binary. The provider is expected to have a main.go in
# manager_build_path or the main.go must be provided via go_main option. The binary is written to .tiltbuild/manager.
local_resource(
name + "_manager",
label.lower() + "_binary",
cmd = "cd " + context + ';mkdir -p .tiltbuild;CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags \'-extldflags "-static"\' -o .tiltbuild/manager ' + go_main,
deps = live_reload_deps,
labels = [label, "ALL.binaries"],
)

additional_docker_helper_commands = p.get("additional_docker_helper_commands", "")
Expand Down Expand Up @@ -139,9 +141,17 @@ def enable_provider(name):
os.environ.update(substitutions)

# Apply the kustomized yaml for this provider
yaml = str(kustomizesub(context + "/config"))
yaml = str(kustomizesub(context + "/config/tls"))
k8s_yaml(blob(yaml))

manager_name = p.get("manager_name")
if manager_name:
k8s_resource(
workload = manager_name,
new_name = label.lower() + "_controller",
labels = [label, "ALL.controllers"],
)

def kustomizesub(folder):
yaml = local('kustomize build {}'.format(folder), quiet=True)
return yaml
Expand Down
14 changes: 11 additions & 3 deletions tilt-provider.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{
"name": "metal3-bmo",
"config": {
"kustomize_config": false,
"image": "quay.io/metal3-io/baremetal-operator",
"live_reload_deps": [
"apis", "cmd", "pkg", "config", "controllers", "go.mod", "go.sum", "main.go"
]
"apis",
"cmd",
"pkg",
"config",
"controllers",
"go.mod",
"go.sum",
"main.go"
],
"label": "BMO",
"manager_name": "baremetal-operator-controller-manager"
}
}