-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
4.16
-
None
This is a clone of issue OCPBUGS-39149. The following is the description of the original issue:
—
Description of problem:
Creating an empty file in the extra-manifest folder results in the ztp site-config generator to panic
Version-Release number of selected component (if applicable):
ztp-site-generate-rhel8:v4.16
How reproducible:
always
Steps to Reproduce:
Here is a simple shell script to reproduce the problem
#!/bin/bash OCP_VER=v4.16 SI=${PWD}/site-install TEST_SC_DIR=test-siteconfig SITECONFIG=example-sno.yaml SRC_SC_DIR=./out/argocd/example/siteconfig if [ -d ./out ]; then sudo rm -Rf ./out fi mkdir ./out if [ -d ${SI} ]; then sudo rm -Rf ${SI} fi mkdir ${SI} if [ -d ${TEST_SC_DIR} ]; then sudo rm -Rf ${TEST_SC_DIR} fi mkdir ${TEST_SC_DIR} podman run --log-driver=none --rm registry.redhat.io/openshift4/ztp-site-generate-rhel8:${OCP_VER} extract /home/ztp --tar | tar x -C ./out if [ ! -f ${SRC_SC_DIR}/${SITECONFIG} ] ; then echo "ERROR: ${SRC_SC_DIR}/${SITECONFIG} not found" exit 1 fi cp ${SRC_SC_DIR}/${SITECONFIG} ${TEST_SC_DIR}/${SITECONFIG} cp -a ./out/extra-manifest ${TEST_SC_DIR}/ mkdir ${TEST_SC_DIR}/custom-manifest # Comment out this line to allow the ztp generate to succeed touch ${TEST_SC_DIR}/extra-manifest/test.yaml if [ ! -f ${TEST_SC_DIR}/${SITECONFIG} ] ; then echo "ERROR: ${TEST_SC_DIR}/${SITECONFIG} not found" exit 2 fi sed -ie '/networkType: "OVNKubernetes"/a\ \ \ \ extraManifests:' ${TEST_SC_DIR}/${SITECONFIG} sed -ie '/extraManifests:/a\ \ \ \ \ \ searchPaths:' ${TEST_SC_DIR}/${SITECONFIG} sed -ie '/searchPaths:/a\ \ \ \ \ \ \ \ - extra-manifest\/' ${TEST_SC_DIR}/${SITECONFIG} sed -ie '/- extra-manifest/a\ \ \ \ \ \ \ \ - custom-manifest\/' ${TEST_SC_DIR}/${SITECONFIG} podman run -it --rm \ -v ${PWD}/${TEST_SC_DIR}:/resources:Z \ -v ${PWD}/site-install:/output:Z,U \ registry.redhat.io/openshift4/ztp-site-generate-rhel8:${OCP_VER} \ generator install ${SITECONFIG} /output
Actual results:
Processing SiteConfigs: /resources/example-sno.yaml Generating installation CRs into /output ... panic: assignment to entry in nil map goroutine 1 [running]: github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.addZTPAnnotation(0x309bb10?, {0x0, 0x0, 0x199c8e0?}) /go/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigHelper.go:219 +0x8f github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.addZTPAnnotationToManifest({0x0, 0x0}) /go/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigHelper.go:260 +0x125 github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getExtraManifestMaps(_, _, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0, 0x0}, {0x0, ...}, ...}, ...) /go/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:546 +0x9a5 github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).getClusterCRs(0xc0006ebe58, 0x0, {{0xc000045e30, 0x13}, {0xc0001287c4, 0xa}, {{0xc000128800, 0xb}, {0xc000128830, 0xb}, ...}, ...}) /go/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:132 +0x1c5 github.com/openshift-kni/cnf-features-deploy/ztp/siteconfig-generator/siteConfig.(*SiteConfigBuilder).Build(0x1?, {{0xc000045e30, 0x13}, {0xc0001287c4, 0xa}, {{0xc000128800, 0xb}, {0xc000128830, 0xb}, 0x0}, ...}) /go/src/cnf-features-deploy/ztp/siteconfig-generator/siteConfig/siteConfigBuilder.go:79 +0x2c5 main.main() /go/src/cnf-features-deploy/ztp/siteconfig-generator/main.go:59 +0x4a5 Error: failed to generate installation CRs
Expected results:
siteConfig is rendered into output manifests
Additional info:
- blocks
-
OCPBUGS-42068 ZTP siteconfig-generator panics if an empty file exists in the extra-manifest directory
- ASSIGNED
- is blocked by
-
OCPBUGS-39149 ZTP siteconfig-generator panics if an empty file exists in the extra-manifest directory
- Verified
- is cloned by
-
OCPBUGS-42068 ZTP siteconfig-generator panics if an empty file exists in the extra-manifest directory
- ASSIGNED
-
OCPBUGS-44252 ZTP siteconfig-generator panics if an empty file exists in the extra-manifest directory
- Verified
- links to
- mentioned on