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

feat: allow other entrypoints #389

Merged
merged 8 commits into from
Oct 24, 2020
Merged

Conversation

Duologic
Copy link
Member

The change allows the user to run tanka with alternative entrypoints, not limiting to main.jsonnet anymore.

This opens the door to using tk eval for purposes outside of the Tanka/K8s Environments paradigm. For example, one can
write a library with a test.jsonnet and run tk eval test.jsonnet in that library. Caveat: it needs to have a
tkrc.yaml or jsonnetfile.json so Tanka can resolve the JPATH. It also works for tk export and tk show, beware
that it will add default namespace to kubernetes objects, even though a spec.json might not exist.

This change is backwards compatible and still defaults to main.jsonnet if no file is given, tk diff will still want a
spec.json to connect to a cluster.

Feel free to give feedback/pushback on the idea here too.

I've done a grep on main.jsonnet in the codebase to set this up, but there are many other valid references to
main.jsonnet left that don't need replacing.

@sh0rez
Copy link
Member

sh0rez commented Sep 28, 2020

Adding lifecycle/blocked here because Tanka is currently in feature-freeze (not accepting features not required for the release), so we can get 0.12 out.

Will review once released

@sh0rez sh0rez added kind/enhancement Improve something existing lifecycle/blocked Blocked by outstanding changes (to another project) labels Sep 28, 2020
@Duologic Duologic force-pushed the duologic/allow_alternative_entrypoint branch from 6f4fd2b to 0fc9166 Compare October 11, 2020 15:33
@Duologic
Copy link
Member Author

rebased

pkg/jsonnet/jpath/jpath.go Outdated Show resolved Hide resolved
pkg/jsonnet/eval.go Show resolved Hide resolved
@Duologic Duologic requested a review from sh0rez October 19, 2020 08:40
@Duologic Duologic force-pushed the duologic/allow_alternative_entrypoint branch from 17379fc to 65e6969 Compare October 19, 2020 08:42
@Duologic
Copy link
Member Author

rebased.

@Duologic Duologic removed the lifecycle/blocked Blocked by outstanding changes (to another project) label Oct 19, 2020
Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

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

LGTM!! Very awesome work!

@sh0rez sh0rez merged commit 59a5f5f into master Oct 24, 2020
@sh0rez sh0rez deleted the duologic/allow_alternative_entrypoint branch October 24, 2020 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improve something existing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants