Skip to content

opm index prune fails on Mac opening file for writing #947

@mhrivnak

Description

@mhrivnak

Versions

opm version:

Version: version.Version{OpmVersion:"b576eef43", GitCommit:"b576eef43e0d4c3745435a068b8bf42ec347eda3", BuildDate:"2022-04-11T10:00:51Z", GoOs:"darwin", GoArch:"amd64"}

podman version:

Client:       Podman Engine
Version:      4.0.3
API Version:  4.0.3
Go Version:   go1.18
Built:        Fri Apr  1 11:28:59 2022
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.0.3
API Version:  4.0.3
Go Version:   go1.18
Built:        Fri Apr  1 14:22:39 2022
OS/Arch:      linux/arm64

Problem

I ran the following command to prune an index. It works on a linux box but fails on a Mac:

opm index prune --debug --from-index "registry.redhat.io/redhat/redhat-operator-index:v4.10" --packages 'advanced-cluster-management' --tag myindex:v4.10

It exits with code 125 and the following output:

WARN[0000] DEPRECATION NOTICE:
Sqlite-based catalogs and their related subcommands are deprecated. Support for
them will be removed in a future release. Please migrate your catalog workflows
to the new file-based catalog format. 
INFO[0000] pruning the index                             packages="[advanced-cluster-management]"
INFO[0000] Pulling previous image registry.redhat.io/redhat/redhat-operator-index:v4.10 to get metadata  packages="[advanced-cluster-management]"
INFO[0000] running /opt/homebrew/bin/podman pull registry.redhat.io/redhat/redhat-operator-index:v4.10  packages="[advanced-cluster-management]"
INFO[0002] running /opt/homebrew/bin/podman pull registry.redhat.io/redhat/redhat-operator-index:v4.10  packages="[advanced-cluster-management]"
INFO[0003] Getting label data from previous image        packages="[advanced-cluster-management]"
INFO[0003] running podman inspect                        packages="[advanced-cluster-management]"
DEBU[0003] [podman inspect registry.redhat.io/redhat/redhat-operator-index:v4.10]  packages="[advanced-cluster-management]"
INFO[0004] running podman create                         packages="[advanced-cluster-management]"
DEBU[0004] [podman create registry.redhat.io/redhat/redhat-operator-index:v4.10 ]  packages="[advanced-cluster-management]"
INFO[0004] running podman cp                             packages="[advanced-cluster-management]"
DEBU[0004] [podman cp 78bb5891bdcffae55004b2ebb0734b8319f314e94a6b72390b419ef3a5a361cc:/. ./index_tmp_377180214]  packages="[advanced-cluster-management]"
ERRO[0005] Error: 2 errors occurred:
	* error copying to host: copier: put: error creating "/Users/mhrivnak/index_tmp_377180214/root/.bash_logout": copier: put: error opening file "/Users/mhrivnak/index_tmp_377180214/root/.bash_logout" for writing: open /Users/mhrivnak/index_tmp_377180214/root/.bash_logout: permission denied
	* error copying from container: io: read/write on closed pipe  packages="[advanced-cluster-management]"
Error: error copying container directory Error: 2 errors occurred:
	* error copying to host: copier: put: error creating "/Users/mhrivnak/index_tmp_377180214/root/.bash_logout": copier: put: error opening file "/Users/mhrivnak/index_tmp_377180214/root/.bash_logout" for writing: open /Users/mhrivnak/index_tmp_377180214/root/.bash_logout: permission denied
	* error copying from container: io: read/write on closed pipe
: exit status 125
Usage:
  opm index prune [flags]

Flags:
  -i, --binary-image opm        container image for on-image opm command
  -c, --container-tool string   tool to interact with container images (save, build, etc.). One of: [docker, podman] (default "podman")
  -f, --from-index string       index to prune
      --generate                if enabled, just creates the dockerfile and saves it to local disk
  -h, --help                    help for prune
  -d, --out-dockerfile string   if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name
  -p, --packages strings        comma separated list of packages to keep
      --permissive              allow registry load errors
  -t, --tag string              custom tag for container image being built

Global Flags:
      --skip-tls   skip TLS certificate verification for container image registries while pulling bundles or index

Metadata

Metadata

Assignees

Labels

lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions