agent.go 607 B

123456789101112131415161718192021222324252627282930
  1. package helm
  2. import (
  3. "helm.sh/helm/v3/pkg/action"
  4. "helm.sh/helm/v3/pkg/release"
  5. )
  6. // ListReleases lists releases based on a ListFilter
  7. func ListReleases(
  8. actionConfig *action.Configuration,
  9. namespace string,
  10. filter *ListFilter,
  11. ) ([]*release.Release, error) {
  12. cmd := action.NewList(actionConfig)
  13. filter.apply(cmd)
  14. return cmd.Run()
  15. }
  16. // GetRelease returns the info of a release.
  17. func GetRelease(
  18. actionConfig *action.Configuration,
  19. name string,
  20. ) (*release.Release, error) {
  21. // Namespace is already known by the RESTClientGetter.
  22. cmd := action.NewGet(actionConfig)
  23. return cmd.Run(name)
  24. }