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

*: Use relative Jsonnet imports internally #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel

### Changed

-
- [#238](https://github.com/thanos-io/kube-thanos/pull/238) Use relative Jsonnet imports internally

### Added

Expand Down
4 changes: 2 additions & 2 deletions jsonnet/kube-thanos/kube-thanos-compact-shards.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local compactConfigDefaults = import 'kube-thanos/kube-thanos-compact-default-params.libsonnet';
local compact = import 'kube-thanos/kube-thanos-compact.libsonnet';
local compactConfigDefaults = import './kube-thanos-compact-default-params.libsonnet';
local compact = import './kube-thanos-compact.libsonnet';

// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
Expand Down
4 changes: 2 additions & 2 deletions jsonnet/kube-thanos/kube-thanos-receive-hashrings.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local receiveConfigDefaults = import 'kube-thanos/kube-thanos-receive-default-params.libsonnet';
local receive = import 'kube-thanos/kube-thanos-receive.libsonnet';
local receiveConfigDefaults = import './kube-thanos-receive-default-params.libsonnet';
Copy link
Collaborator

@paulfantom paulfantom Aug 9, 2021

Choose a reason for hiding this comment

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

Or you can use full import path of github.com/thanos-io/kube-thanos/jsonnet/kube-thanos/kube-thanos-receive-default-params.libsonnet which is guaranteed to be correct and allows to ditch legacy imports in jsonnet-bundler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is how I use the library, but why would you do that in the library?
And it is still not guaranteed to work, for example here how it is installed in the repo itself:

{
"source": {
"local": {
"directory": "jsonnet/kube-thanos"
}
},
"version": "."
}

It create vendor/kube-thanos. It it not guarantee either that the user will use jb, especially that this library does not have any dependency. Another problematic case is if the user wants to use a fork, they need to rename those imports before being able to use it.

local receive = import './kube-thanos-receive.libsonnet';

// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
Expand Down
4 changes: 2 additions & 2 deletions jsonnet/kube-thanos/kube-thanos-store-shards.libsonnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local storeConfigDefaults = import 'kube-thanos/kube-thanos-store-default-params.libsonnet';
local store = import 'kube-thanos/kube-thanos-store.libsonnet';
local storeConfigDefaults = import './kube-thanos-store-default-params.libsonnet';
local store = import './kube-thanos-store.libsonnet';

// These are the defaults for this components configuration.
// When calling the function to generate the component's manifest,
Expand Down
2 changes: 1 addition & 1 deletion jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"version": "."
}
],
"legacyImports": true
"legacyImports": false
}