Skip to content

Commit

Permalink
Merge pull request #1065 from lack/ztp/bug2073439_fix_ztp_container_e…
Browse files Browse the repository at this point in the history
…xtract

Bug 2073439: ztp: Disable podman logging when extracting container data
  • Loading branch information
openshift-merge-robot authored Apr 8, 2022
2 parents 1198448 + a2124e0 commit 4b9e429
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ztp/gitops-subscriptions/argocd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Create a GIT repository for hosting site configuration data. The ZTP pipeline wi
2. Export the argocd directory from the ztp-site-generator container image by executing the following commands:
```
$ mkdir -p ./out
$ podman run --rm ztp-site-generator:latest extract /home/ztp --tar | tar x -C ./out
$ podman run --rm --log-driver=none ztp-site-generator:latest extract /home/ztp --tar | tar x -C ./out
```
3. Check the out directory that created above. It contains the following sub directories
- out/extra-manifest: contains the source CRs files that SiteConfig uses to generate extra manifest configMap.
Expand Down
4 changes: 2 additions & 2 deletions ztp/resource-generator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ build: ## Build the ZTP image

export: ## Copy resources from container image to out/ directory
mkdir -p out
podman run --rm ${IMAGE_NAME}:${VERSION} extract /home/ztp --tar | tar x -C out
podman run --rm --log-driver=none ${IMAGE_NAME}:${VERSION} extract /home/ztp --tar | tar x -C out
mkdir -p out/kustomize
podman run --rm ${IMAGE_NAME}:${VERSION} extract /kustomize --tar | tar x -C out/kustomize
podman run --rm --log-driver=none ${IMAGE_NAME}:${VERSION} extract /kustomize --tar | tar x -C out/kustomize

all: build export
2 changes: 1 addition & 1 deletion ztp/resource-generator/entrypoints/entrypoints
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ template and example distribution
You can export these templates and examples by running the following commands:
$ podman run --rm ztp-site-generator:latest extract /home/ztp --tar | tar x -C ./out
$ podman run --rm --log-driver=none ztp-site-generator:latest extract /home/ztp --tar | tar x -C ./out
extract
-------
Expand Down
7 changes: 5 additions & 2 deletions ztp/resource-generator/entrypoints/extract
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ if [[ $1 == "-h" || $1 == "--help" || $1 == "help" ]]; then
echo " $(basename $0) srcPath --tar"
echo " Export the given directory structure to stdout as a tar stream (should be redirected)"
echo " Example:"
echo " podman run \$THIS_CONTAINER $(basename $0) /home/ztp --tar | tar -C ./out"
echo " podman run --rm --log-driver=none \$THIS_CONTAINER $(basename $0) /home/ztp --tar | tar -C ./out"
echo
echo " Important: With podman, add '--log-driver=none' to prevent podman from hanging with large data sent to stdout,"
echo " and '--rm' to avoid creating unneeded persistent container image"
echo
echo " $(basename $0) srcPath dstPath"
echo " Export the given directory structure to the destination path (should be mounted as a container volume)"
echo " Example:"
echo " podman run \$THIS_CONTAINER -v ./out:/out:Z $(basename $0) /home/ztp /out"
echo " podman run --rm \$THIS_CONTAINER -v ./out:/out:Z $(basename $0) /home/ztp /out"
exit 1
fi

Expand Down

0 comments on commit 4b9e429

Please sign in to comment.