Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to get the crd resource due to yaml.constructor.ConstructorError #82

Open
jianzhangbjz opened this issue Jan 15, 2024 · 0 comments

Comments

@jianzhangbjz
Copy link
Contributor

Got the below error:

jiazha-mac:o-must-gather jiazha$ omg get crd
Traceback (most recent call last):
  File "/opt/homebrew/bin/omg", line 33, in <module>
    sys.exit(load_entry_point('o-must-gather', 'console_scripts', 'omg')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1668, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiazha/goproject/o-must-gather/omg/cli.py", line 122, in get_cmd
    get.cmd(objects, output, show_labels)
  File "/Users/jiazha/goproject/o-must-gather/omg/get/get.py", line 28, in cmd
    all_res_d = get_all_resources(parsed_objects, ns)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiazha/goproject/o-must-gather/omg/get/get_resources.py", line 47, in get_all_resources
    res = load_res(path, r_type, r_names, ns)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiazha/goproject/o-must-gather/omg/must_gather/load_resources.py", line 157, in load_res
    res_yd = load_res_from_yaml(y, rdef)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jiazha/goproject/o-must-gather/omg/must_gather/load_resources.py", line 41, in load_res_from_yaml
    ydata = load_yaml(yfile)
            ^^^^^^^^^^^^^^^^
  File "/Users/jiazha/goproject/o-must-gather/omg/utils/load_yaml.py", line 33, in load_yaml
    ydata = yaml.load(y_d, Loader=SafeLoader)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/constructor.py", line 51, in get_single_data
    return self.construct_document(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/constructor.py", line 60, in construct_document
    for dummy in generator:
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/constructor.py", line 408, in construct_yaml_seq
    data.extend(self.construct_sequence(node))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/constructor.py", line 129, in construct_sequence
    return [self.construct_object(child, deep=deep)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/constructor.py", line 100, in construct_object
    data = constructor(self, node)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.12/site-packages/yaml/constructor.py", line 427, in construct_undefined
    raise ConstructorError(None, None,
yaml.constructor.ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:value'
  in "<unicode string>", line 5689, column 29

Python version

jiazha-mac:o-must-gather jiazha$ python3 --version
Python 3.12.1
jiazha-mac:o-must-gather jiazha$ pip3 list 
Package            Version    Editable project location
------------------ ---------- ------------------------------------------
argcomplete        3.2.1
certifi            2023.11.17
cffi               1.16.0
charset-normalizer 3.3.2
click              8.0.1
cryptography       41.0.7
idna               3.6
job                2.1.1      /Users/jiazha/goproject/release-tests/prow
loguru             0.6.0
o-must-gather      2.0.0      /Users/jiazha/goproject/o-must-gather
packaging          23.2
pip                23.3.2
pycparser          2.21
python-dateutil    2.8.2
PyYAML             6.0.1
requests           2.31.0
semver             3.0.2
setuptools         69.0.3
six                1.16.0
tabulate           0.9.0
urllib3            2.1.0
wheel              0.42.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant