operator-framework / operator-courier

Build, verify and push operators
Apache License 2.0
41 stars 53 forks source link

Getting error while verifying the metadata bundle in openshift operator #185

Closed tkonduri closed 4 years ago

tkonduri commented 4 years ago

The metadata bundle that I have has a crd file which contains more than one CRD. when I am trying to verify the bundle I get the following error message:

> operator-courier verify bundle/                         
ERROR:operatorcourier.identify:Courier requires valid input YAML files
Courier requires valid input YAML files

Attaching the zip that contains the bundle folder: metadata.zip

MartinBasti commented 4 years ago

Only one yaml document per file is allowed

operator-courier --verbose verify test_op_metadata
ERROR:operatorcourier.identify:Courier requires valid input YAML files
DEBUG:operatorcourier.cli:Exit traceback: Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/operatorcourier/identify.py", line 23, in get_operator_artifact_type
    operatorArtifact = safe_load(operatorArtifactString)
  File "/usr/lib64/python3.8/site-packages/yaml/__init__.py", line 162, in safe_load
    return load(stream, SafeLoader)
  File "/usr/lib64/python3.8/site-packages/yaml/__init__.py", line 114, in load
    return loader.get_single_data()
  File "/usr/lib64/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/usr/lib64/python3.8/site-packages/yaml/composer.py", line 41, in get_single_node
    raise ComposerError("expected a single document in the stream",
yaml.composer.ComposerError: expected a single document in the stream
  in "<unicode string>", line 1, column 1:
    apiVersion: apiextensions.k8s.io ... 
    ^
but found another document
  in "<unicode string>", line 24, column 1:
    ---
    ^

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/operatorcourier/cli.py", line 15, in main
    parser.parse()
  File "/usr/lib/python3.8/site-packages/operatorcourier/cli.py", line 140, in parse
    func(args)
  File "/usr/lib/python3.8/site-packages/operatorcourier/cli.py", line 148, in verify
    api.build_and_verify(source_dir=args.source_dir,
  File "/usr/lib/python3.8/site-packages/operatorcourier/api.py", line 48, in build_and_verify
    verified_manifest = VerifiedManifest(source_dir, yamls, ui_validate_io, repository)
  File "/usr/lib/python3.8/site-packages/operatorcourier/verified_manifest.py", line 36, in __init__
    manifests = self.get_manifests_info(source_dir)
  File "/usr/lib/python3.8/site-packages/operatorcourier/verified_manifest.py", line 70, in get_manifests_info
    = get_csvs_pkg_info_from_root(source_dir)
  File "/usr/lib/python3.8/site-packages/operatorcourier/manifest_parser.py", line 87, in get_csvs_pkg_info_from_root
    file_type = identify.get_operator_artifact_type(file_content)
  File "/usr/lib/python3.8/site-packages/operatorcourier/identify.py", line 27, in get_operator_artifact_type
    raise OpCourierBadYaml(msg)
operatorcourier.errors.OpCourierBadYaml: Courier requires valid input YAML files

Courier requires valid input YAML files