Document Assert with Label Selector
Test the following and work fine:
00-install.yaml
apiVersion: v1
kind: Pod
metadata:
name: static-web
labels:
environment: production
app: nginx
spec:
containers:
- name: web
image: nginx
00-assert.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
environment: production
status:
phase: Running
Assert does NOT have name... working strictly off labels. Needs to be documented
Even the assert is good on mismatch... for example change the assert file label from production to pro shows the following error:
kuttl/harness/pod: case.go:156: resource Pod:kudo-test-humble-crab/: .metadata.labels.environment: value mismatch, expected: pro != actual: production
similar to #158
As explained in https://github.com/kudobuilder/kuttl/issues/480#issuecomment-1747746365 this label selector does not really work right now. The example above only happens to work by coincidence in the "signgleton" case - where no other resources of given kind exist. However once #488 is merged it will work more generally as described above, and this should be documented, so this ticket still makes sense.