Skip to content

Commit 6f26716

Browse files
committed
Move the schema/ package to the toplevel
Today, we have *three* Go modules in this repository: - / - schema/ - mantle/ And as of recently, both the toplevel / and mantle/ vendor the schema/. This causes "vendor amplification", where a vendored dependency of schema/ gets *triplicated*. Now that gangplank/ is out of the picture, it makes sense to move the bits from schema/ into the toplevel module. This really helps make operating on coreos-assembler stuff feel like a "first class" operation. Also, we no longer have two copies of the schema file!
1 parent a1d59bd commit 6f26716

File tree

419 files changed

+26
-206135
lines changed

Some content is hidden

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

419 files changed

+26
-206135
lines changed

.github/workflows/lints.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,3 @@ jobs:
3636
version: v1.46.2
3737
working-directory: mantle
3838
args: --timeout=5m
39-
- name: golangci-lint
40-
uses: golangci/golangci-lint-action@v3
41-
with:
42-
version: v1.46.2
43-
working-directory: schema
44-
args: --timeout=5m

Makefile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tests_checked:=$(patsubst tests/%,tests/.%.shellchecked,${tests})
2323
cwd:=$(shell find . -maxdepth 1 -type f -executable -print)
2424
cwd_checked:=$(patsubst ./%,.%.shellchecked,${cwd})
2525
GOARCH:=$(shell uname -m)
26-
export COSA_META_SCHEMA:=$(shell pwd)/src/v1.json
26+
export COSA_META_SCHEMA:=$(shell pwd)/schema/v1.json
2727
ifeq ($(GOARCH),x86_64)
2828
GOARCH="amd64"
2929
else ifeq ($(GOARCH),aarch64)
@@ -86,22 +86,19 @@ schema:
8686
$(MAKE) -C schema
8787

8888
# To update the coreos-assembler schema:
89-
# Edit src/v1.json
90-
# $ cp src/v1.json schema/
89+
# Edit schema/v1.json
9190
# $ make schema
9291
# $ (cd mantle && go mod vendor)
9392
.PHONY: schema-check
94-
schema-check: DIGEST = $(shell sha256sum src/v1.json | awk '{print $$1}')
93+
schema-check: DIGEST = $(shell sha256sum schema/v1.json | awk '{print $$1}')
9594
schema-check:
96-
# Are the JSON Schema copies synced with each other?
97-
diff -u src/v1.json schema/v1.json
9895
# Is the generated Go code synced with the schema?
99-
grep -q "$(DIGEST)" schema/cosa/cosa_v1.go
100-
grep -q "$(DIGEST)" schema/cosa/schema_doc.go
96+
grep -q "$(DIGEST)" pkg/cosa/cosa_v1.go
97+
grep -q "$(DIGEST)" pkg/cosa/schema_doc.go
10198
# Are the vendored copies of the generated code synced with the
10299
# canonical ones?
103-
diff -u mantle/vendor/github.com/coreos/coreos-assembler-schema/cosa/cosa_v1.go schema/cosa/cosa_v1.go
104-
diff -u mantle/vendor/github.com/coreos/coreos-assembler-schema/cosa/schema_doc.go schema/cosa/schema_doc.go
100+
diff -u mantle/vendor/github.com/coreos/coreos-assembler/pkg/cosa/cosa_v1.go pkg/cosa/cosa_v1.go
101+
diff -u mantle/vendor/github.com/coreos/coreos-assembler/pkg/cosa/schema_doc.go pkg/cosa/schema_doc.go
105102

106103
install:
107104
install -d $(DESTDIR)$(PREFIX)/lib/coreos-assembler
@@ -111,6 +108,7 @@ install:
111108
cp -df -t $(DESTDIR)$(PREFIX)/lib/coreos-assembler/ci $$(find ci/ -maxdepth 1 -type f)
112109
install -d $(DESTDIR)$(PREFIX)/lib/coreos-assembler/cosalib
113110
install -D -t $(DESTDIR)$(PREFIX)/lib/coreos-assembler/cosalib $$(find src/cosalib/ -maxdepth 1 -type f)
111+
install -t $(DESTDIR)$(PREFIX)/lib/coreos-assembler schema/v1.json
114112
install -d $(DESTDIR)$(PREFIX)/bin
115113
install bin/coreos-assembler $(DESTDIR)$(PREFIX)/bin/
116114
ln -sf ../lib/coreos-assembler/cp-reflink $(DESTDIR)$(PREFIX)/bin/

cmd/build-extensions-container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os/exec"
66

7-
"github.com/coreos/coreos-assembler-schema/cosa"
7+
"github.com/coreos/coreos-assembler/pkg/cosa"
88
"github.com/coreos/coreos-assembler/internal/pkg/cosash"
99

1010
"crypto/sha256"

go.mod

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ go 1.17
55
require github.com/spf13/cobra v1.5.0
66

77
require (
8-
github.com/pkg/errors v0.9.1 // indirect
9-
github.com/sirupsen/logrus v1.9.0 // indirect
8+
github.com/pkg/errors v0.9.1
9+
github.com/sirupsen/logrus v1.9.0
1010
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
1111
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
12-
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
12+
github.com/xeipuuv/gojsonschema v1.2.0
1313
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
1414
)
1515

1616
require (
17-
github.com/coreos/coreos-assembler-schema v0.0.0-00010101000000-000000000000
1817
github.com/inconshreveable/mousetrap v1.0.0 // indirect
1918
github.com/spf13/pflag v1.0.5 // indirect
2019
)
21-
22-
replace github.com/coreos/coreos-assembler-schema => ./schema

mantle/cmd/kola/kola.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
"github.com/pkg/errors"
3232
"github.com/spf13/cobra"
3333

34-
"github.com/coreos/coreos-assembler-schema/cosa"
34+
"github.com/coreos/coreos-assembler/pkg/cosa"
3535
"github.com/coreos/mantle/cli"
3636
"github.com/coreos/mantle/fcos"
3737
"github.com/coreos/mantle/harness/reporters"

mantle/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/aliyun/aliyun-oss-go-sdk v2.0.3+incompatible
1313
github.com/aws/aws-sdk-go v1.34.28
1414
github.com/coreos/butane v0.15.0
15-
github.com/coreos/coreos-assembler-schema v0.0.0-00010101000000-000000000000
15+
github.com/coreos/coreos-assembler v0.14.0
1616
github.com/coreos/go-semver v0.3.0
1717
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e
1818
github.com/coreos/go-systemd/v22 v22.0.0
@@ -85,6 +85,6 @@ require (
8585
)
8686

8787
replace (
88-
github.com/coreos/coreos-assembler-schema => ../schema
88+
github.com/coreos/coreos-assembler => ../
8989
google.golang.org/cloud => cloud.google.com/go v0.0.0-20190220171618-cbb15e60dc6d
9090
)

mantle/kola/tests/rhcos/upgrade.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"strings"
2525
"time"
2626

27-
"github.com/coreos/coreos-assembler-schema/cosa"
27+
"github.com/coreos/coreos-assembler/pkg/cosa"
2828
"github.com/coreos/mantle/kola"
2929
"github.com/coreos/mantle/kola/cluster"
3030
"github.com/coreos/mantle/kola/register"

mantle/util/distros.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"path/filepath"
2020
"strings"
2121

22-
"github.com/coreos/coreos-assembler-schema/cosa"
22+
"github.com/coreos/coreos-assembler/pkg/cosa"
2323
)
2424

2525
// TargetDistroFromName returns the distribution given

mantle/util/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/pkg/errors"
2525

26-
"github.com/coreos/coreos-assembler-schema/cosa"
26+
"github.com/coreos/coreos-assembler/pkg/cosa"
2727
)
2828

2929
const (

schema/vendor/github.com/xeipuuv/gojsonpointer/LICENSE-APACHE-2.0.txt renamed to mantle/vendor/github.com/coreos/coreos-assembler/LICENSE

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

mantle/vendor/modules.txt

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

schema/go.mod

Lines changed: 0 additions & 15 deletions
This file was deleted.

schema/go.sum

Lines changed: 0 additions & 25 deletions
This file was deleted.

schema/vendor/github.com/pkg/errors/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

schema/vendor/github.com/pkg/errors/.travis.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

schema/vendor/github.com/pkg/errors/LICENSE

Lines changed: 0 additions & 23 deletions
This file was deleted.

schema/vendor/github.com/pkg/errors/Makefile

Lines changed: 0 additions & 44 deletions
This file was deleted.

schema/vendor/github.com/pkg/errors/README.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)