From 53768a14a75d5c7a7eb4d77e240fd59b6cbd2b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arda=20G=C3=BC=C3=A7l=C3=BC?= Date: Mon, 28 Aug 2023 08:36:32 +0300 Subject: [PATCH] Add comment about why AttachFunc be overridable Kubernetes-commit: fa37bebcd4b239cc5ad8eb3899d9868b015b34de --- pkg/cmd/debug/debug.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/cmd/debug/debug.go b/pkg/cmd/debug/debug.go index 72926150..7f6a1d19 100644 --- a/pkg/cmd/debug/debug.go +++ b/pkg/cmd/debug/debug.go @@ -213,6 +213,11 @@ func (o *DebugOptions) Complete(restClientGetter genericclioptions.RESTClientGet attachFlag := cmd.Flags().Lookup("attach") if !attachFlag.Changed && o.Interactive { o.Attach = true + // Downstream tools may want to use their own customized + // attach function to do extra work or use attach command + // with different flags instead of the static one defined in + // handleAttachPod. But if this function is not set explicitly, + // we fall back to default. if o.AttachFunc == nil { o.AttachFunc = o.handleAttachPod }