operator-framework / operator-registry

Operator Registry runs in a Kubernetes or OpenShift cluster to provide operator catalog data to Operator Lifecycle Manager.
Apache License 2.0
211 stars 246 forks source link

initializer fails to load multi-document YAML manifests #222

Open dmesser opened 4 years ago

dmesser commented 4 years ago

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

dinhxuanvu commented 4 years ago

@awgreene FYI

stale[bot] commented 4 years ago

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] commented 4 years ago

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.

dmesser commented 4 years ago

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

stale[bot] commented 3 years ago

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] commented 3 years ago

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] commented 3 years ago

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.

thetechnick commented 3 years ago

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