Skip to content

Commit ac5237b

Browse files
committed
Merge branch 'main' into ignition-25-92
2 parents 6bb638f + 5c7c765 commit ac5237b

File tree

369 files changed

+45335
-20091
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

369 files changed

+45335
-20091
lines changed

.github/ISSUE_TEMPLATE/release-checklist.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ Fedora packaging:
2525
- [ ] Run `kinit [email protected]`
2626
- [ ] Run `fedpkg new-sources $(spectool -S ignition.spec | sed 's:.*/::')`
2727
- [ ] PR the changes in [Fedora](https://src.fedoraproject.org/rpms/ignition)
28-
- [ ] Once the PR merges to rawhide, merge rawhide into the other relevant branches (e.g. f38) then push those, for example:
28+
- [ ] Once the PR merges to rawhide, merge rawhide into the other relevant branches (e.g. f39) then push those, for example:
2929
```bash
3030
git checkout rawhide
3131
git pull --ff-only
32-
git checkout f38
32+
git checkout f39
3333
git merge --ff-only rawhide
34-
git push origin f38
34+
git push origin f39
3535
```
3636
- [ ] On each of those branches run `fedpkg build` including rawhide.
3737
- [ ] Once the builds have finished, submit them to [bodhi](https://bodhi.fedoraproject.org/updates/new), filling in:

Dockerfile.validate

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.fedoraproject.org/fedora:38 AS builder
1+
FROM registry.fedoraproject.org/fedora:39 AS builder
22
RUN dnf install -y golang git-core
33
RUN mkdir /ignition-validate
44
COPY . /ignition-validate

config/shared/errors/errors.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ var (
8585
ErrInvalidProxy = errors.New("proxies must be http(s)")
8686
ErrInsecureProxy = errors.New("insecure plaintext HTTP proxy specified for HTTPS resources")
8787
ErrPathConflictsSystemd = errors.New("path conflicts with systemd unit or dropin")
88-
ErrPathConflictsParentDir = errors.New("path conflicts with parent directory of another file, link, or directory")
88+
ErrPathAlreadyExists = errors.New("path already exists")
89+
ErrMissLabeledDir = errors.New("parent directory path matches configured file, check path, and ensure parent directory is configured")
8990

9091
// Systemd section errors
9192
ErrInvalidSystemdExt = errors.New("invalid systemd unit extension")

config/v3_5_experimental/types/config.go

+34-33
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var (
3535
}
3636
)
3737

38+
var paths = map[string]struct{}{}
39+
3840
func (cfg Config) Validate(c path.ContextPath) (r report.Report) {
3941
systemdPath := "/etc/systemd/system/"
4042
unitPaths := map[string]struct{}{}
@@ -76,43 +78,21 @@ func (cfg Config) validateParents(c path.ContextPath) report.Report {
7678
Path string
7779
Field string
7880
}
79-
paths := map[string]struct{}{}
8081
r := report.Report{}
8182

8283
for i, f := range cfg.Storage.Files {
83-
if _, exists := paths[f.Path]; exists {
84-
r.AddOnError(c.Append("storage", "files", i, "path"), errors.ErrPathConflictsParentDir) //TODO: should add different error?
85-
return r
86-
}
87-
paths[f.Path] = struct{}{}
88-
entries = append(entries, struct {
89-
Path string
90-
Field string
91-
}{Path: f.Path, Field: "files"})
84+
r = handlePathConflict(f.Path, "files", i, c, r, errors.ErrPathAlreadyExists)
85+
addPathAndEntry(f.Path, "files", &entries)
9286
}
9387

9488
for i, d := range cfg.Storage.Directories {
95-
if _, exists := paths[d.Path]; exists {
96-
r.AddOnError(c.Append("storage", "directories", i, "path"), errors.ErrPathConflictsParentDir) //TODO: should add different error?
97-
return r
98-
}
99-
paths[d.Path] = struct{}{}
100-
entries = append(entries, struct {
101-
Path string
102-
Field string
103-
}{Path: d.Path, Field: "directories"})
89+
r = handlePathConflict(d.Path, "directories", i, c, r, errors.ErrPathAlreadyExists)
90+
addPathAndEntry(d.Path, "directories", &entries)
10491
}
10592

10693
for i, l := range cfg.Storage.Links {
107-
if _, exists := paths[l.Path]; exists {
108-
r.AddOnError(c.Append("storage", "links", i, "path"), errors.ErrPathConflictsParentDir) //TODO: error to already exist path
109-
return r
110-
}
111-
paths[l.Path] = struct{}{}
112-
entries = append(entries, struct {
113-
Path string
114-
Field string
115-
}{Path: l.Path, Field: "links"})
94+
r = handlePathConflict(l.Path, "links", i, c, r, errors.ErrPathAlreadyExists)
95+
addPathAndEntry(l.Path, "links", &entries)
11696
}
11797

11898
sort.Slice(entries, func(i, j int) bool {
@@ -122,7 +102,7 @@ func (cfg Config) validateParents(c path.ContextPath) report.Report {
122102
for i, entry := range entries {
123103
if i > 0 && isWithin(entry.Path, entries[i-1].Path) {
124104
if entries[i-1].Field != "directories" {
125-
r.AddOnError(c.Append("storage", entry.Field, i, "path"), errors.ErrPathConflictsParentDir) //TODO: conflict parent directories error
105+
r.AddOnError(c.Append("storage", entry.Field, i, "path"), errors.ErrMissLabeledDir)
126106
return r
127107
}
128108
}
@@ -131,16 +111,37 @@ func (cfg Config) validateParents(c path.ContextPath) report.Report {
131111
return r
132112
}
133113

134-
// check the depth
114+
func handlePathConflict(path, fieldName string, index int, c path.ContextPath, r report.Report, err error) report.Report {
115+
if _, exists := paths[path]; exists {
116+
r.AddOnError(c.Append("storage", fieldName, index, "path"), err)
117+
}
118+
return r
119+
}
120+
121+
func addPathAndEntry(path, fieldName string, entries *[]struct{ Path, Field string }) {
122+
*entries = append(*entries, struct {
123+
Path string
124+
Field string
125+
}{Path: path, Field: fieldName})
126+
}
127+
135128
func depth(path string) uint {
136129
var count uint
137-
for p := filepath.Clean(path); p != "/" && p != "."; count++ {
138-
p = filepath.Dir(p)
130+
cleanedPath := filepath.FromSlash(filepath.Clean(path))
131+
sep := string(filepath.Separator)
132+
133+
volume := filepath.VolumeName(cleanedPath)
134+
if volume != "" {
135+
cleanedPath = cleanedPath[len(volume):]
136+
}
137+
138+
for cleanedPath != sep && cleanedPath != "." {
139+
cleanedPath = filepath.Dir(cleanedPath)
140+
count++
139141
}
140142
return count
141143
}
142144

143-
// isWithin checks if newPath is within prevPath.
144145
func isWithin(newPath, prevPath string) bool {
145146
return strings.HasPrefix(newPath, prevPath) && newPath != prevPath
146147
}

config/v3_5_experimental/types/config_test.go

+18-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020

2121
"github.com/coreos/ignition/v2/config/shared/errors"
2222
"github.com/coreos/ignition/v2/config/util"
23-
2423
"github.com/coreos/vcontext/path"
2524
"github.com/coreos/vcontext/report"
2625
)
@@ -194,7 +193,7 @@ func TestConfigValidation(t *testing.T) {
194193
},
195194
},
196195
},
197-
out: errors.ErrPathConflictsParentDir,
196+
out: errors.ErrMissLabeledDir,
198197
at: path.New("json", "storage", "files", 1, "path"),
199198
},
200199

@@ -210,7 +209,7 @@ func TestConfigValidation(t *testing.T) {
210209
},
211210
},
212211
},
213-
out: errors.ErrPathConflictsParentDir,
212+
out: errors.ErrMissLabeledDir,
214213
at: path.New("json", "storage", "links", 1, "path"),
215214
},
216215

@@ -226,7 +225,7 @@ func TestConfigValidation(t *testing.T) {
226225
},
227226
},
228227
},
229-
out: errors.ErrPathConflictsParentDir,
228+
out: errors.ErrMissLabeledDir,
230229
at: path.New("json", "storage", "directories", 1, "path"),
231230
},
232231

@@ -333,3 +332,18 @@ func TestConfigValidation(t *testing.T) {
333332
}
334333
}
335334
}
335+
336+
func BenchmarkValidateParents(b *testing.B) {
337+
cfg := Config{
338+
Storage: Storage{
339+
Files: []File{
340+
{Node: Node{Path: "/foo/bar"}},
341+
{Node: Node{Path: "/foo/bar/baz"}},
342+
},
343+
},
344+
}
345+
346+
for i := 0; i < b.N; i++ {
347+
_ = cfg.validateParents(path.New("json"))
348+
}
349+
}

docs/release-notes.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ nav_order: 9
44

55
# Release Notes
66

7-
## Upcoming Ignition 2.18.0 (unreleased)
7+
## Upcoming Ignition 2.19.0 (unreleased)
8+
9+
### Breaking changes
10+
11+
### Features
12+
13+
- Support Akamai Connected Cloud (Linode)
14+
15+
### Changes
16+
17+
### Bug fixes
18+
19+
## Ignition 2.18.0 (2024-03-01)
820

921
### Breaking changes
1022

@@ -13,6 +25,7 @@ nav_order: 9
1325

1426
### Features
1527

28+
- Support Scaleway
1629

1730

1831
### Changes
@@ -23,6 +36,7 @@ nav_order: 9
2336

2437
- Fix failure when config only disables units already disabled
2538
- Fix validation to catch conflicts with the parent directory of another file, link or directories
39+
- Retry HTTP requests on Azure on status codes 404, 410, and 429
2640

2741

2842
## Ignition 2.17.0 (2023-11-20)

docs/supported-platforms.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ nav_order: 8
66

77
Ignition is currently only supported for the following platforms:
88

9+
* [Akamai Connected Cloud] (`akamai`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys and network configuration are handled separately.
910
* [Alibaba Cloud] (`aliyun`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
1011
* [Apple Hypervisor] (`applehv`) - Ignition will read its configuration using an HTTP GET over a vsock connection with its host on port 1024.
1112
* [Amazon Web Services] (`aws`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
@@ -26,6 +27,7 @@ Ignition is currently only supported for the following platforms:
2627
* [Equinix Metal] (`packet`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
2728
* [IBM Power Systems Virtual Server] (`powervs`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
2829
* [QEMU] (`qemu`) - Ignition will read its configuration from the 'opt/com.coreos/config' key on the QEMU Firmware Configuration Device (available in QEMU 2.4.0 and higher).
30+
* [Scaleway] (`scaleway`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
2931
* [VirtualBox] (`virtualbox`) - Use the VirtualBox guest property `/Ignition/Config` to provide the config to the virtual machine.
3032
* [VMware] (`vmware`) - Use the VMware Guestinfo variables `ignition.config.data` and `ignition.config.data.encoding` to provide the config and its encoding to the virtual machine. Valid encodings are "", "base64", and "gzip+base64". Guestinfo variables can be provided directly or via an OVF environment, with priority given to variables specified directly.
3133
* [Vultr] (`vultr`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
@@ -35,6 +37,7 @@ Ignition is under active development, so this list may grow over time.
3537

3638
For most cloud providers, cloud SSH keys and custom network configuration are handled by [Afterburn].
3739

40+
[Akamai Connected Cloud]: https://www.linode.com
3841
[Alibaba Cloud]: https://www.alibabacloud.com/product/ecs
3942
[Apple Hypervisor]: https://developer.apple.com/documentation/hypervisor
4043
[Amazon Web Services]: https://aws.amazon.com/ec2/
@@ -54,6 +57,7 @@ For most cloud providers, cloud SSH keys and custom network configuration are ha
5457
[Equinix Metal]: https://metal.equinix.com/product/
5558
[IBM Power Systems Virtual Server]: https://www.ibm.com/products/power-virtual-server
5659
[QEMU]: https://www.qemu.org/
60+
[Scaleway]: https://www.scaleway.com
5761
[VirtualBox]: https://www.virtualbox.org/
5862
[VMware]: https://www.vmware.com/
5963
[Vultr]: https://www.vultr.com/products/cloud-compute/

go.mod

+27-29
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,61 @@ go 1.20
44

55
require (
66
cloud.google.com/go/compute/metadata v0.2.3
7-
cloud.google.com/go/storage v1.36.0
8-
github.com/aws/aws-sdk-go v1.49.16
7+
cloud.google.com/go/storage v1.40.0
8+
github.com/aws/aws-sdk-go v1.51.16
99
github.com/beevik/etree v1.3.0
10-
github.com/containers/libhvee v0.6.0
10+
github.com/containers/libhvee v0.7.1
1111
github.com/coreos/go-semver v0.3.1
1212
github.com/coreos/go-systemd/v22 v22.5.0
1313
github.com/coreos/vcontext v0.0.0-20230201181013-d72178a18687
1414
github.com/google/renameio/v2 v2.0.0
15-
github.com/google/uuid v1.5.0
15+
github.com/google/uuid v1.6.0
1616
github.com/mdlayher/vsock v1.2.1
1717
github.com/mitchellh/copystructure v1.2.0
1818
github.com/pin/tftp v2.1.0+incompatible
1919
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
20-
github.com/stretchr/testify v1.8.4
20+
github.com/stretchr/testify v1.9.0
2121
github.com/vincent-petithory/dataurl v1.0.0
2222
github.com/vmware/vmw-guestinfo v0.0.0-20220317130741-510905f0efa3
23-
golang.org/x/net v0.19.0
24-
golang.org/x/oauth2 v0.15.0
25-
golang.org/x/sys v0.16.0
26-
google.golang.org/api v0.155.0
23+
golang.org/x/net v0.24.0
24+
golang.org/x/oauth2 v0.19.0
25+
golang.org/x/sys v0.19.0
26+
google.golang.org/api v0.172.0
2727
gopkg.in/yaml.v3 v3.0.1
2828
)
2929

3030
require (
31-
cloud.google.com/go v0.110.10 // indirect
32-
cloud.google.com/go/compute v1.23.3 // indirect
33-
cloud.google.com/go/iam v1.1.5 // indirect
31+
cloud.google.com/go v0.112.1 // indirect
32+
cloud.google.com/go/compute v1.24.0 // indirect
33+
cloud.google.com/go/iam v1.1.7 // indirect
3434
github.com/coreos/go-json v0.0.0-20230131223807-18775e0fb4fb // indirect
3535
github.com/davecgh/go-spew v1.1.1 // indirect
3636
github.com/felixge/httpsnoop v1.0.4 // indirect
37-
github.com/go-logr/logr v1.3.0 // indirect
37+
github.com/go-logr/logr v1.4.1 // indirect
3838
github.com/go-logr/stdr v1.2.2 // indirect
3939
github.com/godbus/dbus/v5 v5.0.4 // indirect
4040
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
41-
github.com/golang/protobuf v1.5.3 // indirect
41+
github.com/golang/protobuf v1.5.4 // indirect
4242
github.com/google/s2a-go v0.1.7 // indirect
4343
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
44-
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
44+
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
4545
github.com/jmespath/go-jmespath v0.4.0 // indirect
4646
github.com/mdlayher/socket v0.4.1 // indirect
4747
github.com/mitchellh/reflectwalk v1.0.2 // indirect
4848
github.com/pmezard/go-difflib v1.0.0 // indirect
4949
go.opencensus.io v0.24.0 // indirect
50-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
51-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
52-
go.opentelemetry.io/otel v1.21.0 // indirect
53-
go.opentelemetry.io/otel/metric v1.21.0 // indirect
54-
go.opentelemetry.io/otel/trace v1.21.0 // indirect
55-
golang.org/x/crypto v0.17.0 // indirect
56-
golang.org/x/sync v0.5.0 // indirect
50+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
51+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
52+
go.opentelemetry.io/otel v1.24.0 // indirect
53+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
54+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
55+
golang.org/x/crypto v0.22.0 // indirect
56+
golang.org/x/sync v0.6.0 // indirect
5757
golang.org/x/text v0.14.0 // indirect
5858
golang.org/x/time v0.5.0 // indirect
59-
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
60-
google.golang.org/appengine v1.6.8 // indirect
61-
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
62-
google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 // indirect
63-
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect
64-
google.golang.org/grpc v1.60.1 // indirect
65-
google.golang.org/protobuf v1.31.0 // indirect
59+
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
60+
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
61+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
62+
google.golang.org/grpc v1.62.1 // indirect
63+
google.golang.org/protobuf v1.33.0 // indirect
6664
)

0 commit comments

Comments
 (0)