1
0
containerized-data-importer/manifest-build-fix.patch

37 lines
2.0 KiB
Diff

Fix build of tools/manifest-generator via build-manifests.sh
tools/manifest-generator/manifest-generator.go can be build with
build-go.sh, but fails when built with build-manifests.sh
./hack/build/build-manifests.sh
manifest-generator.go:22:2: cannot find package "k8s.io/apimachinery/pkg/runtime" in any of:
/usr/lib64/go/1.13/src/k8s.io/apimachinery/pkg/runtime (from $GOROOT)
/home/abuild/rpmbuild/BUILD/containerized-data-importer-1.30.0/go/src/k8s.io/apimachinery/pkg/runtime (from $GOPATH)
manifest-generator.go:23:2: cannot find package "k8s.io/klog/v2" in any of:
/usr/lib64/go/1.13/src/k8s.io/klog/v2 (from $GOROOT)
/home/abuild/rpmbuild/BUILD/containerized-data-importer-1.30.0/go/src/k8s.io/klog/v2 (from $GOPATH)
This hack fixes it by removing GO111MODULE=off. We'll need to verify if
this is a proper fix.
Index: containerized-data-importer-1.30.0/hack/build/build-manifests.sh
===================================================================
--- containerized-data-importer-1.30.0.orig/hack/build/build-manifests.sh
+++ containerized-data-importer-1.30.0/hack/build/build-manifests.sh
@@ -20,7 +20,7 @@ source "${script_dir}"/config.sh
generator="${BIN_DIR}/manifest-generator"
-(cd "${CDI_DIR}/tools/manifest-generator/" && GO111MODULE=off go build -o "${generator}" ./...)
+(cd "${CDI_DIR}/tools/manifest-generator/" && go build -o "${generator}" ./...)
echo "DOCKER_PREFIX=${DOCKER_PREFIX}"
echo "DOCKER_TAG=${DOCKER_TAG}"
@@ -41,4 +41,4 @@ processDirTemplates ${tempDir} ${OUT_DIR
processDirTemplates ${tempDir}/release ${OUT_DIR}/manifests/release ${OUT_DIR}/manifests/templates/release ${generator} ${MANIFEST_GENERATED_DIR}
testsManifestsDir=${CDI_DIR}/tests/manifests
-processDirTemplates ${testsManifestsDir}/templates ${testsManifestsDir}/out ${testsManifestsDir}/out/templates ${generator} ${MANIFEST_GENERATED_DIR}
\ No newline at end of file
+processDirTemplates ${testsManifestsDir}/templates ${testsManifestsDir}/out ${testsManifestsDir}/out/templates ${generator} ${MANIFEST_GENERATED_DIR}