some-restaurant-1855
04/16/2024, 8:02 PMhelm_deployment target, and while the field itself is added to the target, i am not sure how to make the underlying target use that field.
more concretely, I'm adding kubeconfig as a arg like:
# file pants-plugins/internal/helm_args/register.py
from pants.backend.helm.target_types import HelmDeploymentTarget
from pants.engine.target import StringField
class KubeconfigFileField(StringField):
alias = "kubeconfig"
default = "$HOME/.kube/kind-config"
help = "which config file to use"
def rules():
return [HelmDeploymentTarget.register_plugin_field(KubeconfigFileField)]
and when running:
PANTS_HELM_ARGS="--kubeconfig=$HOME/.kube/kind-config" pants experimental-deploy <helm_target>
it works as expected; when running
pants experimental-deploy model_builder/infra/mzai:local --keep-sandboxes=always
it doesn't.
a few questions:
• how do i see the command that pants is using to run helm? -ldebug doesn't seem to work?
• is this the expected use for extending targets?broad-processor-92400
04/16/2024, 10:46 PM-ldebug or looking at the __run.sh command in the relevant sandbox to be two mechanisms to see the underlying command.
2. For extending targets:
a. As you observe, adding a field to a target doesn't automatically mean the rules that interact with the target (like the deploy ones) will use it.
b. The usual use case is something like the black Python formatter: that backend adds a skip_black field to python_... targets, and the formatting rules in the black backend itself read that field, while "base" python backend doesn't need to care about it.
Maybe @careful-address-89803 has some advice about helm specifically?some-restaurant-1855
04/16/2024, 10:56 PMcareful-address-89803
04/17/2024, 5:11 PMcareful-address-89803
04/17/2024, 5:15 PMsome-restaurant-1855
04/17/2024, 5:46 PMsome-restaurant-1855
04/17/2024, 5:46 PM