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

Improve removal of elements in descriptors #460

goldmann opened this issue Mar 27, 2019 · 0 comments


Copy link

commented Mar 27, 2019

We can remove elements by specifying their value to null. In case the element has a schema value required set to True, removal will not work:

2019-03-27 16:10:36,198 cekit        DEBUG    Loading override '{"labels": [{"name": "usage", "value": "aaa"}]}'
2019-03-27 16:10:36,198 cekit        DEBUG    Reading descriptor directly...
2019-03-27 16:10:36,199 cekit        DEBUG    Loading override '{"labels": [{"name": "usage", "value": null}]}'
2019-03-27 16:10:36,200 cekit        DEBUG    Reading descriptor directly...
No handlers could be found for logger "pykwalify.core"
2019-03-27 16:10:36,200 cekit        DEBUG    Schema validation failed: <SchemaError: error code 2: Schema validation failed:
 - required.novalue : '/value'.: Path: '/'>
2019-03-27 16:10:36,200 cekit        ERROR    Cannot validate schema: Label
Traceback (most recent call last):
  File "/home/goldmann/git/redhat/cekit/cekit/", line 336, in run
  File "/home/goldmann/git/redhat/cekit/cekit/", line 53, in execute
  File "/home/goldmann/git/redhat/cekit/cekit/", line 74, in prepare
  File "/home/goldmann/git/redhat/cekit/cekit/generator/", line 21, in __init__
    super(DockerGenerator, self).__init__(descriptor_path, target, overrides)
  File "/home/goldmann/git/redhat/cekit/cekit/generator/", line 46, in __init__
    override), os.path.dirname(os.path.abspath(override))))
  File "/home/goldmann/git/redhat/cekit/cekit/descriptor/", line 18, in __init__
  File "/home/goldmann/git/redhat/cekit/cekit/descriptor/", line 53, in _prepare
    self._descriptor['labels'] = [Label(x) for x in self._descriptor.get('labels', [])]
  File "/home/goldmann/git/redhat/cekit/cekit/descriptor/", line 21, in __init__
    super(Label, self).__init__(descriptor)
  File "/home/goldmann/git/redhat/cekit/cekit/descriptor/", line 36, in __init__
  File "/home/goldmann/git/redhat/cekit/cekit/descriptor/", line 49, in __validate
    raise CekitError("Cannot validate schema: %s" % (self.__class__.__name__))
CekitError: Cannot validate schema: Label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.