forked from cloudfoundry/bosh-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release_set_and_installation_manifest_parser.go
28 lines (22 loc) · 1.21 KB
/
release_set_and_installation_manifest_parser.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cmd
import (
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshtpl "github.com/cloudfoundry/bosh-cli/director/template"
biinstallmanifest "github.com/cloudfoundry/bosh-cli/installation/manifest"
birelsetmanifest "github.com/cloudfoundry/bosh-cli/release/set/manifest"
)
type ReleaseSetAndInstallationManifestParser struct {
ReleaseSetParser birelsetmanifest.Parser
InstallationParser biinstallmanifest.Parser
}
func (y ReleaseSetAndInstallationManifestParser) ReleaseSetAndInstallationManifest(deploymentManifestPath string, vars boshtpl.Variables) (birelsetmanifest.Manifest, biinstallmanifest.Manifest, error) {
releaseSetManifest, err := y.ReleaseSetParser.Parse(deploymentManifestPath, vars)
if err != nil {
return birelsetmanifest.Manifest{}, biinstallmanifest.Manifest{}, bosherr.WrapErrorf(err, "Parsing release set manifest '%s'", deploymentManifestPath)
}
installationManifest, err := y.InstallationParser.Parse(deploymentManifestPath, vars, releaseSetManifest)
if err != nil {
return birelsetmanifest.Manifest{}, biinstallmanifest.Manifest{}, bosherr.WrapErrorf(err, "Parsing installation manifest '%s'", deploymentManifestPath)
}
return releaseSetManifest, installationManifest, nil
}