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

Fix metadata labels of manifest #364

Merged
merged 1 commit into from
Dec 29, 2023
Merged

Conversation

whs-dot-hk
Copy link
Contributor

Greetings @blaggacao, found a bug while using the blocktype kubectl, below is the explaination

Context

In yaml (manifest), metadata.labels can be null
e.g.

metadata:
  labels:

or

metadata:
  labels: null

instead of the standard

metadata:
  labels: {}

Which cause the dmerge in amendAlways fails

       error:
       rigt-hand-side must be of the same type as left-hand-side
       at 'metadata.labels':
       - lhs: null @ undetectable posision
       - rhs: set @ /nix/store/z6hf8dcim8qdgs0nh6bvf52x0w2zzkpf-incl/std/fwlib/blockTypes/kubectl.nix:62:21

Solution

Patch the edge case, with manifest.metadata.labels = {}; before doing dmerge (now lhs will also be a set).

@blaggacao blaggacao merged commit 660a86d into divnix:main Dec 29, 2023
8 checks passed
@blaggacao
Copy link
Collaborator

Thanks a lot! This looks good!

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

Successfully merging this pull request may close these issues.

2 participants