Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ijaz Ahmad
ksonnet
Commits
fc1db176
Unverified
Commit
fc1db176
authored
May 26, 2018
by
bryanl
Browse files
ksonnet lib printer fixes
Signed-off-by:
bryanl
<
bryanliles@gmail.com
>
parent
ba676442
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
102 additions
and
69 deletions
+102
-69
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
+3
-3
metadata/params/testdata/delete-env-param/expected2.libsonnet
...data/params/testdata/delete-env-param/expected2.libsonnet
+3
-3
pkg/app/encoder.go
pkg/app/encoder.go
+15
-0
pkg/app/override_test.go
pkg/app/override_test.go
+15
-0
pkg/component/testdata/delete-env-params.libsonnet
pkg/component/testdata/delete-env-params.libsonnet
+2
-2
pkg/component/testdata/guestbook/delete-params.libsonnet
pkg/component/testdata/guestbook/delete-params.libsonnet
+6
-6
pkg/component/testdata/guestbook/set-params.libsonnet
pkg/component/testdata/guestbook/set-params.libsonnet
+6
-6
pkg/component/testdata/params-delete-entry.libsonnet
pkg/component/testdata/params-delete-entry.libsonnet
+3
-3
pkg/component/testdata/params-delete-global.libsonnet
pkg/component/testdata/params-delete-global.libsonnet
+5
-5
pkg/component/testdata/updated-yaml-params.libsonnet
pkg/component/testdata/updated-yaml-params.libsonnet
+4
-4
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
+3
-3
pkg/env/testdata/params.libsonnet
pkg/env/testdata/params.libsonnet
+2
-2
pkg/env/testdata/updated-params.libsonnet
pkg/env/testdata/updated-params.libsonnet
+4
-4
pkg/params/testdata/env/globals/remove-component/out.libsonnet
...arams/testdata/env/globals/remove-component/out.libsonnet
+6
-5
pkg/params/testdata/env/globals/set-global/out.libsonnet
pkg/params/testdata/env/globals/set-global/out.libsonnet
+1
-1
pkg/params/testdata/env/globals/set/out-new-component.libsonnet
...rams/testdata/env/globals/set/out-new-component.libsonnet
+10
-9
pkg/params/testdata/env/globals/set/out.libsonnet
pkg/params/testdata/env/globals/set/out.libsonnet
+9
-8
No files found.
Gopkg.lock
View file @
fc1db176
...
...
@@ -427,8 +427,8 @@
"ksonnet-gen/nodemaker",
"ksonnet-gen/printer"
]
revision = "
dda11dd2ec3928cbb7f36830ec0d8aa5fb13ce0c
"
version = "v0.1.
5
"
revision = "
863b9da5f131177b6bf7c0678a8d5ff909956b0e
"
version = "v0.1.
7
"
[[projects]]
name = "github.com/magiconair/properties"
...
...
@@ -1267,6 +1267,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "
d54e717c9705768768030c1d16e15347c44b0b4edb40dc2a1d7caafd34f50311
"
inputs-digest = "
88a763c70a9571fdacc12685c647c669f746dde769ed278b9f3acbe490063ce9
"
solver-name = "gps-cdcl"
solver-version = 1
Gopkg.toml
View file @
fc1db176
...
...
@@ -52,7 +52,7 @@ required = ["k8s.io/kubernetes/pkg/kubectl/cmd/util"]
[[constraint]]
name
=
"github.com/ksonnet/ksonnet-lib"
version
=
"v0.1.
5
"
version
=
"v0.1.
7
"
[[constraint]]
name
=
"github.com/onsi/ginkgo"
...
...
metadata/params/testdata/delete-env-param/expected1.libsonnet
View file @
fc1db176
...
...
@@ -3,7 +3,7 @@ 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 @
fc1db176
...
...
@@ -3,7 +3,7 @@ local params = {};
params
{
components
+:
{
foo
+:
{
replicas
:
1
}
}
replicas
:
1
,
}
,
}
,
}
\ No newline at end of file
pkg/app/encoder.go
View file @
fc1db176
// 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
app
import
(
...
...
pkg/app/override_test.go
View file @
fc1db176
// 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
app
import
(
...
...
pkg/component/testdata/delete-env-params.libsonnet
View file @
fc1db176
local
params
=
import
"
../../components/params.libsonnet
"
;
local
params
=
import
'
../../components/params.libsonnet
'
;
params
{
components
+:
{}
components
+:
{}
,
}
\ No newline at end of file
pkg/component/testdata/guestbook/delete-params.libsonnet
View file @
fc1db176
...
...
@@ -5,13 +5,13 @@
// Each object below should correspond to a component in the components/ directory
"guestbook-ui"
:
{
containerPort
:
80
,
image
:
"
gcr.io/heptio-images/ks-guestbook-demo:0.1
"
,
name
:
"
guiroot
"
,
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 @
fc1db176
...
...
@@ -5,14 +5,14 @@
// Each object below should correspond to a component in the components/ directory
"guestbook-ui"
:
{
containerPort
:
80
,
image
:
"
gcr.io/heptio-images/ks-guestbook-demo:0.1
"
,
name
:
"
guiroot
"
,
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 @
fc1db176
...
...
@@ -4,7 +4,7 @@
// 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 @
fc1db176
...
...
@@ -5,9 +5,9 @@
other
:
1
,
metadata
:
{
labels
:
{
locala
:
"
local
"
}
}
}
}
locala
:
'
local
'
,
}
,
}
,
}
,
}
,
}
\ No newline at end of file
pkg/component/testdata/updated-yaml-params.libsonnet
View file @
fc1db176
...
...
@@ -3,8 +3,8 @@
components
:
{
"certificate-crd"
:
{
spec
:
{
version
:
"
v2
"
}
}
}
version
:
'
v2
'
,
}
,
}
,
}
,
}
\ No newline at end of file
pkg/env/testdata/add-global.libsonnet
View file @
fc1db176
{
foo
:
"
bar
"
foo
:
'
bar
'
,
}
\ No newline at end of file
pkg/env/testdata/delete-params.libsonnet
View file @
fc1db176
local
params
=
import
"
../../components/params.libsonnet
"
;
local
params
=
import
'
../../components/params.libsonnet
'
;
params
+
{
components
+:
{
component1
+:
{}
}
component1
+:
{}
,
}
,
}
\ No newline at end of file
pkg/env/testdata/params.libsonnet
View file @
fc1db176
local
params
=
import
"
../../components/params.libsonnet
"
;
local
params
=
import
'
../../components/params.libsonnet
'
;
params
+
{
components
+:
{
component1
+:
{
foo
:
"
bar
"
,
foo
:
'
bar
'
,
},
},
}
pkg/env/testdata/updated-params.libsonnet
View file @
fc1db176
local
params
=
import
"
../../components/params.libsonnet
"
;
local
params
=
import
'
../../components/params.libsonnet
'
;
params
+
{
components
+:
{
component1
+:
{
foo
:
"
bar
"
}
}
foo
:
'
bar
'
,
}
,
}
,
}
\ No newline at end of file
pkg/params/testdata/env/globals/remove-component/out.libsonnet
View file @
fc1db176
local
params
=
std
.
extVar
(
"
__ksonnet/params
"
);
local
globals
=
import
"
globals.libsonnet
"
;
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 @
fc1db176
{
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 @
fc1db176
local
params
=
std
.
extVar
(
"
__ksonnet/params
"
);
local
globals
=
import
"
globals.libsonnet
"
;
local
params
=
std
.
extVar
(
'
__ksonnet/params
'
);
local
globals
=
import
'
globals.libsonnet
'
;
local
envParams
=
params
+
{
components
+:
{
guestbook
+:
{
name
:
"
guestbook-dev
"
,
replicas
:
params
.
global
.
replicas
name
:
'
guestbook-dev
'
,
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 @
fc1db176
local
params
=
std
.
extVar
(
"
__ksonnet/params
"
);
local
globals
=
import
"
globals.libsonnet
"
;
local
params
=
std
.
extVar
(
'
__ksonnet/params
'
);
local
globals
=
import
'
globals.libsonnet
'
;
local
envParams
=
params
+
{
components
+:
{
guestbook
+:
{
name
:
"
guestbook-dev
"
,
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