You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then, now you are able to test and use the operator-sdk build using the source code.
22
+
20
23
## Testing
21
24
22
25
The SDK includes many tests that are run as part of CI.
@@ -36,6 +39,79 @@ $ make test
36
39
For more information on running testing and correctly configuring your environment,
37
40
refer to the [`Running the Tests Locally`][running-the-tests] document.
38
41
42
+
To run the lint checks done in the CI locally, run:
43
+
44
+
```sh
45
+
$ make lint
46
+
```
47
+
48
+
**NOTE** Note that for it is required to install `golangci-lint` locally. For more info see its [doc](https://github.com/golangci/golangci-lint#install)
49
+
50
+
## How to test the changes done for Ansible/Helm based-operator projects?
51
+
52
+
If the change performed is NOT in the scaffold files or sdk commands then, is required to build an new image with the changes done to test it locally. In this way, by using this dev image in an operator project locally we will be able to check the changes made for the Ansible/Helm based-operator.
53
+
54
+
### For Ansible
55
+
56
+
- Update the `ANSIBLE_BASE_IMAGE` var in the [Makefile][makefile] to generate an image for your repository (quay.io or docker.hub.io). See:
57
+
58
+
Replace:
59
+
60
+
```
61
+
quay.io/operator-framework/ansible-operator
62
+
```
63
+
64
+
With (eg):
65
+
66
+
```
67
+
quay.io/my-repo-user/ansible-operator
68
+
```
69
+
70
+
- Build the image locally by running `make image-build-ansible`
71
+
- Push your new image. (E.g `docker push quay.io/my-repo-user/ansible-operator:dev`)
72
+
73
+
**NOTE** Ensure that you configured the repo, `quay.io/my-repo-user/ansible-operator`, to be public.
74
+
75
+
- Update the `Dockerfile` of your POC project to test your changes with the new image as follows.
76
+
77
+
```
78
+
FROM quay.io/my-repo-user/ansible-operator:dev
79
+
80
+
COPY watches.yaml ${HOME}/watches.yaml
81
+
COPY roles/ ${HOME}/roles/
82
+
```
83
+
84
+
### For Helm
85
+
86
+
87
+
- Update the `HELM_BASE_IMAGE` var in the [Makefile][makefile] to generate an image for your repository (quay.io or docker.hub.io). See:
88
+
89
+
Replace:
90
+
91
+
```
92
+
quay.io/operator-framework/helm-operator
93
+
```
94
+
95
+
With (eg):
96
+
97
+
```
98
+
quay.io/my-repo-user/helm-operator
99
+
```
100
+
101
+
- Build the image locally by running `make image-build-helm`
102
+
- Push your new image. (E.g `docker push quay.io/my-repo-user/helm-operator:dev`)
103
+
104
+
**NOTE** Ensure that you configured the repo, `quay.io/my-repo-user/helm-operator`, to be public.
105
+
106
+
- Update the `Dockerfile` of your POC project to test your changes with the new image as follows.
107
+
108
+
```
109
+
FROM quay.io/my-repo-user/helm-operator:dev
110
+
111
+
COPY watches.yaml ${HOME}/watches.yaml
112
+
COPY helm-charts/ ${HOME}/helm-charts/
113
+
```
114
+
39
115
See the project [README][sdk-readme] for more details.
40
116
41
117
[git-tool]:https://git-scm.com/downloads
@@ -46,3 +122,4 @@ See the project [README][sdk-readme] for more details.
0 commit comments