forked from grafana/jsonnet-libs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathk-compat.libsonnet
More file actions
22 lines (21 loc) · 835 Bytes
/
k-compat.libsonnet
File metadata and controls
22 lines (21 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// k-compat.libsonnet provides a compatibility layer between k8s-libsonnet and ksonnet-lib. As ksonnet-lib has been
// abandoned, we consider it deprecated. This layer will generate a deprecation warning to those that still use it.
local k = import 'k.libsonnet';
k
+ (
if std.objectHas(k, '__ksonnet')
then
std.trace(
'Deprecated: ksonnet-lib has been abandoned, please consider using https://github.com/jsonnet-libs/k8s-libsonnet.',
(import 'legacy-types.libsonnet')
+ (import 'legacy-custom.libsonnet')
+ (import 'legacy-noname.libsonnet')({
new(name=''):: super.new() + (if name != '' then super.mixin.metadata.withName(name) else {}),
})
)
else
(import 'legacy-subtypes.libsonnet')
+ (import 'legacy-noname.libsonnet')({
new(name=''):: super.new(name),
})
)