Update based on review comments

Signed-off-by: Chris Berry <bez625@gmail.com>
pull/10309/head
Chris Berry 8 months ago
parent a55a477069
commit 3d4e679d9f

@ -199,7 +199,7 @@ func (cfg *Configuration) outputLogsByPolicy(h *release.Hook, releaseNamespace s
func (cfg *Configuration) outputContainerLogsForListOptions(namespace string, listOptions metav1.ListOptions) error { 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 // 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) podList, err := kubeClient.GetPodList(namespace, listOptions)
if err != nil { if err != nil {
return err return err

@ -24,9 +24,9 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v4/pkg/chart"
kubefake "helm.sh/helm/v3/pkg/kube/fake" kubefake "helm.sh/helm/v4/pkg/kube/fake"
"helm.sh/helm/v3/pkg/release" "helm.sh/helm/v4/pkg/release"
) )
func podManifestWithOutputLogs(hookDefinitions []release.HookOutputLogPolicy) string { func podManifestWithOutputLogs(hookDefinitions []release.HookOutputLogPolicy) string {

@ -68,13 +68,18 @@ type Interface interface {
IsReachable() error 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. // TODO Helm 4: Remove InterfaceExt and integrate its method(s) into the Interface.
type InterfaceExt interface { type InterfaceExt interface {
// WaitForDelete wait up to the given timeout for the specified resources to be deleted. // WaitForDelete wait up to the given timeout for the specified resources to be deleted.
WaitForDelete(resources ResourceList, timeout time.Duration) error 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 list all pods that match the specified listOptions
GetPodList(namespace string, listOptions metav1.ListOptions) (*v1.PodList, error) 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. // TODO Helm 4: Remove InterfaceDeletionPropagation and integrate its method(s) into the Interface.
type InterfaceDeletionPropagation 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) DeleteWithPropagationPolicy(resources ResourceList, policy metav1.DeletionPropagation) (*Result, []error)
} }
@ -114,5 +119,6 @@ type InterfaceResources interface {
var _ Interface = (*Client)(nil) var _ Interface = (*Client)(nil)
var _ InterfaceExt = (*Client)(nil) var _ InterfaceExt = (*Client)(nil)
var _ InterfaceLogs = (*Client)(nil)
var _ InterfaceDeletionPropagation = (*Client)(nil) var _ InterfaceDeletionPropagation = (*Client)(nil)
var _ InterfaceResources = (*Client)(nil) var _ InterfaceResources = (*Client)(nil)

Loading…
Cancel
Save