From ad28192ea6f1d91b51b0d0f09a46e64997b727ed Mon Sep 17 00:00:00 2001 From: Evan Johnson Date: Wed, 24 Jan 2024 12:55:54 -0500 Subject: [PATCH] ensure all resources are categorized in the Tiltfile and limit docker build file watchers to go files --- Tiltfile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Tiltfile b/Tiltfile index 572bdd468..4cec7014f 100644 --- a/Tiltfile +++ b/Tiltfile @@ -1,4 +1,4 @@ -docker_build("controller", ".") +docker_build("controller", ".", only=("vendor","go.mod", "go.sum", "./api", "./cloud","./cmd", "./controller", "./util")) local_resource( 'capi-controller-manager', @@ -6,3 +6,24 @@ local_resource( ) k8s_yaml(kustomize('config/default')) + +# get generated secret name so we can categorize it +token_secret_name = str(local('kustomize build config/default | grep -m1 "name: cluster-api-provider-linode-token-"', quiet=True, echo_off=True)).split()[1] + +k8s_resource( + workload="cluster-api-provider-linode-controller-manager", + objects=[ + "cluster-api-provider-linode-system:namespace", + "linodeclusters.infrastructure.cluster.x-k8s.io:customresourcedefinition", + "linodemachines.infrastructure.cluster.x-k8s.io:customresourcedefinition", + "cluster-api-provider-linode-controller-manager:serviceaccount", + "cluster-api-provider-linode-leader-election-role:role", + "cluster-api-provider-linode-manager-role:clusterrole", + "cluster-api-provider-linode-metrics-reader:clusterrole", + "cluster-api-provider-linode-proxy-role:clusterrole", + "cluster-api-provider-linode-leader-election-rolebinding:rolebinding", + "cluster-api-provider-linode-manager-rolebinding:clusterrolebinding", + "cluster-api-provider-linode-proxy-rolebinding:clusterrolebinding", + "%s:secret" % token_secret_name + ] +)