Skip to content

Commit

Permalink
Merge branch 'coreos:main' into user-units
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemric committed Mar 31, 2022
2 parents 07d1f1a + 53fad9f commit 6c5b8c0
Show file tree
Hide file tree
Showing 26 changed files with 163 additions and 164 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,32 @@ name: Container
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]

permissions:
contents: read

# avoid races when pushing containers built from main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
build-container:
name: Build container image
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Build container image
run: podman build -f Dockerfile.validate .
with:
# fetch tags so the compiled-in version number is useful
fetch-depth: 0
- name: Build and push container
uses: coreos/actions-lib/build-container@main
with:
credentials: ${{ secrets.QUAY_AUTH }}
file: Dockerfile.validate
push: quay.io/coreos/ignition-validate
# Speed up PR CI by skipping arm64
pr-arches: amd64
10 changes: 6 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: test build
strategy:
matrix:
go-version: [1.15.x, 1.16.x, 1.17.x]
go-version: [1.15.x, 1.16.x, 1.17.x, 1.18.x]
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
Expand All @@ -24,19 +24,21 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Install libblkid-dev
run: sudo apt-get install libblkid-dev
run: |
sudo apt-get update
sudo apt-get install libblkid-dev
- name: Run tests
run: ./test
- name: Run linter
uses: golangci/golangci-lint-action@v2
with:
version: v1.42.0
version: v1.45.0
args: -E=gofmt --timeout=30m0s
test-validate:
name: test ignition-validate
strategy:
matrix:
go-version: [1.17.x]
go-version: [1.18.x]
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.validate
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM registry.fedoraproject.org/fedora:35 AS builder
RUN dnf install -y golang git
RUN dnf install -y golang git-core
RUN mkdir /ignition-validate
COPY . /ignition-validate
WORKDIR /ignition-validate
Expand Down
1 change: 0 additions & 1 deletion build_for_container
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ export GO11MODULE=on
export CGO_ENABLED=0
export GOFLAGS='-mod=vendor'
export GOOS=linux
export GOARCH=amd64

go build -ldflags "${GLDFLAGS}" -o ${BIN_PATH}/ignition-validate ${REPO_PATH}/validate
5 changes: 2 additions & 3 deletions config/v3_1/types/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package types

import (
"strings"
"testing"

"github.com/coreos/ignition/v2/config/shared/errors"
Expand Down Expand Up @@ -133,7 +132,7 @@ func TestValidHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value"}) || !equal(parseHeaders[strings.Title("header2")], []string{"header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value"}) || !equal(parseHeaders["Header2"], []string{"header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
Expand All @@ -154,7 +153,7 @@ func TestDuplicateHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value", "header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value", "header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
5 changes: 2 additions & 3 deletions config/v3_2/types/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package types

import (
"strings"
"testing"

"github.com/coreos/ignition/v2/config/shared/errors"
Expand Down Expand Up @@ -133,7 +132,7 @@ func TestValidHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value"}) || !equal(parseHeaders[strings.Title("header2")], []string{"header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value"}) || !equal(parseHeaders["Header2"], []string{"header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
Expand All @@ -154,7 +153,7 @@ func TestDuplicateHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value", "header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value", "header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
5 changes: 2 additions & 3 deletions config/v3_3/types/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package types

import (
"strings"
"testing"

"github.com/coreos/ignition/v2/config/shared/errors"
Expand Down Expand Up @@ -133,7 +132,7 @@ func TestValidHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value"}) || !equal(parseHeaders[strings.Title("header2")], []string{"header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value"}) || !equal(parseHeaders["Header2"], []string{"header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
Expand All @@ -154,7 +153,7 @@ func TestDuplicateHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value", "header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value", "header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
5 changes: 2 additions & 3 deletions config/v3_4_experimental/types/headers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package types

import (
"strings"
"testing"

"github.com/coreos/ignition/v2/config/shared/errors"
Expand Down Expand Up @@ -133,7 +132,7 @@ func TestValidHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value"}) || !equal(parseHeaders[strings.Title("header2")], []string{"header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value"}) || !equal(parseHeaders["Header2"], []string{"header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
Expand All @@ -154,7 +153,7 @@ func TestDuplicateHeadersParse(t *testing.T) {
if err != nil {
t.Errorf("error during parsing valid headers: %v", err)
}
if !equal(parseHeaders[strings.Title("header1")], []string{"header1value", "header2value"}) {
if !equal(parseHeaders["Header1"], []string{"header1value", "header2value"}) {
t.Errorf("parsed HTTP headers values are wrong")
}
}
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-disks.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Ignition (disks)
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
Expand Down
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-fetch-offline.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[Unit]
Description=Ignition (fetch-offline)
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
Expand Down
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-fetch.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Ignition (fetch)
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
Expand Down
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-files.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Ignition (files)
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
Expand Down
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-kargs.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Ignition (kargs)
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
Expand Down
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-mount.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Ignition (mount)
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
Expand Down
2 changes: 1 addition & 1 deletion dracut/30ignition/ignition-remount-sysroot.service
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Unit]
Description=Remount /sysroot read-write for Ignition
Documentation=https://github.com/coreos/ignition
Documentation=https://coreos.github.io/ignition/
ConditionPathExists=/etc/initrd-release
# Some Linux Distributions don't pass a rw option on the kernel
# commandline and thus mount the root filesystem ro by default. In
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
github.com/stretchr/testify v1.7.0
github.com/vincent-petithory/dataurl v1.0.0
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728
github.com/vmware/vmw-guestinfo v0.0.0-20220317130741-510905f0efa3
github.com/vmware/vmw-ovflib v0.0.0-20170608004843-1f217b9dc714
go.opencensus.io v0.22.5 // indirect
golang.org/x/net v0.0.0-20200602114024-627f9648deb9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/vincent-petithory/dataurl v1.0.0 h1:cXw+kPto8NLuJtlMsI152irrVw9fRDX8AbShPRpg2CI=
github.com/vincent-petithory/dataurl v1.0.0/go.mod h1:FHafX5vmDzyP+1CQATJn7WFKc9CvnvxyvZy6I1MrG/U=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728 h1:sH9mEk+flyDxiUa5BuPiuhDETMbzrt9A20I2wktMvRQ=
github.com/vmware/vmw-guestinfo v0.0.0-20170707015358-25eff159a728/go.mod h1:x9oS4Wk2s2u4tS29nEaDLdzvuHdB19CvSGJjPgkZJNk=
github.com/vmware/vmw-guestinfo v0.0.0-20220317130741-510905f0efa3 h1:v6jG/tdl4O07LNVp74Nt7/OyL+1JsIW1M2f/nSvQheY=
github.com/vmware/vmw-guestinfo v0.0.0-20220317130741-510905f0efa3/go.mod h1:CSBTxrhePCm0cmXNKDGeu+6bOQzpaEklfCqEpn89JWk=
github.com/vmware/vmw-ovflib v0.0.0-20170608004843-1f217b9dc714 h1:wJqF3m4Tj8I4beSi6vGxIyNtsq6wwGqhK3UnA99ltL4=
github.com/vmware/vmw-ovflib v0.0.0-20170608004843-1f217b9dc714/go.mod h1:jiPk45kn7klhByRvUq5i2vo1RtHKBHj+iWGFpxbXuuI=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
2 changes: 1 addition & 1 deletion internal/providers/vmware/vmware_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

func FetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
if isVM, err := vmcheck.IsVirtualWorld(); err != nil {
if isVM, err := vmcheck.IsVirtualWorld(true); err != nil {
return types.Config{}, report.Report{}, err
} else if !isVM {
return types.Config{}, report.Report{}, providers.ErrNoProvider
Expand Down
2 changes: 1 addition & 1 deletion internal/resource/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ func (f *Fetcher) fetchFromS3WithCreds(ctx context.Context, dest s3target, input
return err
}

awsConfig := aws.NewConfig().WithHTTPClient(httpClient)
awsConfig := aws.NewConfig().WithHTTPClient(httpClient).WithUseDualStack(true)
s3Client := s3.New(sess, awsConfig)
downloader := s3manager.NewDownloaderWithClient(s3Client)
if _, err := downloader.DownloadWithContext(ctx, dest, input); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions vendor/github.com/vmware/vmw-guestinfo/bdoor/bdoor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c5b8c0

Please sign in to comment.