diff options
author | Ritu Sood <ritu.sood@intel.com> | 2021-10-26 22:39:48 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-10-26 22:39:48 +0000 |
commit | 82f9c8ed3bf558081a5b61a6162f260847f578b6 (patch) | |
tree | 95f520a8357aec29cdd48b375ef0b18b3d3bc1e0 /src/k8splugin/internal/rb | |
parent | ed96bca7fe415f1636d82c26af15d7474bdfe876 (diff) | |
parent | 3f0da55c0183e9da2f4658308dee1915338266aa (diff) |
Merge "Fix resolution of values for Config API"
Diffstat (limited to 'src/k8splugin/internal/rb')
-rw-r--r-- | src/k8splugin/internal/rb/profile.go | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/k8splugin/internal/rb/profile.go b/src/k8splugin/internal/rb/profile.go index 77398580..ac90a63b 100644 --- a/src/k8splugin/internal/rb/profile.go +++ b/src/k8splugin/internal/rb/profile.go @@ -279,6 +279,25 @@ func (v *ProfileClient) Download(rbName, rbVersion, prName string) ([]byte, erro return nil, pkgerrors.New("Error downloading Profile content") } +//GetYamlClient GEt Yaml Files client for profile +func (v *ProfileClient) GetYamlClient(rbName string, rbVersion string, profileName string) (ProfileYamlClient, error) { + prData, err := v.Download(rbName, rbVersion, profileName) + if err != nil { + return ProfileYamlClient{}, pkgerrors.Wrap(err, "Downloading Profile") + } + + prPath, err := ExtractTarBall(bytes.NewBuffer(prData)) + if err != nil { + return ProfileYamlClient{}, pkgerrors.Wrap(err, "Extracting Profile Content") + } + + prYamlClient, err := ProcessProfileYaml(prPath, v.manifestName) + if err != nil { + return ProfileYamlClient{}, pkgerrors.Wrap(err, "Processing Profile Manifest") + } + return prYamlClient, nil +} + //Resolve returns the path where the helm chart merged with //configuration overrides resides and final ReleaseName picked for instantiation func (v *ProfileClient) Resolve(rbName string, rbVersion string, @@ -291,17 +310,7 @@ func (v *ProfileClient) Resolve(rbName string, rbVersion string, //Download and process the profile first //If everything seems okay, then download the definition - prData, err := v.Download(rbName, rbVersion, profileName) - if err != nil { - return sortedTemplates, crdList, hookList, finalReleaseName, pkgerrors.Wrap(err, "Downloading Profile") - } - - prPath, err := ExtractTarBall(bytes.NewBuffer(prData)) - if err != nil { - return sortedTemplates, crdList, hookList, finalReleaseName, pkgerrors.Wrap(err, "Extracting Profile Content") - } - - prYamlClient, err := ProcessProfileYaml(prPath, v.manifestName) + prYamlClient, err := v.GetYamlClient(rbName, rbVersion, profileName) if err != nil { return sortedTemplates, crdList, hookList, finalReleaseName, pkgerrors.Wrap(err, "Processing Profile Manifest") } |