Skip to content

Commit

Permalink
Merge pull request #2101 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…2052-to-release-4.17

[release-4.17] OCPBUGS-44252: ztp: empty file in sitegen kustomize plugin
  • Loading branch information
openshift-merge-bot[bot] authored Nov 6, 2024
2 parents e1ca95c + 9d236c6 commit abdbef0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ func (scbuilder *SiteConfigBuilder) getExtraManifestMaps(roles map[string]bool,
if err != nil {
errStr := fmt.Sprintf("Error could not read WorkloadManifest %s %s\n", clusterSpec.ClusterName, err)
return dataMap, doNotMerge, errors.New(errStr)
} else {
} else if v.(string) != "" {
data, err := addZTPAnnotationToManifest(v.(string))
if err != nil {
return dataMap, doNotMerge, err
Expand Down Expand Up @@ -670,11 +670,13 @@ func (scbuilder *SiteConfigBuilder) getExtraManifest(dataMap map[string]interfac
return dataMap, err
}

manifestFileStr, err := addZTPAnnotationToManifest(string(manifestFile))
if err != nil {
return dataMap, err
if len(manifestFile) != 0 {
manifestFileStr, err := addZTPAnnotationToManifest(string(manifestFile))
if err != nil {
return dataMap, err
}
dataMap[file.Name()] = manifestFileStr
}
dataMap[file.Name()] = manifestFileStr

// user provided CRs don't need to be merged
doNotMerge[file.Name()] = true
Expand Down

0 comments on commit abdbef0

Please sign in to comment.