Skip to content

Commit a3b01ab

Browse files
committed
Update Makefile and Add Testing Info
Update the Makefile to allow users to build the image with their changes using podman. Update the Readme to add instructions on how to test changes. Signed-off-by: Urvashi <[email protected]>
1 parent 6adc373 commit a3b01ab

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ include $(addprefix ./vendor/github.com/openshift/build-machinery-go/make/, \
99

1010
IMAGE_REGISTRY :=registry.ci.openshift.org
1111

12+
# Check which builder to use - default is imagebuilder
13+
ifeq ($(BUILDER), podman)
14+
# Use podman to build the must gather image
15+
# Please ensure you have podman installed on your machine for this
16+
IMAGE_BUILD_BUILDER := podman build
17+
# Clear all build default flags
18+
IMAGE_BUILD_DEFAULT_FLAGS :=
19+
# Set authfile if the user passes another location for the authentication file
20+
ifneq ($(strip $(AUTH_FILE)),)
21+
IMAGE_BUILD_DEFAULT_FLAGS := --authfile=$(AUTH_FILE)
22+
endif
23+
endif
24+
25+
1226
# This will call a macro called "build-image" which will generate image specific targets based on the parameters:
1327
# $0 - macro name
1428
# $1 - target name

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,23 @@ included.
1515
You can run `must-gather` on a cluster with `oc adm must-gather`.
1616
Use `-h` flag to see available options.
1717

18+
## How to test
19+
Build a new must-gather image with your changes using the Makefile. There are two options in the Makefile, `make` will use imagebuilder to build the image while `make BUILDER=podman` will use podman to build the image.
20+
21+
If using `make BUILDER=podman`, please set the `AUTH_FILE` parameter pointing to an authentication file that has credentials for the `registry.ci.openshift.org` registry. Ensure that you are connected to the VPN before building the image.
22+
```
23+
make BUILDER=podman AUTH_FILE=/path/to/authfile
24+
```
25+
26+
Once the image is built, push it to a registry where it can be accessed from.
27+
```
28+
podman push [built-image] [registry/username/your-built-image]
29+
```
30+
31+
To test your new changes with a cluster, run the following:
32+
```
33+
oc adm must-gather --image=registry/username/your-built-image
34+
```
35+
1836
## Obfuscate confidential information
1937
There is a dedicated effort to obfuscate and omit confidential information. Head over to [openshift/must-gather-clean](https://github.com/openshift/must-gather-clean) for more information.

0 commit comments

Comments
 (0)