Permalink
Browse files

Merge pull request #524 from bryanl/upgrade-ks-lib-for-complete-ast

Support full jsonnet language
  • Loading branch information...
bryanl committed May 11, 2018
2 parents 6f2791e + e37db8c commit 2bf6b1fffb059f7db0a8f68febf2befe95bb746d
Showing with 361 additions and 168 deletions.
  1. +3 −3 Gopkg.lock
  2. +1 −1 Gopkg.toml
  3. +4 −5 metadata/params/testdata/delete-env-param/expected1.libsonnet
  4. +4 −5 metadata/params/testdata/delete-env-param/expected2.libsonnet
  5. +1 −0 pkg/clicmd/init_test.go
  6. +1 −2 pkg/component/testdata/delete-env-params.libsonnet
  7. +5 −6 pkg/component/testdata/guestbook/delete-params.libsonnet
  8. +5 −6 pkg/component/testdata/guestbook/set-params.libsonnet
  9. +4 −6 pkg/component/testdata/params-delete-entry.libsonnet
  10. +6 −7 pkg/component/testdata/params-delete-global.libsonnet
  11. +5 −6 pkg/component/testdata/updated-yaml-params.libsonnet
  12. +1 −1 pkg/env/testdata/add-global.libsonnet
  13. +2 −3 pkg/env/testdata/delete-params.libsonnet
  14. +1 −2 pkg/env/testdata/remove-global.libsonnet
  15. +3 −3 pkg/env/testdata/updated-params.libsonnet
  16. +15 −0 pkg/log/log.go
  17. +3 −4 pkg/params/testdata/env/globals/remove-component/out.libsonnet
  18. +1 −3 pkg/params/testdata/env/globals/set-global/out.libsonnet
  19. +6 −6 pkg/params/testdata/env/globals/set/out-new-component.libsonnet
  20. +5 −5 pkg/params/testdata/env/globals/set/out.libsonnet
  21. +1 −2 pkg/params/testdata/env/globals/unset-global/out.libsonnet
  22. +5 −5 pkg/params/testdata/env/globals/unset/out.libsonnet
  23. +1 −2 pkg/params/testdata/env/no-globals/remove-component/out.libsonnet
  24. +3 −3 pkg/params/testdata/env/no-globals/set/out.libsonnet
  25. +3 −3 pkg/params/testdata/env/no-globals/unset/out.libsonnet
  26. +4 −4 pkg/params/testdata/updated.libsonnet
  27. +2 −2 pkg/util/jsonnet/object_test.go
  28. +6 −6 pkg/util/jsonnet/testdata/set-map.jsonnet
  29. +260 −67 vendor/github.com/ksonnet/ksonnet-lib/ksonnet-gen/printer/printer.go
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -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"
@@ -1,10 +1,9 @@
local params = {
};
local params = {};
params + {
components+: {
foo+: {
replicas: 1,
},
},
replicas: 1
}
}
}
@@ -1,10 +1,9 @@
local params = {
};
local params = {};
params {
components+: {
foo+: {
replicas: 1,
},
},
replicas: 1
}
}
}
View
@@ -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{}{
@@ -1,6 +1,5 @@
local params = import "../../components/params.libsonnet";
params {
components+: {
},
components+: {}
}
@@ -1,6 +1,5 @@
{
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"
}
}
}
@@ -1,6 +1,5 @@
{
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"
}
}
}
@@ -1,12 +1,10 @@
{
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: {}
}
}
}
@@ -1,14 +1,13 @@
{
global: {
},
global: {},
components: {
a: {
other: 1,
metadata: {
labels: {
locala: "local",
},
},
},
},
locala: "local"
}
}
}
}
}
@@ -1,11 +1,10 @@
{
global: {
},
global: {},
components: {
"certificate-crd": {
spec: {
version: "v2",
},
},
},
version: "v2"
}
}
}
}
@@ -1,3 +1,3 @@
{
foo: "bar",
foo: "bar"
}
@@ -2,7 +2,6 @@ local params = import "../../components/params.libsonnet";
params + {
components+: {
component1+: {
},
},
component1+: {}
}
}
@@ -1,2 +1 @@
{
}
{}
@@ -3,7 +3,7 @@ local params = import "../../components/params.libsonnet";
params + {
components+: {
component1+: {
foo: "bar",
},
},
foo: "bar"
}
}
}
View
@@ -1,3 +1,18 @@
// 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 (
@@ -1,12 +1,11 @@
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)
}
}
@@ -1,3 +1 @@
{
group: "dev",
}
{group: "dev"}
@@ -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)
}
}
@@ -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)
}
}
@@ -3,13 +3,13 @@ local globals = import "globals.libsonnet";
local envParams = params + {
components+: {
guestbook+: {
name: "guestbook-dev",
},
},
name: "guestbook-dev"
}
}
};
{
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)
}
}
@@ -1,6 +1,5 @@
local params = import "../../components/params.libsonnet";
params + {
components+: {
},
components+: {}
}
@@ -5,7 +5,7 @@ params + {
guestbook+: {
name: "guestbook-dev",
replicas: params.global.replicas,
containerPort: 8080,
},
},
containerPort: 8080
}
}
}
@@ -3,7 +3,7 @@ local params = import "../../components/params.libsonnet";
params + {
components+: {
guestbook+: {
name: "guestbook-dev",
},
},
name: "guestbook-dev"
}
}
}
@@ -1,6 +1,6 @@
{
global: {
"restart": false,
"restart": false
},
// Component-level parameters, defined initially from 'ks prototype use ...'
// Each object below should correspond to a component in the components/ directory
@@ -11,7 +11,7 @@
name: "guestbook-ui",
replicas: 5,
servicePort: 80,
type: "NodePort",
},
},
type: "NodePort"
}
}
}
Oops, something went wrong.

0 comments on commit 2bf6b1f

Please sign in to comment.