func LoadChart(opts Options) (*chart.Chart, error) {
	tmpDir, err := ioutil.TempDir("", "osdk-helm-chart")
	if err != nil {
		return nil, err
	}
	defer func() {
		if err := os.RemoveAll(tmpDir); err != nil {
			log.Errorf("Failed to remove temporary directory %s: %v", tmpDir, err)
		}
	}()
	chartPath := opts.Chart
	if _, err := os.Stat(opts.Chart); err != nil {
		chartPath, err = downloadChart(tmpDir, opts)
		if err != nil {
			return nil, err
		}
	}
	return loader.Load(chartPath)
}
LoadChart creates a new helm chart for the project based on the passed opts.
It returns a chart.Chart that references the newly created chart or an error.

If opts.Chart is a local file, it verifies that it is a valid helm chart
archive and returns its chart.Chart representation.

If opts.Chart is a local directory, it verifies that it is a valid helm chart
directory and returns its chart.Chart representation.

For any other value of opts.Chart, it attempts to fetch the helm chart from a
remote repository.

If opts.Repo is not specified, the following chart reference formats are supported:

- <repoName>/<chartName>: Fetch the helm chart named chartName from the helm
chart repository named repoName, as specified in the
$HELM_HOME/repositories/repositories.yaml file.

- <url>: Fetch the helm chart archive at the specified URL.

If opts.Repo is specified, only one chart reference format is supported:

- <chartName>: Fetch the helm chart named chartName in the helm chart repository
specified by opts.Repo

If opts.Version is not set, it will fetch the latest available version of the helm
chart. Otherwise, it will fetch the specified version.
opts.Version is not used when opts.Chart itself refers to a specific version, for
example when it is a local path or a URL.
package chartutil
import (
	"bytes"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	log "github.com/sirupsen/logrus"
	"helm.sh/helm/v3/pkg/chart"
	"helm.sh/helm/v3/pkg/chart/loader"
	"helm.sh/helm/v3/pkg/chartutil"
	"helm.sh/helm/v3/pkg/cli"
	"helm.sh/helm/v3/pkg/downloader"
	"helm.sh/helm/v3/pkg/getter"
	"helm.sh/helm/v3/pkg/repo"
)
const (
	HelmChartsDir = "helm-charts"
)
type Options struct {
	Chart string
	Repo string
	Version string
}
func NewChart(name string) (*chart.Chart, error) {
	tmpDir, err := ioutil.TempDir("", "osdk-helm-chart")
	if err != nil {
		return nil, err
	}
	defer func() {
		if err := os.RemoveAll(tmpDir); err != nil {
			log.Errorf("Failed to remove temporary directory %s: %v", tmpDir, err)
		}
	}()
	chartPath, err := chartutil.Create(name, tmpDir)
	if err != nil {
		return nil, err
	}
	return loader.Load(chartPath)
}