diff --git a/pkg/action/hooks.go b/pkg/action/hooks.go index b1e8e1d66..021a563c3 100644 --- a/pkg/action/hooks.go +++ b/pkg/action/hooks.go @@ -199,7 +199,7 @@ func (cfg *Configuration) outputLogsByPolicy(h *release.Hook, releaseNamespace s func (cfg *Configuration) outputContainerLogsForListOptions(namespace string, listOptions metav1.ListOptions) error { // TODO Helm 4: Remove this check when GetPodList and OutputContainerLogsForPodList are moved from InterfaceExt to Interface - if kubeClient, ok := cfg.KubeClient.(kube.InterfaceExt); ok { + if kubeClient, ok := cfg.KubeClient.(kube.InterfaceLogs); ok { podList, err := kubeClient.GetPodList(namespace, listOptions) if err != nil { return err diff --git a/pkg/action/hooks_test.go b/pkg/action/hooks_test.go index 76de9e505..0f4a9be34 100644 --- a/pkg/action/hooks_test.go +++ b/pkg/action/hooks_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/assert" - "helm.sh/helm/v3/pkg/chart" - kubefake "helm.sh/helm/v3/pkg/kube/fake" - "helm.sh/helm/v3/pkg/release" + "helm.sh/helm/v4/pkg/chart" + kubefake "helm.sh/helm/v4/pkg/kube/fake" + "helm.sh/helm/v4/pkg/release" ) func podManifestWithOutputLogs(hookDefinitions []release.HookOutputLogPolicy) string { diff --git a/pkg/kube/interface.go b/pkg/kube/interface.go index 4d295f560..f701690e3 100644 --- a/pkg/kube/interface.go +++ b/pkg/kube/interface.go @@ -68,13 +68,18 @@ type Interface interface { IsReachable() error } -// InterfaceExt is introduced to avoid breaking backwards compatibility for Interface implementers. +// InterfaceExt was introduced to avoid breaking backwards compatibility for Interface implementers. // // TODO Helm 4: Remove InterfaceExt and integrate its method(s) into the Interface. type InterfaceExt interface { // WaitForDelete wait up to the given timeout for the specified resources to be deleted. WaitForDelete(resources ResourceList, timeout time.Duration) error +} +// InterfaceLogs was introduced to avoid breaking backwards compatibility for Interface implementers. +// +// TODO Helm 4: Remove InterfaceLogs and integrate its method(s) into the Interface. +type InterfaceLogs interface { // GetPodList list all pods that match the specified listOptions GetPodList(namespace string, listOptions metav1.ListOptions) (*v1.PodList, error) @@ -86,7 +91,7 @@ type InterfaceExt interface { // // TODO Helm 4: Remove InterfaceDeletionPropagation and integrate its method(s) into the Interface. type InterfaceDeletionPropagation interface { - // Delete destroys one or more resources. The deletion propagation is handled as per the given deletion propagation value. + // DeleteWithPropagationPolicy destroys one or more resources. The deletion propagation is handled as per the given deletion propagation value. DeleteWithPropagationPolicy(resources ResourceList, policy metav1.DeletionPropagation) (*Result, []error) } @@ -114,5 +119,6 @@ type InterfaceResources interface { var _ Interface = (*Client)(nil) var _ InterfaceExt = (*Client)(nil) +var _ InterfaceLogs = (*Client)(nil) var _ InterfaceDeletionPropagation = (*Client)(nil) var _ InterfaceResources = (*Client)(nil)