in deployers/manifestreader.go [67:157]
func (reader *ManifestReader) HandleYaml(manifestParser *parsers.YAMLParser, manifest *parsers.YAML, managedAnnotations whisk.KeyValue) error {
var err error
var manifestName = manifest.Filepath
// pull the package inputs out of Deployment.Packages
// so that they can be sent to all OW entities while they are being parsed and constructed
// the main reason for sending Package inputs (normalized) to parser is
// manifest file can have $TRIGGER_NAME as a trigger name, $RULE_NAME as a rule name, etc
// which are being read by the parser and the way it works is, these variables are
// treated as environment variables and tried to interpolate them but when these
// variables are not defined in env., they are returned as an empty string and we
// loose the env. variable name(TRIGGER_NAME), so before we loose that label,
// we need to substitute it with its corresponding value from the inputs section
inputs := make(map[string]parsers.PackageInputs, 0)
for _, pkg := range reader.serviceDeployer.Deployment.Packages {
inputs[pkg.Package.Name] = pkg.Inputs
}
deps, err := manifestParser.ComposeDependenciesFromAllPackages(manifest, reader.serviceDeployer.ProjectPath, reader.serviceDeployer.ManifestPath, managedAnnotations, inputs)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
actions, err := manifestParser.ComposeActionsFromAllPackages(manifest, reader.serviceDeployer.ManifestPath, managedAnnotations, inputs)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
sequences, err := manifestParser.ComposeSequencesFromAllPackages(reader.serviceDeployer.ClientConfig.Namespace, manifest, reader.serviceDeployer.ManifestPath, managedAnnotations, inputs)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
triggers, err := manifestParser.ComposeTriggersFromAllPackages(manifest, reader.serviceDeployer.ManifestPath, managedAnnotations, inputs)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
rules, err := manifestParser.ComposeRulesFromAllPackages(manifest, managedAnnotations, inputs)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
apis, responses, err := manifestParser.ComposeApiRecordsFromAllPackages(reader.serviceDeployer.ClientConfig, manifest, actions, sequences)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
api, response, err := manifestParser.ComposeApiRecordsFromSwagger(reader.serviceDeployer.ClientConfig, manifest)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetDependencies(deps)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetActions(actions)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetSequences(sequences)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetTriggers(triggers)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetRules(rules)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetApis(apis, responses)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
err = reader.SetSwaggerApi(api, response)
if err != nil {
return wskderrors.NewYAMLFileFormatError(manifestName, err)
}
return nil
}