Closed kmotojim closed 1 year ago
Hi @kmotojim
I didn't test it but the source of the problem cloud be this line:
name: image-registry.openshift-image-registry.svc\:5000
I think you shuld try like this:
name: "image-registry.openshift-image-registry.svc:5000"
And yes there is a problem in the code too because of this https://github.com/devopstales/trivy-operator/blob/main/trivy-operator.py#L230-L233 part
I tried setting image-registry.openshift-image-registry.svc:5000 (without slash before colon) to name in registy object but pod still can't get the value from it.
registry:
- name: image-registry.openshift-image-registry.svc:5000
username: "serviceaccount"
password: "******"
insecure: True
Thank you for fixing. It seems UnboundLocalError: local variable 'registry_list' referenced before assignment doesn't happen.
Describe the bug
I got the following error.
The error I encountered is related to the
registry_list = spec['registry']
line of code because I got DEBUG message[2023-01-24 14:54:58,541] kopf.objects [DEBUG ] [my-namespace/trivy-operator-main-config] No registry auth config is defined
.Expected behavior
I set
registryAuth > registry
in Helm Values file but it looks that trivy-operator pod can't get the value from it. Value ofregistry
should be configured in trivy-operator pod, soregistry_list = spec['registry']
would be success and local variableregistry_list
would be assigned beforeregistry_list.append(data['auths'])
.https://github.com/devopstales/trivy-operator/blob/main/trivy-operator.py#L229-L233 https://github.com/devopstales/trivy-operator/blob/main/trivy-operator.py#L240
Configuration file
Due to the above error, the NamespaceScanner is not created.
Helm Values file
Environment:
trivy-operator version
): 2.5.0kubectl version
): I use Oenshift(Client Version: 4.10.12/Server Version: 4.10.36/Kubernetes Version: v1.23.5+8471591)Additional context
I got the same error on Kubernetes Deploy.
https://github.com/devopstales/trivy-operator/tree/main/deploy/kubernetes
This is
05_namespace-scanner.yaml
I applied for openshift.