Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Podman scripts for Registry-Operator Makefile #61

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@ You can tag Devfile Registry related issues with the `/area registry` text in yo
3. Open the folder in the IDE of your choice (VS Code with Go extension, or GoLand is recommended)

#### Build and Run the Operator
The Makefile currently supports both Docker and Podman. To run the proper command replace `<engine>` with either `podman` or `docker` depending on your container engine.
1. Log in to an OpenShift or Kubernetes cluster

2. Run `export IMG=<operator-image>` where `<operator-image>` is the image repository to where you would like to push the image (e.g. `quay.io/user/registry-operator:latest`).

3. Run `make docker-build` to build the devfile registry operator.
3. Run `make <engine>-build` to build the devfile registry operator.

4. Run `make docker-push` to push the devfile registry operator image.
4. Run `make <engine>-push` to push the devfile registry operator image.

5. (Optional, **docker only**) Run `make docker-buildx` to build and push the devfile registry operator multi-architecture image
5. (Optional, **docker only**) Run `make docker-buildx` to build and push the devfile registry operator multi-architecture image.

6. Run `make install-cert` to install the cert-manager.
6. Run `make install-cert` to install the cert-manager. (Allow time for these services to spin up before moving on to step 7 & 8).

7. Run `make install` to install the CRDs.

Expand Down
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ docker-buildx: test ## Build and push docker image for the manager for cross-pla
- docker buildx rm registry-operator-builder
rm Dockerfile.cross

# Build the podman image
.PHONY: podman-build
podman-build:
podman build . -t ${IMG} --build-arg ENABLE_WEBHOOKS=${ENABLE_WEBHOOKS}

# Push the podman image
.PHONY: podman-push
podman-push:
podman push ${IMG}


.PHONY: install-cert
install-cert: ## Install cert manager for webhooks
$(K8S_CLI) apply -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MANAGER_VERSION)/cert-manager.yaml
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ Some of the rules supported by the makefile:
|---|---|
| controller-gen | install the controller-gen tool, used by other commands |
| kustomize | install the kustomize tool, used by other commands |
| docker-build | build registry operator docker image |
| docker-push | push registry operator docker image |
| docker-buildx | build & push registry operator docker image for all supported architectures \(**does not work with podman**\) |
| docker-build | build registry operator container image using docker |
| docker-push | push registry operator container image using docker |
| docker-buildx | build & push registry operator docker image for all supported architectures |
| podman-build | build registry operator container image using podman |
| podman-push | push registry operator container image using podman |
| deploy | deploy operator to cluster |
| undeploy | undeploy operator from cluster |
| install | create the devfile registry CRDs on the cluster |
Expand Down Expand Up @@ -101,7 +103,7 @@ define the environment variable `K8S_CLI` with the command you prefer to use.

By default, the tests will use the default image for the operator, `quay.io/devfile/registry-operator:next`.

You can use `make docker-build` to build your own image, `make docker-push` to publish it. Then, to use your own image, run:
You can use `make <engine>-build` to build your own image, `make <engine>-push` to publish it - Replace `<engine>` with `podman` or `docker`. Then, to use your own image, run:

```
IMG=<your-operator-image> make test-integration
Expand Down
Loading