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(kubernetes): ignore nil during reconcile #162

Merged
merged 2 commits into from
Jan 13, 2020
Merged

fix(kubernetes): ignore nil during reconcile #162

merged 2 commits into from
Jan 13, 2020

Conversation

sh0rez
Copy link
Member

@sh0rez sh0rez commented Jan 13, 2020

While extracting the objects from the Jsonnet output, Tanka was not correctly
dealing with keys that were set to nil, leading those to be classified as
invalid objects, while they were no objects at all.

Such a case, where a key is explicitely set to nil is Jsonnet if:

{
  key: if false then "ouch"
}

Because the condition is false, Jsonnet adds an implicit else null.

Fixes #160

While extracting the objects from the Jsonnet output, Tanka was not correctly
dealing with keys that were set to `nil`, leading those to be classified as
invalid objects, while they were no objects at all.

Such a case, where a key is explicitely set to `nil` is Jsonnet if:

```jsonnet
{
  key: if false then "ouch"
}
```

Because the condition is false, Jsonnet adds an implicit `else null`.
@sh0rez sh0rez added kind/bug Something isn't working component/jsonnet Everything regarding the jsonnet language labels Jan 13, 2020
@sh0rez sh0rez requested a review from rfratto January 13, 2020 15:30
Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Any way we can add a test case for this?

@sh0rez
Copy link
Member Author

sh0rez commented Jan 13, 2020

LGTM. Any way we can add a test case for this?

of course, will do

@sh0rez sh0rez merged commit fc84e62 into master Jan 13, 2020
@sh0rez sh0rez deleted the reconcile-nil branch January 13, 2020 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/jsonnet Everything regarding the jsonnet language kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support nil type for disabling objects
2 participants