Skip to content

Operator-sdk run packagemanifests does not work on Openshift #3863

@Doout

Description

@Doout

Bug Report

What did you do?

Nothing

What did you expect to see?

Operator deploy with run packagemanifests

What did you see instead? Under which circumstances?

Pod crashloopbackoff with the following log

Error: unable to open database file
Usage:
   [flags]

Flags:
  -h, --help               help for this command
  -m, --manifests string   relative path to directory of manifests (default "manifests")
  -o, --output string      relative path to a sqlite file to create or overwrite (default "bundles.db")
      --permissive         allow registry load errors

panic: unable to open database file

Environment

Operator type:

Kubernetes cluster type:

$ operator-sdk version
Latest version

$ go version (if language is Go)

1.14.x

$ kubectl version

$ oc version
Client Version: v0.0.0-unknown
Server Version: 4.3.13
Kubernetes Version: v1.16.2

Possible Solution

Cd into /tmp over /registry

I also tested it to make sure it works on OCP 4.5.x master...Doout:fix-ocp-deployment

Another fix will be to give all users write access to /registry when building the image.

Additional context

When I debug the pod (oc debug) and found that I get permission denied with touch which I assume the SQL package will also hit this (unable to open database file coming from SQL package)

/registry $ touch bundle.db
touch: bundle.db: Permission denied

When I run it as root, I face no issues. I assume the permission for /registry folder is not correct when it get deploy on OCP.
On OCP, UID is random while /registry ownership is root and no write access for any user

drwxr-xr-x    3 root     root            23 Sep  8 13:12 registry

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions