Unverified Commit e37db8c0 authored by bryanl's avatar bryanl
Browse files

Support full jsonnet language



With this change, the entire 0.10.0 jsonnet language is supported
Signed-off-by: default avatarbryanl <bryanliles@gmail.com>
parent 6f2791e0
......@@ -276,8 +276,8 @@
"ksonnet-gen/nodemaker",
"ksonnet-gen/printer"
]
revision = "d15220fdcdd07fd377894abff6276d86cb2d776d"
version = "v0.1.3"
revision = "dda11dd2ec3928cbb7f36830ec0d8aa5fb13ce0c"
version = "v0.1.5"
[[projects]]
name = "github.com/magiconair/properties"
......@@ -683,6 +683,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "4723225126a0d372380758876922a0039f08308216c8dce85461e7c7c742351f"
inputs-digest = "16f20bde2ef7b109d64583fb9adda4202ecf2703191a1895aa45f1ae5bc62b5d"
solver-name = "gps-cdcl"
solver-version = 1
......@@ -50,7 +50,7 @@
[[constraint]]
name = "github.com/ksonnet/ksonnet-lib"
version = "v0.1.3"
version = "v0.1.5"
[[constraint]]
name = "github.com/mattn/go-isatty"
......
local params = {
};
local params = {};
params + {
components+: {
foo+: {
replicas: 1,
},
},
replicas: 1
}
}
}
\ No newline at end of file
local params = {
};
local params = {};
params {
components+: {
foo+: {
replicas: 1,
},
},
replicas: 1
}
}
}
\ No newline at end of file
......@@ -37,6 +37,7 @@ func Test_initCmd(t *testing.T) {
"--namespace", "new-namespace",
"--server", "http://127.0.0.1",
"--env", "env-name",
"--api-spec", "version:v1.8.0",
},
action: actionInit,
expected: map[string]interface{}{
......
local params = import "../../components/params.libsonnet";
params {
components+: {
},
components+: {}
}
\ No newline at end of file
{
global: {
},
global: {},
components: {
// Component-level parameters, defined initially from 'ks prototype use ...'
// Each object below should correspond to a component in the components/ directory
......@@ -9,10 +8,10 @@
image: "gcr.io/heptio-images/ks-guestbook-demo:0.1",
name: "guiroot",
obj: {
a: "b",
a: "b"
},
servicePort: 80,
type: "ClusterIP",
},
},
type: "ClusterIP"
}
}
}
\ No newline at end of file
{
global: {
},
global: {},
components: {
// Component-level parameters, defined initially from 'ks prototype use ...'
// Each object below should correspond to a component in the components/ directory
......@@ -9,11 +8,11 @@
image: "gcr.io/heptio-images/ks-guestbook-demo:0.1",
name: "guiroot",
obj: {
a: "b",
a: "b"
},
replicas: 4,
servicePort: 80,
type: "ClusterIP",
},
},
type: "ClusterIP"
}
}
}
\ No newline at end of file
{
global: {
},
global: {},
components: {
// Component-level parameters, defined initially from 'ks prototype use ...'
// Each object below should correspond to a component in the components/ directory
"certificate-crd": {
spec: {
},
},
},
spec: {}
}
}
}
\ No newline at end of file
{
global: {
},
global: {},
components: {
a: {
other: 1,
metadata: {
labels: {
locala: "local",
},
},
},
},
locala: "local"
}
}
}
}
}
\ No newline at end of file
{
global: {
},
global: {},
components: {
"certificate-crd": {
spec: {
version: "v2",
},
},
},
version: "v2"
}
}
}
}
\ No newline at end of file
{
foo: "bar",
foo: "bar"
}
\ No newline at end of file
......@@ -2,7 +2,6 @@ local params = import "../../components/params.libsonnet";
params + {
components+: {
component1+: {
},
},
component1+: {}
}
}
\ No newline at end of file
{
}
\ No newline at end of file
{}
\ No newline at end of file
......@@ -3,7 +3,7 @@ local params = import "../../components/params.libsonnet";
params + {
components+: {
component1+: {
foo: "bar",
},
},
foo: "bar"
}
}
}
\ No newline at end of file
// Copyright 2018 The ksonnet authors
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package log
import (
......
local params = std.extVar("__ksonnet/params");
local globals = import "globals.libsonnet";
local envParams = params + {
components+: {
},
components+: {}
};
{
components: {
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components)
},
[x]: envParams.components[x] + globals for x in std.objectFields(envParams.components)
}
}
\ No newline at end of file
{
group: "dev",
}
\ No newline at end of file
{group: "dev"}
\ No newline at end of file
......@@ -4,16 +4,16 @@ local envParams = params + {
components+: {
guestbook+: {
name: "guestbook-dev",
replicas: params.global.replicas,
replicas: params.global.replicas
},
component+: {
name: "new-component",
},
},
name: "new-component"
}
}
};
{
components: {
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components)
},
[x]: envParams.components[x] + globals for x in std.objectFields(envParams.components)
}
}
\ No newline at end of file
......@@ -5,13 +5,13 @@ local envParams = params + {
guestbook+: {
name: "guestbook-dev",
replicas: params.global.replicas,
containerPort: 8080,
},
},
containerPort: 8080
}
}
};
{
components: {
[x]: envParams.components[x] + globals, for x in std.objectFields(envParams.components)
},
[x]: envParams.components[x] + globals for x in std.objectFields(envParams.components)
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment