Skip to content

Commit cb9160c

Browse files
authored
docs: Document new verification routines (#38)
Signed-off-by: Oliver Gondža <ogondza@gmail.com>
1 parent 0f5d6b0 commit cb9160c

6 files changed

Lines changed: 37 additions & 574 deletions

File tree

README.md

Lines changed: 37 additions & 160 deletions
Original file line numberDiff line numberDiff line change
@@ -22,179 +22,56 @@ You will get a dump of:
2222
- Logs of Argo CD
2323
- Warning and error-level Events
2424

25-
In addition to that, we will get a summary of:
25+
To get data about other parts of the cluster (not specific to [gitops-operator](https://github.com/redhat-developer/gitops-operator/)), run `oc adm must-gather` (without passing a custom image).
26+
Run `oc adm must-gather -h` to see more options.
2627

27-
- All executed commands: `must-gather-script-commands.txt`
28-
- Errors: `must-gather-script-errors.txt`
29-
- Commands that produced no output: `must-gather-script-no-output.txt`
28+
## Development
3029

31-
All the output of the commands is stored into 3 different formats:
30+
Make sure you run `make lint` before pushing new changes.
31+
This requires `shellcheck` to be installed in your machine.
32+
33+
For more information about `building` and `pushing` the image, see `make help`.
34+
35+
### Image publishing
3236

33-
- `*.txt` that represents the normal view without any structure.
34-
- `*.yaml` that is the YAML output of the command.
35-
- `*.json` that is the JSON output of the command.
37+
CD images are pushed to the following destinations, from where they can be used for testing:
3638

37-
In order to get data about other parts of the cluster (not specific to gitops-operator) you should run just `oc adm must-gather` (without passing a custom image). Run `oc adm must-gather -h` to see more options.
39+
- HEAD of the `main` branch: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/gitops-must-gather:latest
40+
- PRs: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/gitops-must-gather:on-pr-<GIT_COMMIT_SHA>
41+
- `main` branch: quay.io/redhat-user-workloads/rh-openshift-gitops-tenant/gitops-must-gather:<GIT_COMMIT_SHA>
3842

39-
An example of the GitOps must-gather output would be something like the following, where there are two argocd instances in namespaces `openshift-gitops` and `foo` and an additional namespace called `foo-managed` which is managed by namespace `foo`:
43+
Custom image can be pushed, too:
4044

4145
```shell
42-
cluster-gitops
43-
└── gitops
44-
├── clusterversion.txt
45-
├── crds
46-
│ ├── crds.json/.txt./.yaml
47-
├── managedNamespace_foo-managed
48-
│ └── resources
49-
│ ├── deployments
50-
│ ├── pods
51-
│ ├── replicasets
52-
│ ├── routes
53-
│ ├── services
54-
│ └── statefulsets
55-
├── namespace_foo_resources
56-
│ ├── argocd
57-
│ │ ├── applications
58-
│ │ │ ├── applications.json/.txt./.yaml
59-
│ │ │ └── guestbook.yaml
60-
│ │ ├── applicationsets
61-
│ │ │ ├── applicationsets.txt
62-
│ │ │ ├── guestbook.json
63-
│ │ │ ├── guestbook.txt
64-
│ │ │ └── guestbook.yaml
65-
│ │ ├── argocd.json
66-
│ │ ├── argocd.txt
67-
│ │ ├── argocd.yaml
68-
│ │ ├── logs
69-
│ │ │ └── server-logs.txt
70-
│ │ ├── managed-namespaces.txt
71-
│ │ └── sourceNamespaces.txt
72-
│ ├── deployments
73-
│ │ ├── argocd-dex-server.json/.txt./.yaml
74-
│ │ ├── argocd-redis.json/.txt./.yaml
75-
│ │ ├── argocd-repo-server.json/.txt./.yaml
76-
│ │ ├── argocd-server.json/.txt./.yaml
77-
│ │ └── deployments.txt
78-
│ ├── events
79-
│ │ ├── all-events.txt
80-
│ │ └── warning-events.txt
81-
│ ├── pods
82-
│ │ ├── argocd-application-controller-0.json/.txt./.yaml
83-
│ │ ├── argocd-dex-server-69f99bdd45-g84b9.json/.txt./.yaml
84-
│ │ ├── argocd-dex-server-6d4f7d9d48-rkk9d.json/.txt./.yaml
85-
│ │ ├── argocd-redis-78d4849f68-pxxbp.json/.txt./.yaml
86-
│ │ ├── argocd-repo-server-6cfc8bbd5f-w4bsg.json/.txt./.yaml
87-
│ │ ├── argocd-server-5dc69475bf-98m6s.json/.txt./.yaml
88-
│ │ └── pods.txt
89-
│ ├── replicaSets
90-
│ │ ├── argocd-dex-server-69f99bdd45.json/.txt./.yaml
91-
│ │ ├── argocd-dex-server-6d4f7d9d48.json/.txt./.yaml
92-
│ │ ├── argocd-redis-78d4849f68.json/.txt./.yaml
93-
│ │ ├── argocd-repo-server-6cfc8bbd5f.json/.txt./.yaml
94-
│ │ ├── argocd-server-5dc69475bf.json/.txt./.yaml
95-
│ │ └── replicaSets.txt
96-
│ ├── routes
97-
│ │ ├── argocd-server.json/.txt./.yaml
98-
│ │ └── routes.txt
99-
│ ├── services
100-
│ │ ├── argocd-dex-server.json/.txt./.yaml
101-
│ │ ├── argocd-metrics.json/.txt./.yaml
102-
│ │ ├── argocd-redis.json/.txt./.yaml
103-
│ │ ├── argocd-repo-server.json/.txt./.yaml
104-
│ │ ├── argocd-server.json/.txt./.yaml
105-
│ │ ├── argocd-server-metrics.json/.txt./.yaml
106-
│ │ └── services.txt
107-
│ └── statefulsets
108-
│ ├── argocd-application-controller.json/.txt./.yaml
109-
│ └── statefulsets.txt
110-
├── namespace_openshift-gitops_resources
111-
│ ├── argocd
112-
│ │ ├── applications
113-
│ │ ├── applicationsets
114-
│ │ ├── appprojects
115-
│ │ ├── appprojects.json/.txt./.yaml
116-
│ │ ├── argocd.txt
117-
│ │ ├── logs
118-
│ │ │ ├── application-controller-logs.txt
119-
│ │ │ ├── dex-server-logs.txt
120-
│ │ │ ├── redis-logs.txt
121-
│ │ │ ├── repo-server-logs.txt
122-
│ │ │ └── server-logs.txt
123-
│ │ ├── openshift-gitops.json
124-
│ │ ├── openshift-gitops.txt
125-
│ │ ├── openshift-gitops.yaml
126-
│ │ └── sourceNamespaces.txt
127-
│ ├── deployments
128-
│ │ ├── cluster.json/.txt./.yaml
129-
│ │ ├── deployments.txt
130-
│ │ ├── kam.json
131-
│ │ ├── kam.txt
132-
│ │ ├── kam.yaml
133-
│ │ ├── openshift-gitops-applicationset-controller.json/.txt./.yaml
134-
│ │ ├── openshift-gitops-dex-server.json/.txt./.yaml
135-
│ │ ├── openshift-gitops-redis.json/.txt./.yaml
136-
│ │ ├── openshift-gitops-repo-server.json/.txt./.yaml
137-
│ │ ├── openshift-gitops-server.json/.txt./.yaml
138-
│ ├── events
139-
│ ├── pods
140-
│ │ ├── cluster-5db4b95547-mks98.json/.txt./.yaml
141-
│ │ ├── kam-fff7f474f-t875v.json/.txt./.yaml
142-
│ │ ├── openshift-gitops-application-controller-0.json/.txt./.yaml
143-
│ │ ├── openshift-gitops-applicationset-controller-5dbdfcc689-6x4vf.json/.txt./.yaml
144-
│ │ ├── openshift-gitops-dex-server-5bf6f4f684-ghtqf.json/.txt./.yaml
145-
│ │ ├── openshift-gitops-redis-664cdd4757-f9jcc.json/.txt./.yaml
146-
│ │ ├── openshift-gitops-repo-server-6795d6d8cd-x7hzc.json/.txt./.yaml
147-
│ │ ├── openshift-gitops-server-6cc58f9cc8-fx8g7.json/.txt./.yaml
148-
│ │ └── pods.txt
149-
│ ├── replicaSets
150-
│ │ ├── cluster-5db4b95547.json/.txt./.yaml
151-
│ │ ├── kam-fff7f474f.json/.txt./.yaml
152-
│ │ ├── openshift-gitops-applicationset-controller-5dbdfcc689.json/.txt./.yaml
153-
│ │ ├── openshift-gitops-dex-server-5bf6f4f684.json/.txt./.yaml
154-
│ │ ├── openshift-gitops-dex-server-684c85d5d7.json/.txt./.yaml
155-
│ │ ├── openshift-gitops-redis-664cdd4757.json/.txt./.yaml
156-
│ │ ├── openshift-gitops-repo-server-6795d6d8cd.json/.txt./.yaml
157-
│ │ ├── openshift-gitops-server-6cc58f9cc8.json/.txt./.yaml
158-
│ │ └── replicaSets.txt
159-
│ ├── routes
160-
│ │ ├── kam.json/.txt./.yaml
161-
│ │ ├── openshift-gitops-server.json/.txt./.yaml
162-
│ │ └── routes.txt
163-
│ ├── services
164-
│ │ ├── cluster.json/.txt./.yaml
165-
│ │ ├── kam.json/.txt./.yaml
166-
│ │ ├── openshift-gitops-applicationset-controller.json/.txt./.yaml
167-
│ │ ├── openshift-gitops-dex-server.json/.txt./.yaml
168-
│ │ ├── openshift-gitops-metrics.json/.txt./.yaml
169-
│ │ ├── openshift-gitops-redis.json/.txt./.yaml
170-
│ │ ├── openshift-gitops-repo-server.json/.txt./.yaml
171-
│ │ ├── openshift-gitops-server.json/.txt./.yaml
172-
│ │ ├── openshift-gitops-server-metrics.json/.txt./.yaml
173-
│ │ └── services.txt
174-
│ └── statefulsets
175-
│ ├── openshift-gitops-application-controller.json/.txt./.yaml
176-
│ └── statefulsets.txt
177-
├── oc-version.txt
178-
├── subscription.json/.txt./.yaml
179-
├── must-gather-script-commands.txt
180-
├── must-gather-script-no-output.txt
181-
└── must-gather-script-errors.txt
46+
# You may need to create the repository on quay.io manually to make sure it is public
47+
make REGISTRY_USERNAME=my-non-production-org CONTAINER_IMAGE_TAG=latest push
18248
```
183-
Note: most of the resource outputs are given in 3 file types: `.json`, `.yaml`, and `.txt`, however those files are combined in this tree for clarity and conciseness.
49+
It is recomanded to use `latest` tag for development, because it does not get cached on OpenShift nodes - other tags might.
18450

18551
## Testing
18652

187-
To do that you need an OpenShift cluster, and you will have to install the Red Hat GitOps Operator.
188-
Then you can test how your changes affects gathered data:
53+
Create the OpenShift cluster, log in and install the Red Hat GitOps Operator.
18954

55+
For the development version, use:
19056
```shell
191-
# You may need to create the repository on quay.io manually to make sure it is public
192-
make REGISTRY_USERNAME=my-non-production-org CONTAINER_IMAGE_TAG="$(git rev-parse HEAD)" push
193-
# Note some differences are expected, like few lines in rapidly populated logs
194-
./test/compare.sh registry.redhat.io/openshift-gitops-1/must-gather-rhel8:"$SOME_OLD_VERSION" quay.io/my-non-production-org/gitops-must-gather:"$(git rev-parse HEAD)"
57+
git clone https://github.com/redhat-developer/gitops-operator/
58+
cd gitops-operator
59+
make clean install
19560
```
19661

197-
Last but not least, please make sure you run `make lint` before pushing new changes.
198-
This requires `shellcheck` to be installed in your machine.
62+
### Compare gathered data between 2 gitops-must-gather images
19963

200-
For more information about `building` and `pushing` the image, see `make help`.
64+
```shell
65+
# Note some differences are expected, like a few lines at the end of rapidly populated logs, etc.
66+
./test/compare.sh registry.redhat.io/openshift-gitops-1/must-gather-rhel8:"$SOME_OLD_VERSION" quay.io/my-non-production-org/gitops-must-gather:latest
67+
```
68+
69+
### Verify the structure of the must-gather output
70+
71+
```shell
72+
# After logging in to a cluster
73+
git clone https://github.com/redhat-developer/gitops-operator/
74+
cd gitops-operator
75+
env E2E_MUST_GATHER_IMAGE=<TESTED_IMAGE_HERE> LOCAL_RUN=true \
76+
./bin/ginkgo -v -focus "validate_running_must_gather" -r ./test/openshift/e2e/ginkgo/parallel/
77+
```

test/suite.sh

Lines changed: 0 additions & 108 deletions
This file was deleted.

test/test1.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/test2.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/testdata/expected/test1.expected

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)