todo: removed InterfaceExt

Signed-off-by: hagar31 <harshit.agarwal12@aexp.com>
pull/13446/head
hagar31 11 months ago
parent a9187bd41c
commit bd6da53d76

@ -22,7 +22,6 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"helm.sh/helm/v3/pkg/kube"
"helm.sh/helm/v3/pkg/release" "helm.sh/helm/v3/pkg/release"
helmtime "helm.sh/helm/v3/pkg/time" helmtime "helm.sh/helm/v3/pkg/time"
) )
@ -139,10 +138,8 @@ func (cfg *Configuration) deleteHookByPolicy(h *release.Hook, policy release.Hoo
} }
//wait for resources until they are deleted to avoid conflicts //wait for resources until they are deleted to avoid conflicts
if kubeClient, ok := cfg.KubeClient.(kube.InterfaceExt); ok { if err := cfg.KubeClient.WaitForDelete(resources, timeout); err != nil {
if err := kubeClient.WaitForDelete(resources, timeout); err != nil { return err
return err
}
} }
} }
return nil return nil

@ -131,10 +131,8 @@ func (u *Uninstall) Run(name string) (*release.UninstallReleaseResponse, error)
res.Info = kept res.Info = kept
if u.Wait { if u.Wait {
if kubeClient, ok := u.cfg.KubeClient.(kube.InterfaceExt); ok { if err := u.cfg.KubeClient.WaitForDelete(deletedResources, u.Timeout); err != nil {
if err := kubeClient.WaitForDelete(deletedResources, u.Timeout); err != nil { errs = append(errs, err)
errs = append(errs, err)
}
} }
} }

@ -70,12 +70,7 @@ type Interface interface {
// IsReachable checks whether the client is able to connect to the cluster. // IsReachable checks whether the client is able to connect to the cluster.
IsReachable() error IsReachable() error
}
// InterfaceExt is 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 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
} }
@ -111,6 +106,5 @@ type InterfaceResources interface {
} }
var _ Interface = (*Client)(nil) var _ Interface = (*Client)(nil)
var _ InterfaceExt = (*Client)(nil)
var _ InterfaceDeletionPropagation = (*Client)(nil) var _ InterfaceDeletionPropagation = (*Client)(nil)
var _ InterfaceResources = (*Client)(nil) var _ InterfaceResources = (*Client)(nil)

Loading…
Cancel
Save