Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set necessary pod security labels on the devfile-registry for OCP 4.12 #966

Closed
johnmcollier opened this issue Oct 11, 2022 · 7 comments · Fixed by devfile/registry-operator#29
Assignees
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working

Comments

@johnmcollier
Copy link
Member

johnmcollier commented Oct 11, 2022

/kind bug

Which area this bug is related to?

/area registry

What versions of software are you using?

OCP 4.12

Bug Summary

Starting with OCP 4.12, the Devfile Registry fails to deploy with the following error:

      message: 'pods "devfile-registry-858d9b69d6-hhr2d" is forbidden: violates PodSecurity
        "restricted:latest": allowPrivilegeEscalation != false (containers "devfile-registry",
        "oci-registry" must set securityContext.allowPrivilegeEscalation=false), unrestricted
        capabilities (containers "devfile-registry", "oci-registry" must set securityContext.capabilities.drop=["ALL"]),
        runAsNonRoot != true (pod or containers "devfile-registry", "oci-registry"
        must set securityContext.runAsNonRoot=true), seccompProfile (pod or containers
        "devfile-registry", "oci-registry" must set securityContext.seccompProfile.type

We need to add the proper security contexts in the devfile registry deployment

To Reproduce:
Deploy devfile registry via helm chart or operator on OCP 4.12

Expected behavior

Devfile registry deploys properly without error.

@openshift-ci openshift-ci bot added kind/bug Something isn't working area/registry Devfile registry for stacks and infrastructure labels Oct 11, 2022
@johnmcollier
Copy link
Member Author

johnmcollier commented Oct 11, 2022

The following will need to be updated:

@kim-tsao kim-tsao self-assigned this Jan 31, 2023
@kim-tsao
Copy link
Contributor

It's just the registry operator that needs updating

@michael-valdron
Copy link
Member

It's just the registry operator that needs updating

I have this implemented in devfile/registry-operator#29.

@kim-tsao
Copy link
Contributor

It's just the registry operator that needs updating

I have this implemented in devfile/registry-operator#29.

ok, let me assign this to you

@michael-valdron
Copy link
Member

It's just the registry operator that needs updating

I have this implemented in devfile/registry-operator#29.

The changes currently in this PR produces the following error in OpenShift:

+ '[' '!' -d /registry/stacks ']'
+ '[' '!' -e /registry/index.json ']'
+ /registry/index-server
2023/02/02 21:30:01 Registry is up and running
2023/02/02 21:30:01 Pushing dotnet50 version 1.0.3 to localhost:5000/devfile-catalog/dotnet50:1.0.3...
time="2023-02-02T21:30:01Z" level=warning msg="reference for unknown type: application/vnd.devfileio.devfile.layer.v1" digest="sha256:bfc1eeb74457cd935aa80dbb859be28e8ed9889a11122dd4e97aa46fbfcdb5c5" mediatype=application/vnd.devfileio.devfile.layer.v1 size=1488
time="2023-02-02T21:30:01Z" level=warning msg="reference for unknown type: application/vnd.devfileio.devfile.config.v2+json" digest="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" mediatype=application/vnd.devfileio.devfile.config.v2+json size=2
2023/02/02 21:30:01 failed to push dotnet50 version 1.0.3 to localhost:5000/devfile-catalog/dotnet50:1.0.3: unexpected response: 500 Internal Server Error

After doing some testing this error seems to only happen when the operator is deployed with OpenShift. When deploying on minikube this error does not occur.

@michael-valdron
Copy link
Member

It's just the registry operator that needs updating

I have this implemented in devfile/registry-operator#29.

The changes currently in this PR produces the following error in OpenShift:

+ '[' '!' -d /registry/stacks ']'
+ '[' '!' -e /registry/index.json ']'
+ /registry/index-server
2023/02/02 21:30:01 Registry is up and running
2023/02/02 21:30:01 Pushing dotnet50 version 1.0.3 to localhost:5000/devfile-catalog/dotnet50:1.0.3...
time="2023-02-02T21:30:01Z" level=warning msg="reference for unknown type: application/vnd.devfileio.devfile.layer.v1" digest="sha256:bfc1eeb74457cd935aa80dbb859be28e8ed9889a11122dd4e97aa46fbfcdb5c5" mediatype=application/vnd.devfileio.devfile.layer.v1 size=1488
time="2023-02-02T21:30:01Z" level=warning msg="reference for unknown type: application/vnd.devfileio.devfile.config.v2+json" digest="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" mediatype=application/vnd.devfileio.devfile.config.v2+json size=2
2023/02/02 21:30:01 failed to push dotnet50 version 1.0.3 to localhost:5000/devfile-catalog/dotnet50:1.0.3: unexpected response: 500 Internal Server Error

After doing some testing this error seems to only happen when the operator is deployed with OpenShift. When deploying on minikube this error does not occur.

This is now its own issue (#1025), this issue is now block by #1025.

@michael-valdron
Copy link
Member

michael-valdron commented Feb 9, 2023

It's just the registry operator that needs updating

I have this implemented in devfile/registry-operator#29.

The changes currently in this PR produces the following error in OpenShift:

+ '[' '!' -d /registry/stacks ']'
+ '[' '!' -e /registry/index.json ']'
+ /registry/index-server
2023/02/02 21:30:01 Registry is up and running
2023/02/02 21:30:01 Pushing dotnet50 version 1.0.3 to localhost:5000/devfile-catalog/dotnet50:1.0.3...
time="2023-02-02T21:30:01Z" level=warning msg="reference for unknown type: application/vnd.devfileio.devfile.layer.v1" digest="sha256:bfc1eeb74457cd935aa80dbb859be28e8ed9889a11122dd4e97aa46fbfcdb5c5" mediatype=application/vnd.devfileio.devfile.layer.v1 size=1488
time="2023-02-02T21:30:01Z" level=warning msg="reference for unknown type: application/vnd.devfileio.devfile.config.v2+json" digest="sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a" mediatype=application/vnd.devfileio.devfile.config.v2+json size=2
2023/02/02 21:30:01 failed to push dotnet50 version 1.0.3 to localhost:5000/devfile-catalog/dotnet50:1.0.3: unexpected response: 500 Internal Server Error

After doing some testing this error seems to only happen when the operator is deployed with OpenShift. When deploying on minikube this error does not occur.

This is now its own issue (#1025), this issue is now block by #1025.

This issue and #1025 are now being merged in the same PR (devfile/registry-operator#29).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Devfile registry for stacks and infrastructure kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants