Skip to content

Commit 4c53baa

Browse files
authored
Update CONTRIBUTING.md (#1495)
* chore: explain MacOs specific `make` issue Signed-off-by: Oleksii Kurinnyi <[email protected]> * chore: make linter happy Signed-off-by: Oleksii Kurinnyi <[email protected]> * fixup! chore: explain MacOs specific `make` issue Signed-off-by: Oleksii Kurinnyi <[email protected]> --------- Signed-off-by: Oleksii Kurinnyi <[email protected]>
1 parent 6f01ac3 commit 4c53baa

File tree

1 file changed

+42
-6
lines changed

1 file changed

+42
-6
lines changed

CONTRIBUTING.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ Owners of the repository will watch out for and review new PRs.
2929

3030
If comments have been given in a review, they have to be addressed before merging.
3131

32-
After addressing review comments, dont forget to add a comment in the PR afterward, so everyone gets notified by Github and knows to re-review.
32+
After addressing review comments, don't forget to add a comment in the PR afterward, so everyone gets notified by Github and knows to re-review.
3333

3434
## CI
3535

36-
#### GitHub actions
36+
### GitHub actions
3737

3838
- [Next Dockerimage](https://github.com/devfile/devworkspace-operator/blob/main/.github/workflows/dockerimage-next.yml) action builds main branch and pushes it to [quay.io/devfile/devworkspace-controller:next](https://quay.io/repository/devfile/devworkspace-controller?tag=latest&tab=tags)
3939
- [Code Coverage Report](./.github/workflows/code-coverage.yml) action creates a code coverage report using [codecov.io](https://about.codecov.io/).
@@ -50,14 +50,34 @@ To build, test and debug the DevWorkspace Operator the following development too
5050
- git
5151
- sed
5252
- jq
53-
- yq (python-yq from https://github.com/kislyuk/yq#installation, other distributions may not work)
53+
- yq (python-yq from <https://github.com/kislyuk/yq#installation>, other distributions may not work)
5454
- skopeo (if building the OLM catalogsource)
5555
- podman or docker
5656

5757
Note: kustomize `v4.0.5` is required for most tasks. It is downloaded automatically to the `.kustomize` folder in this
5858
repo when required. This downloaded version is used regardless of whether or not kustomize is already installed on the
5959
system.
6060

61+
#### macOS Specific Issues
62+
63+
On macOS, the default `make` utility might be outdated, leading to issues with some `Makefile` targets. To resolve this, it's recommended to install a newer version of `make` using Homebrew and ensure it's prioritized in your system's `$PATH`.
64+
65+
> Note: `make` version `4.4.1` has been tested and confirmed to resolve these issues.
66+
67+
1. Install Homebrew `make`:
68+
69+
```bash
70+
brew install make
71+
```
72+
73+
2. Add the Homebrew `make` executable to your `$PATH` by adding the following line to your shell configuration file (e.g., `~/.zshrc`, `~/.bash_profile`):
74+
75+
```bash
76+
export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH"
77+
```
78+
79+
After adding, reload your shell configuration (e.g., `source ~/.zshrc` or `source ~/.bash_profile`) or open a new terminal session.
80+
6181
### Makefile
6282

6383
The repository contains a `Makefile`; building and deploying can be configured via the environment variables:
@@ -88,13 +108,16 @@ To see all rules supported by the makefile, run `make help`
88108

89109
1. Fork [devfile/devworkspce-operator](https://github.com/devfile/devworkspace-operator) and clone your fork locally
90110
2. Export the `DWO_IMG` environment variable. For example:
111+
91112
```bash
92113
export DWO_IMG=quay.io/mloriedo/devworkspace-controller:dev
93114
```
115+
94116
:warning: _You need write privileges on this container registry repository. The DevWorkspace controller image will be
95117
pushed there during build._
96118
3. If your changes include some update to the Devfile or DevWorkspace schema set some environment variables and run
97119
`go mod` to point to your fork instead of devfile/api:
120+
98121
```bash
99122
export DEVFILE_API_REPO=github.com/l0rd/api # <== your devfile/api fork
100123
export DEVFILE_API_BRANCH=my-branch-name # <== the branch of your fork
@@ -103,17 +126,23 @@ pushed there during build._
103126
go mod download && \
104127
go mod tidy
105128
```
129+
106130
4. Build the controller go code, build the container image and publish it to the container registry:
131+
107132
```bash
108133
make docker
109134
```
135+
110136
5. Install cert-manager (can be skipped on OpenShift):
137+
111138
```bash
112139
make install_cert_manager && \
113140
kubectl wait --for=condition=Available -n cert-manager deployment/cert-manager
114141
```
142+
115143
6. Finally deploys the CRDs and the controller to the current cluster:
116-
```
144+
145+
```bash
117146
make install # <== this command copies the CRDs definition
118147
# creates the namespace for the controller in the cluster
119148
# downloads and runs kustomize to build the manifests
@@ -140,7 +169,8 @@ make run
140169
```
141170
142171
> Note: The operator requires internet access from containers to work. By default, `crc setup` may not provision this, so it's necessary to configure DNS for Docker:
143-
> ```
172+
>
173+
> ```text
144174
> # /etc/docker/daemon.json
145175
> {
146176
> "dns": ["192.168.0.1"]
@@ -191,26 +221,32 @@ make disconnect-debug-webhook-server
191221
make update_devworkspace_api update_devworkspace_crds # first commit
192222
make generate_all # second commit
193223
```
224+
194225
Example of the devfile API update [PR](https://github.com/devfile/devworkspace-operator/pull/797)
195226

196227
### Remove controller from your K8s/OS Cluster
228+
197229
To uninstall the controller and associated CRDs, use the Makefile uninstall rule:
230+
198231
```bash
199232
make uninstall
200233
```
234+
201235
This will delete all custom resource definitions created for the controller, as well as the `devworkspace-controller` namespace.
202236

203237
### Build a custom OLM bundle
204238

205239
In order to build a custom bundle, the following environment variables should be set:
240+
206241
| variable | purpose | default value |
207242
|---|---|---|
208243
| `DWO_BUNDLE_IMG` | Image used for Operator bundle image | `quay.io/devfile/devworkspace-operator-bundle:next` |
209244
| `DWO_INDEX_IMG` | Image used for Operator index image | `quay.io/devfile/devworkspace-operator-index:next` |
210245
| `DEFAULT_DWO_IMG` | Image used for controller when generating defaults | `quay.io/devfile/devworkspace-controller:next` |
211246

212247
To build the index image and register its catalogsource to the cluster, run
213-
```
248+
249+
```bash
214250
make generate_olm_bundle_yaml build_bundle_and_index register_catalogsource
215251
```
216252

0 commit comments

Comments
 (0)