operator-registry icon indicating copy to clipboard operation
operator-registry copied to clipboard

initializer fails to load multi-document YAML manifests

Open dmesser opened this issue 4 years ago • 8 comments

Tested with quay.io/operator-framework/upstream-registry-builder:v1.6.1 with this:

FROM quay.io/operator-framework/upstream-registry-builder:v1.6.1 as builder
COPY upstream-community-operators manifests
RUN ./bin/initializer --permissive true -o ./bundles.db

This fails with:

time="2020-03-19T18:35:25Z" level=warning msg="permissive mode enabled" error="error loading manifests from directory: error checking provided apis in bundle : couldn't find monitoring.coreos.com/v1/PrometheusRule (prometheusrules) in bundle. found: map[]"

The culprit seems to be trailing whitespace and the multi-document split anchor: https://github.com/operator-framework/community-operators/blob/527c747c6b67cb376e088cf9a550b9a2e76aba4f/upstream-community-operators/prometheus/0.37.0/prometheuses.monitoring.coreos.com.crd.yaml#L1-L2

dmesser avatar Mar 19 '20 18:03 dmesser

@awgreene FYI

dinhxuanvu avatar Mar 19 '20 18:03 dinhxuanvu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 18 '20 19:05 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 18 '20 10:07 stale[bot]

@awgreene @dinhxuanvu I think we should take a look at this. Concatenated YAML manifests are not rare.

dmesser avatar Jul 20 '20 11:07 dmesser

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 18 '20 11:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 20 '20 10:11 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 19 '21 14:01 stale[bot]

Just want to bump this again, because using controller-gen is generating CRDs with --- at the start of the file.

Example Command

controller-gen crd:crdVersions=v1 \
		rbac:roleName=addon-operator-manager \
		paths="./..." \
		output:crd:artifacts:config=config/deploy

thetechnick avatar Jun 08 '21 13:06 thetechnick