Skip to content
This repository was archived by the owner on Sep 18, 2020. It is now read-only.

Commit a34e54d

Browse files
authored
Merge pull request #111 from ajeddeloh/update-ignition
Update Ignition to v0.19.0
2 parents 7824ae0 + 7c1ac5c commit a34e54d

File tree

25 files changed

+158
-101
lines changed

25 files changed

+158
-101
lines changed

config/astyaml/astyaml.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121

2222
yaml "github.com/ajeddeloh/yaml"
23-
"github.com/coreos/ignition/config/validate"
23+
"github.com/coreos/ignition/config/validate/astnode"
2424
)
2525

2626
var (
@@ -59,7 +59,7 @@ func (n YamlNode) LiteralValue() interface{} {
5959
return n.Value
6060
}
6161

62-
func (n YamlNode) SliceChild(index int) (validate.AstNode, bool) {
62+
func (n YamlNode) SliceChild(index int) (astnode.AstNode, bool) {
6363
if n.Kind != yaml.SequenceNode {
6464
return nil, false
6565
}
@@ -74,12 +74,12 @@ func (n YamlNode) SliceChild(index int) (validate.AstNode, bool) {
7474
}, true
7575
}
7676

77-
func (n YamlNode) KeyValueMap() (map[string]validate.AstNode, bool) {
77+
func (n YamlNode) KeyValueMap() (map[string]astnode.AstNode, bool) {
7878
if n.Kind != yaml.MappingNode {
7979
return nil, false
8080
}
8181

82-
kvmap := map[string]validate.AstNode{}
82+
kvmap := map[string]astnode.AstNode{}
8383
for i := 0; i < len(n.Children); i += 2 {
8484
key := *n.Children[i]
8585
if n.tag == "json" {

config/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ import (
2323
"github.com/coreos/container-linux-config-transpiler/config/types"
2424
ignTypes "github.com/coreos/ignition/config/v2_1/types"
2525
"github.com/coreos/ignition/config/validate"
26+
"github.com/coreos/ignition/config/validate/astnode"
2627
"github.com/coreos/ignition/config/validate/report"
2728
)
2829

2930
// Parse will convert a byte slice containing a Container Linux Config into a
3031
// golang struct representing the config, the parse tree from parsing the yaml
3132
// and a report of any warnings or errors that occurred during the parsing.
32-
func Parse(data []byte) (types.Config, validate.AstNode, report.Report) {
33+
func Parse(data []byte) (types.Config, astnode.AstNode, report.Report) {
3334
var cfg types.Config
3435
var r report.Report
3536

@@ -38,7 +39,7 @@ func Parse(data []byte) (types.Config, validate.AstNode, report.Report) {
3839
}
3940

4041
nodes := yaml.UnmarshalToNode(data)
41-
var root validate.AstNode
42+
var root astnode.AstNode
4243
if nodes == nil {
4344
r.Add(report.Entry{
4445
Kind: report.EntryWarning,
@@ -67,7 +68,7 @@ func Parse(data []byte) (types.Config, validate.AstNode, report.Report) {
6768
// ConvertAs2_0 also accepts a platform string, which can either be one of the
6869
// platform strings defined in config/templating/templating.go or an empty
6970
// string if [dynamic data](doc/dynamic-data.md) isn't used.
70-
func ConvertAs2_0(in types.Config, p string, ast validate.AstNode) (ignTypes.Config, report.Report) {
71+
func ConvertAs2_0(in types.Config, p string, ast astnode.AstNode) (ignTypes.Config, report.Report) {
7172
if !platform.IsSupportedPlatform(p) {
7273
r := report.Report{}
7374
r.Add(report.Entry{

config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,13 +1691,13 @@ storage:
16911691
Message: "path not absolute",
16921692
Kind: report.EntryError,
16931693
Line: 4,
1694-
Column: 7,
1694+
Column: 13,
16951695
},
16961696
{
16971697
Message: "invalid url \"httpz://example.com/file2\": invalid url scheme",
16981698
Kind: report.EntryError,
16991699
Line: 17,
1700-
Column: 11,
1700+
Column: 16,
17011701
},
17021702
}},
17031703
},

config/types/common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/coreos/container-linux-config-transpiler/config/platform"
2626
"github.com/coreos/container-linux-config-transpiler/config/templating"
2727
"github.com/coreos/container-linux-config-transpiler/config/types/util"
28-
"github.com/coreos/ignition/config/validate"
28+
"github.com/coreos/ignition/config/validate/astnode"
2929
)
3030

3131
var (
@@ -36,7 +36,7 @@ var (
3636
)
3737

3838
func init() {
39-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, p string) (ignTypes.Config, report.Report, validate.AstNode) {
39+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, p string) (ignTypes.Config, report.Report, astnode.AstNode) {
4040
if p == platform.OpenStackMetadata || p == platform.CloudStackConfigDrive {
4141
out.Systemd.Units = append(out.Systemd.Units, ignTypes.Unit{
4242
Name: "coreos-metadata.service",
@@ -130,7 +130,7 @@ func getCliArgs(e interface{}) []string {
130130

131131
// Get returns the value for key, where key is an int or string and n is a
132132
// sequence node or mapping node, respectively.
133-
func getNodeChild(n validate.AstNode, key interface{}) (validate.AstNode, error) {
133+
func getNodeChild(n astnode.AstNode, key interface{}) (astnode.AstNode, error) {
134134
if n == nil {
135135
return nil, ErrNilNode
136136
}
@@ -155,7 +155,7 @@ func getNodeChild(n validate.AstNode, key interface{}) (validate.AstNode, error)
155155
}
156156

157157
// GetPath works like calling Get() repeatly with each argument.
158-
func getNodeChildPath(n validate.AstNode, key ...interface{}) (validate.AstNode, error) {
158+
func getNodeChildPath(n astnode.AstNode, key ...interface{}) (astnode.AstNode, error) {
159159
if len(key) == 0 {
160160
return n, nil
161161
}

config/types/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"net/url"
1919

2020
ignTypes "github.com/coreos/ignition/config/v2_1/types"
21-
"github.com/coreos/ignition/config/validate"
21+
"github.com/coreos/ignition/config/validate/astnode"
2222
"github.com/coreos/ignition/config/validate/report"
2323
)
2424

@@ -56,7 +56,7 @@ type Timeouts struct {
5656
}
5757

5858
func init() {
59-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
59+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
6060
r := report.Report{}
6161
out.Ignition.Timeouts.HTTPResponseHeaders = in.Ignition.Timeouts.HTTPResponseHeaders
6262
out.Ignition.Timeouts.HTTPTotal = in.Ignition.Timeouts.HTTPTotal
@@ -86,7 +86,7 @@ func init() {
8686
})
8787
}
8888

89-
func convertConfigReference(in ConfigReference, ast validate.AstNode) (ignTypes.ConfigReference, report.Report) {
89+
func convertConfigReference(in ConfigReference, ast astnode.AstNode) (ignTypes.ConfigReference, report.Report) {
9090
_, err := url.Parse(in.Source)
9191
if err != nil {
9292
r := report.ReportFromError(err, report.EntryError)

config/types/converter.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,19 @@ import (
2020
"github.com/coreos/container-linux-config-transpiler/config/astyaml"
2121
ignTypes "github.com/coreos/ignition/config/v2_1/types"
2222
"github.com/coreos/ignition/config/validate"
23+
"github.com/coreos/ignition/config/validate/astnode"
2324
"github.com/coreos/ignition/config/validate/report"
2425
)
2526

26-
type converterFor2_0 func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode)
27+
type converterFor2_0 func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode)
2728

2829
var convertersFor2_0 []converterFor2_0
2930

3031
func register2_0(f converterFor2_0) {
3132
convertersFor2_0 = append(convertersFor2_0, f)
3233
}
3334

34-
func ConvertAs2_0(in Config, platform string, ast validate.AstNode) (ignTypes.Config, report.Report) {
35+
func ConvertAs2_0(in Config, platform string, ast astnode.AstNode) (ignTypes.Config, report.Report) {
3536
// convert our tree from having yaml tags to having json tags, so when Validate() is
3637
// called on the tree, it can find the keys in the ignition structs (which are denoted
3738
// by `json` tags)

config/types/disks.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
"github.com/alecthomas/units"
2121
ignTypes "github.com/coreos/ignition/config/v2_1/types"
22-
"github.com/coreos/ignition/config/validate"
22+
"github.com/coreos/ignition/config/validate/astnode"
2323
"github.com/coreos/ignition/config/validate/report"
2424
)
2525

@@ -52,7 +52,7 @@ type Partition struct {
5252
}
5353

5454
func init() {
55-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
55+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
5656
r := report.Report{}
5757
for disk_idx, disk := range in.Storage.Disks {
5858
newDisk := ignTypes.Disk{

config/types/docker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"strings"
2020

2121
ignTypes "github.com/coreos/ignition/config/v2_1/types"
22-
"github.com/coreos/ignition/config/validate"
22+
"github.com/coreos/ignition/config/validate/astnode"
2323
"github.com/coreos/ignition/config/validate/report"
2424
)
2525

@@ -28,7 +28,7 @@ type Docker struct {
2828
}
2929

3030
func init() {
31-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
31+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
3232
if in.Docker != nil {
3333
contents := fmt.Sprintf("[Service]\nEnvironment=\"DOCKER_OPTS=%s\"", strings.Join(in.Docker.Flags, " "))
3434
out.Systemd.Units = append(out.Systemd.Units, ignTypes.Unit{

config/types/etcd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
"github.com/coreos/go-semver/semver"
2222
ignTypes "github.com/coreos/ignition/config/v2_1/types"
23-
"github.com/coreos/ignition/config/validate"
23+
"github.com/coreos/ignition/config/validate/astnode"
2424
"github.com/coreos/ignition/config/validate/report"
2525
)
2626

@@ -119,7 +119,7 @@ func (etcd *Etcd) UnmarshalYAML(unmarshal func(interface{}) error) error {
119119
}
120120

121121
func init() {
122-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
122+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
123123
if in.Etcd != nil {
124124
contents, err := etcdContents(*in.Etcd, platform)
125125
if err != nil {

config/types/files.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/coreos/container-linux-config-transpiler/config/astyaml"
2121

2222
ignTypes "github.com/coreos/ignition/config/v2_1/types"
23-
"github.com/coreos/ignition/config/validate"
23+
"github.com/coreos/ignition/config/validate/astnode"
2424
"github.com/coreos/ignition/config/validate/report"
2525
"github.com/vincent-petithory/dataurl"
2626
)
@@ -73,7 +73,7 @@ type Link struct {
7373
}
7474

7575
func init() {
76-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
76+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
7777
r := report.Report{}
7878
files_node, _ := getNodeChildPath(ast, "storage", "files")
7979
for i, file := range in.Storage.Files {

config/types/filesystems.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package types
1616

1717
import (
1818
ignTypes "github.com/coreos/ignition/config/v2_1/types"
19-
"github.com/coreos/ignition/config/validate"
19+
"github.com/coreos/ignition/config/validate/astnode"
2020
"github.com/coreos/ignition/config/validate/report"
2121
)
2222

@@ -42,7 +42,7 @@ type Create struct {
4242
}
4343

4444
func init() {
45-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
45+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
4646
r := report.Report{}
4747
for _, filesystem := range in.Storage.Filesystems {
4848
newFilesystem := ignTypes.Filesystem{

config/types/flannel.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/coreos/go-semver/semver"
99
ignTypes "github.com/coreos/ignition/config/v2_1/types"
10-
"github.com/coreos/ignition/config/validate"
10+
"github.com/coreos/ignition/config/validate/astnode"
1111
"github.com/coreos/ignition/config/validate/report"
1212
)
1313

@@ -115,7 +115,7 @@ func (flannel *Flannel) UnmarshalYAML(unmarshal func(interface{}) error) error {
115115
}
116116

117117
func init() {
118-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
118+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
119119
if in.Flannel != nil {
120120
contents, err := flannelContents(*in.Flannel, platform)
121121
if err != nil {

config/types/networkd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package types
1616

1717
import (
1818
ignTypes "github.com/coreos/ignition/config/v2_1/types"
19-
"github.com/coreos/ignition/config/validate"
19+
"github.com/coreos/ignition/config/validate/astnode"
2020
"github.com/coreos/ignition/config/validate/report"
2121
)
2222

@@ -30,7 +30,7 @@ type NetworkdUnit struct {
3030
}
3131

3232
func init() {
33-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
33+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
3434
for _, unit := range in.Networkd.Units {
3535
out.Networkd.Units = append(out.Networkd.Units, ignTypes.Networkdunit{
3636
Name: unit.Name,

config/types/passwd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package types
1616

1717
import (
1818
ignTypes "github.com/coreos/ignition/config/v2_1/types"
19-
"github.com/coreos/ignition/config/validate"
19+
"github.com/coreos/ignition/config/validate/astnode"
2020
"github.com/coreos/ignition/config/validate/report"
2121
)
2222

@@ -63,7 +63,7 @@ type Group struct {
6363
}
6464

6565
func init() {
66-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
66+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
6767
for _, user := range in.Passwd.Users {
6868
newUser := ignTypes.PasswdUser{
6969
Name: user.Name,

config/types/raid.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package types
1616

1717
import (
1818
ignTypes "github.com/coreos/ignition/config/v2_1/types"
19-
"github.com/coreos/ignition/config/validate"
19+
"github.com/coreos/ignition/config/validate/astnode"
2020
"github.com/coreos/ignition/config/validate/report"
2121
)
2222

@@ -28,7 +28,7 @@ type Raid struct {
2828
}
2929

3030
func init() {
31-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
31+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
3232
for _, array := range in.Storage.Arrays {
3333
newArray := ignTypes.Raid{
3434
Name: array.Name,

config/types/systemd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package types
1616

1717
import (
1818
ignTypes "github.com/coreos/ignition/config/v2_1/types"
19-
"github.com/coreos/ignition/config/validate"
19+
"github.com/coreos/ignition/config/validate/astnode"
2020
"github.com/coreos/ignition/config/validate/report"
2121
)
2222

@@ -39,7 +39,7 @@ type SystemdUnitDropIn struct {
3939
}
4040

4141
func init() {
42-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
42+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
4343
for _, unit := range in.Systemd.Units {
4444
newUnit := ignTypes.Unit{
4545
Name: unit.Name,

config/types/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"strings"
2222

2323
ignTypes "github.com/coreos/ignition/config/v2_1/types"
24-
"github.com/coreos/ignition/config/validate"
24+
"github.com/coreos/ignition/config/validate/astnode"
2525
"github.com/coreos/ignition/config/validate/report"
2626
"github.com/vincent-petithory/dataurl"
2727
)
@@ -59,7 +59,7 @@ func (s UpdateServer) Validate() report.Report {
5959
}
6060

6161
func init() {
62-
register2_0(func(in Config, ast validate.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, validate.AstNode) {
62+
register2_0(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
6363
var contents string
6464
if in.Update != nil {
6565
if in.Update.Group != "" {

glide.lock

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import:
55
- package: github.com/alecthomas/units
66
version: 6b4e7dc5e3143b85ea77909c72caf89416fc2915
77
- package: github.com/coreos/ignition
8-
version: v0.17.2
8+
version: v0.19.0
99
subpackages:
1010
- config/types
1111
- config/validate

0 commit comments

Comments
 (0)