diff --git a/ztp/siteconfig-generator-kustomize-plugin/testSiteConfig/testUserExtraManifest/00-emptymanifest.yaml b/ztp/siteconfig-generator-kustomize-plugin/testSiteConfig/testUserExtraManifest/00-emptymanifest.yaml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go b/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go index 4fd5b6c9b7..d352ed8462 100644 --- a/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go +++ b/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go @@ -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 @@ -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