Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ijaz Ahmad
ksonnet
Commits
2bf6b1ff
Unverified
Commit
2bf6b1ff
authored
May 11, 2018
by
Bryan Liles
Committed by
GitHub
May 11, 2018
Browse files
Merge pull request #524 from bryanl/upgrade-ks-lib-for-complete-ast
Support full jsonnet language
parents
6f2791e0
e37db8c0
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
76 additions
and
74 deletions
+76
-74
Gopkg.lock
Gopkg.lock
+3
-3
Gopkg.toml
Gopkg.toml
+1
-1
metadata/params/testdata/delete-env-param/expected1.libsonnet
...data/params/testdata/delete-env-param/expected1.libsonnet
+4
-5
metadata/params/testdata/delete-env-param/expected2.libsonnet
...data/params/testdata/delete-env-param/expected2.libsonnet
+4
-5
pkg/clicmd/init_test.go
pkg/clicmd/init_test.go
+1
-0
pkg/component/testdata/delete-env-params.libsonnet
pkg/component/testdata/delete-env-params.libsonnet
+1
-2
pkg/component/testdata/guestbook/delete-params.libsonnet
pkg/component/testdata/guestbook/delete-params.libsonnet
+5
-6
pkg/component/testdata/guestbook/set-params.libsonnet
pkg/component/testdata/guestbook/set-params.libsonnet
+5
-6
pkg/component/testdata/params-delete-entry.libsonnet
pkg/component/testdata/params-delete-entry.libsonnet
+4
-6
pkg/component/testdata/params-delete-global.libsonnet
pkg/component/testdata/params-delete-global.libsonnet
+6
-7
pkg/component/testdata/updated-yaml-params.libsonnet
pkg/component/testdata/updated-yaml-params.libsonnet
+5
-6
pkg/env/testdata/add-global.libsonnet
pkg/env/testdata/add-global.libsonnet
+1
-1
pkg/env/testdata/delete-params.libsonnet
pkg/env/testdata/delete-params.libsonnet
+2
-3
pkg/env/testdata/remove-global.libsonnet
pkg/env/testdata/remove-global.libsonnet
+1
-2
pkg/env/testdata/updated-params.libsonnet
pkg/env/testdata/updated-params.libsonnet
+3
-3
pkg/log/log.go
pkg/log/log.go
+15
-0
pkg/params/testdata/env/globals/remove-component/out.libsonnet
...arams/testdata/env/globals/remove-component/out.libsonnet
+3
-4
pkg/params/testdata/env/globals/set-global/out.libsonnet
pkg/params/testdata/env/globals/set-global/out.libsonnet
+1
-3
pkg/params/testdata/env/globals/set/out-new-component.libsonnet
...rams/testdata/env/globals/set/out-new-component.libsonnet
+6
-6
pkg/params/testdata/env/globals/set/out.libsonnet
pkg/params/testdata/env/globals/set/out.libsonnet
+5
-5
No files found.
Gopkg.lock
View file @
2bf6b1ff
...
...
@@ -276,8 +276,8 @@
"ksonnet-gen/nodemaker",
"ksonnet-gen/printer"
]
revision = "d
15220fdcdd07fd377894abff6276d86cb2d776d
"
version = "v0.1.
3
"
revision = "d
da11dd2ec3928cbb7f36830ec0d8aa5fb13ce0c
"
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
Gopkg.toml
View file @
2bf6b1ff
...
...
@@ -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"
...
...
metadata/params/testdata/delete-env-param/expected1.libsonnet
View file @
2bf6b1ff
local
params
=
{
};
local
params
=
{};
params
+
{
components
+:
{
foo
+:
{
replicas
:
1
,
}
,
}
,
replicas
:
1
}
}
}
\ No newline at end of file
metadata/params/testdata/delete-env-param/expected2.libsonnet
View file @
2bf6b1ff
local
params
=
{
};
local
params
=
{};
params
{
components
+:
{
foo
+:
{
replicas
:
1
,
}
,
}
,
replicas
:
1
}
}
}
\ No newline at end of file
pkg/clicmd/init_test.go
View file @
2bf6b1ff
...
...
@@ -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
{}{
...
...
pkg/component/testdata/delete-env-params.libsonnet
View file @
2bf6b1ff
local
params
=
import
"../../components/params.libsonnet"
;
params
{
components
+:
{
},
components
+:
{}
}
\ No newline at end of file
pkg/component/testdata/guestbook/delete-params.libsonnet
View file @
2bf6b1ff
{
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
pkg/component/testdata/guestbook/set-params.libsonnet
View file @
2bf6b1ff
{
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
pkg/component/testdata/params-delete-entry.libsonnet
View file @
2bf6b1ff
{
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
pkg/component/testdata/params-delete-global.libsonnet
View file @
2bf6b1ff
{
global
:
{
},
global
:
{},
components
:
{
a
:
{
other
:
1
,
metadata
:
{
labels
:
{
locala
:
"local"
,
}
,
}
,
}
,
}
,
locala
:
"local"
}
}
}
}
}
\ No newline at end of file
pkg/component/testdata/updated-yaml-params.libsonnet
View file @
2bf6b1ff
{
global
:
{
},
global
:
{},
components
:
{
"certificate-crd"
:
{
spec
:
{
version
:
"v2"
,
}
,
}
,
}
,
version
:
"v2"
}
}
}
}
\ No newline at end of file
pkg/env/testdata/add-global.libsonnet
View file @
2bf6b1ff
{
foo
:
"bar"
,
foo
:
"bar"
}
\ No newline at end of file
pkg/env/testdata/delete-params.libsonnet
View file @
2bf6b1ff
...
...
@@ -2,7 +2,6 @@ local params = import "../../components/params.libsonnet";
params
+
{
components
+:
{
component1
+:
{
},
},
component1
+:
{}
}
}
\ No newline at end of file
pkg/env/testdata/remove-global.libsonnet
View file @
2bf6b1ff
{
}
\ No newline at end of file
{}
\ No newline at end of file
pkg/env/testdata/updated-params.libsonnet
View file @
2bf6b1ff
...
...
@@ -3,7 +3,7 @@ local params = import "../../components/params.libsonnet";
params
+
{
components
+:
{
component1
+:
{
foo
:
"bar"
,
}
,
}
,
foo
:
"bar"
}
}
}
\ No newline at end of file
pkg/log/log.go
View file @
2bf6b1ff
// 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
(
...
...
pkg/params/testdata/env/globals/remove-component/out.libsonnet
View file @
2bf6b1ff
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
pkg/params/testdata/env/globals/set-global/out.libsonnet
View file @
2bf6b1ff
{
group
:
"dev"
,
}
\ No newline at end of file
{
group
:
"dev"
}
\ No newline at end of file
pkg/params/testdata/env/globals/set/out-new-component.libsonnet
View file @
2bf6b1ff
...
...
@@ -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
pkg/params/testdata/env/globals/set/out.libsonnet
View file @
2bf6b1ff
...
...
@@ -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
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment