diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c05e58c..f1c37907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,27 +5,15 @@ This project employs a versioning scheme described in [RELEASE.md](RELEASE.md#ve ## [Unreleased] -## [1.29.0] +## [1.30.0-rc.1] ### Changed -- Upgrade Kubernetes to 1.29.7 [#759](https://github.com/cybozu-go/cke/pull/759), [#749](https://github.com/cybozu-go/cke/pull/749), [#750](https://github.com/cybozu-go/cke/pull/750), [#752](https://github.com/cybozu-go/cke/pull/752), [#754](https://github.com/cybozu-go/cke/pull/754) -- Use docker compose v2 in appropriate way in CI [#764](https://github.com/cybozu-go/cke/pull/764) - -## [1.29.0-rc.2] - -### Changed - -- Upgrade Kubernetes to 1.29.7 [#759](https://github.com/cybozu-go/cke/pull/759) - -## [1.29.0-rc.1] - -### Changed - -- Upgrade for Kubernetes 1.29.6 [#749](https://github.com/cybozu-go/cke/pull/749), [#750](https://github.com/cybozu-go/cke/pull/750), [#752](https://github.com/cybozu-go/cke/pull/752), [#754](https://github.com/cybozu-go/cke/pull/754) +- Update Kubernetes to 1.30.5 [#767](https://github.com/cybozu-go/cke/pull/767) ## Ancient changes +- See [release-1.29/CHANGELOG.md](https://github.com/cybozu-go/cke/blob/release-1.29/CHANGELOG.md) for changes in CKE 1.29. - See [release-1.28/CHANGELOG.md](https://github.com/cybozu-go/cke/blob/release-1.28/CHANGELOG.md) for changes in CKE 1.28. - See [release-1.27/CHANGELOG.md](https://github.com/cybozu-go/cke/blob/release-1.27/CHANGELOG.md) for changes in CKE 1.27. - See [release-1.26/CHANGELOG.md](https://github.com/cybozu-go/cke/blob/release-1.26/CHANGELOG.md) for changes in CKE 1.26. @@ -44,7 +32,5 @@ This project employs a versioning scheme described in [RELEASE.md](RELEASE.md#ve - See [release-1.13/CHANGELOG.md](https://github.com/cybozu-go/cke/blob/release-1.13/CHANGELOG.md) for changes in CKE 1.13. - See [release-1.12/CHANGELOG.md](https://github.com/cybozu-go/cke/blob/release-1.12/CHANGELOG.md) for changes in CKE 1.12. -[Unreleased]: https://github.com/cybozu-go/cke/compare/v1.29.0...HEAD -[1.29.0]: https://github.com/cybozu-go/cke/compare/v1.28.6...v1.29.0 -[1.29.0-rc.2]: https://github.com/cybozu-go/cke/compare/v1.29.0-rc.1...v1.29.0-rc.2 -[1.29.0-rc.1]: https://github.com/cybozu-go/cke/compare/v1.28.6...v1.29.0-rc.1 +[Unreleased]: https://github.com/cybozu-go/cke/compare/v1.30.0-rc.1...HEAD +[1.30.0-rc.1]: https://github.com/cybozu-go/cke/compare/v1.29.0...v1.30.0-rc.1 diff --git a/Makefile b/Makefile index c9a79651..7e8ecb95 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Makefile for cke -ETCD_VERSION = 3.5.14 +ETCD_VERSION = 3.5.15 .PHONY: all all: test diff --git a/RELEASE.md b/RELEASE.md index c958bd49..513b1b15 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -43,7 +43,9 @@ It should look like: 2. Make a branch to release ```console - $ git neco dev "bump-$VERSION" + $ git checkout main + $ git pull + $ git checkout -b "bump-$VERSION" ``` 3. Update `version.go`. @@ -52,7 +54,8 @@ It should look like: ```console $ git commit -a -m "Bump version to $VERSION" - $ git neco review + $ git push -u origin HEAD + $ gh pr create -f ``` 6. When updating to `x.y.0` or its RC, run Sonobuoy test manually and make sure that it has been passed. diff --git a/go.mod b/go.mod index 42f91614..a9e27d8e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/cybozu-go/cke go 1.22.5 require ( - github.com/99designs/gqlgen v0.17.49 + github.com/99designs/gqlgen v0.17.50 github.com/containernetworking/cni v1.2.3 github.com/cybozu-go/etcdutil v1.6.8 github.com/cybozu-go/log v1.7.0 @@ -14,7 +14,7 @@ require ( github.com/onsi/ginkgo/v2 v2.20.2 github.com/onsi/gomega v1.34.2 github.com/opencontainers/selinux v1.11.0 - github.com/prometheus/client_golang v1.20.3 + github.com/prometheus/client_golang v1.20.4 github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.59.1 github.com/spf13/cobra v1.8.1 @@ -113,7 +113,7 @@ require ( go.opentelemetry.io/otel/trace v1.20.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sys v0.25.0 // indirect golang.org/x/text v0.18.0 // indirect diff --git a/go.sum b/go.sum index 53e53c80..6e66f1e0 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/99designs/gqlgen v0.17.49 h1:b3hNGexHd33fBSAd4NDT/c3NCcQzcAVkknhN9ym36YQ= -github.com/99designs/gqlgen v0.17.49/go.mod h1:tC8YFVZMed81x7UJ7ORUwXF4Kn6SXuucFqQBhN8+BU0= +github.com/99designs/gqlgen v0.17.50 h1:c0CggpVl4Eh9jDU8QVB/PRqwDBrJzd2RQYZCO7e+ZRs= +github.com/99designs/gqlgen v0.17.50/go.mod h1:77/+pVe6zlTsz++oUg2m8VLgzdUPHxjoAG3BxI5y8Rc= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -309,8 +309,8 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4= -github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= +github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= @@ -485,8 +485,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/images.go b/images.go index 63c7f6cb..7a34a0ff 100644 --- a/images.go +++ b/images.go @@ -10,12 +10,12 @@ func (i Image) Name() string { // Container image definitions const ( - EtcdImage = Image("ghcr.io/cybozu/etcd:3.5.14.1") - KubernetesImage = Image("ghcr.io/cybozu/kubernetes:1.29.7.1") - ToolsImage = Image("ghcr.io/cybozu-go/cke-tools:1.29.0") - PauseImage = Image("ghcr.io/cybozu/pause:3.9.0.5") - CoreDNSImage = Image("ghcr.io/cybozu/coredns:1.11.1.3") - UnboundImage = Image("ghcr.io/cybozu/unbound:1.20.0.2") + EtcdImage = Image("ghcr.io/cybozu/etcd:3.5.15.1") + KubernetesImage = Image("ghcr.io/cybozu/kubernetes:1.30.5.1") + ToolsImage = Image("ghcr.io/cybozu-go/cke-tools:1.30.0") + PauseImage = Image("ghcr.io/cybozu/pause:3.9.0.6") + CoreDNSImage = Image("ghcr.io/cybozu/coredns:1.11.3.1") + UnboundImage = Image("ghcr.io/cybozu/unbound:1.21.0.1") UnboundExporterImage = Image("ghcr.io/cybozu/unbound_exporter:0.4.6.2") ) diff --git a/mtest/Makefile b/mtest/Makefile index 27438169..51f502b2 100644 --- a/mtest/Makefile +++ b/mtest/Makefile @@ -1,11 +1,11 @@ # Makefile for multi-host testing using ginkgo # tool versions -MANAGEMENT_ETCD_VERSION = 3.5.14 -VAULT_VERSION = 1.16.0 -K8S_VERSION = 1.29.7 -CONTAINERD_VERSION = 1.7.19 -CRITOOLS_VERSION = 1.30.0 +MANAGEMENT_ETCD_VERSION = 3.5.15 +VAULT_VERSION = 1.17.2 +K8S_VERSION = 1.30.5 +CONTAINERD_VERSION = 1.7.21 +CRITOOLS_VERSION = 1.31.1 CT_VERSION = 0.9.3 # configuration variables @@ -36,7 +36,7 @@ export HOST1 HOST2 NODE1 NODE2 NODE3 NODE4 NODE5 NODE6 PLACEMAT GINKGO SUITE # non-configuration variables MANAGEMENT_ETCD_ARCHIVE := etcd-v$(MANAGEMENT_ETCD_VERSION)-linux-amd64.tar.gz VAULT_ARCHIVE := vault_$(VAULT_VERSION)_linux_amd64.zip -KUBECTL_URL := https://storage.googleapis.com/kubernetes-release/release/v$(K8S_VERSION)/bin/linux/amd64/kubectl +KUBECTL_URL := https://dl.k8s.io/v$(K8S_VERSION)/bin/linux/amd64/kubectl SSH_PRIVKEY = $(realpath ./mtest_key) OUTPUT := ./output DATA_DIR := $(abspath $(OUTPUT))/data diff --git a/sabakan/mock/generated.go b/sabakan/mock/generated.go index 6b333248..3dfa4ad7 100644 --- a/sabakan/mock/generated.go +++ b/sabakan/mock/generated.go @@ -372,86 +372,189 @@ var parsedSchema = gqlparser.MustLoadSchema(sources...) func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["name"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query___type_argsName(ctx, rawArgs) + if err != nil { + return nil, err } args["name"] = arg0 return args, nil } +func (ec *executionContext) field_Query___type_argsName( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["name"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + if tmp, ok := rawArgs["name"]; ok { + return ec.unmarshalNString2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Query_machine_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["serial"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("serial")) - arg0, err = ec.unmarshalNID2string(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_machine_argsSerial(ctx, rawArgs) + if err != nil { + return nil, err } args["serial"] = arg0 return args, nil } +func (ec *executionContext) field_Query_machine_argsSerial( + ctx context.Context, + rawArgs map[string]interface{}, +) (string, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["serial"] + if !ok { + var zeroVal string + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("serial")) + if tmp, ok := rawArgs["serial"]; ok { + return ec.unmarshalNID2string(ctx, tmp) + } + + var zeroVal string + return zeroVal, nil +} func (ec *executionContext) field_Query_searchMachines_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 *MachineParams - if tmp, ok := rawArgs["having"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("having")) - arg0, err = ec.unmarshalOMachineParams2ᚖgithub.comᚋcybozuᚑgoᚋckeᚋsabakanᚋmockᚐMachineParams(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field_Query_searchMachines_argsHaving(ctx, rawArgs) + if err != nil { + return nil, err } args["having"] = arg0 - var arg1 *MachineParams - if tmp, ok := rawArgs["notHaving"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("notHaving")) - arg1, err = ec.unmarshalOMachineParams2ᚖgithub.comᚋcybozuᚑgoᚋckeᚋsabakanᚋmockᚐMachineParams(ctx, tmp) - if err != nil { - return nil, err - } + arg1, err := ec.field_Query_searchMachines_argsNotHaving(ctx, rawArgs) + if err != nil { + return nil, err } args["notHaving"] = arg1 return args, nil } +func (ec *executionContext) field_Query_searchMachines_argsHaving( + ctx context.Context, + rawArgs map[string]interface{}, +) (*MachineParams, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["having"] + if !ok { + var zeroVal *MachineParams + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("having")) + if tmp, ok := rawArgs["having"]; ok { + return ec.unmarshalOMachineParams2ᚖgithub.comᚋcybozuᚑgoᚋckeᚋsabakanᚋmockᚐMachineParams(ctx, tmp) + } + + var zeroVal *MachineParams + return zeroVal, nil +} + +func (ec *executionContext) field_Query_searchMachines_argsNotHaving( + ctx context.Context, + rawArgs map[string]interface{}, +) (*MachineParams, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["notHaving"] + if !ok { + var zeroVal *MachineParams + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("notHaving")) + if tmp, ok := rawArgs["notHaving"]; ok { + return ec.unmarshalOMachineParams2ᚖgithub.comᚋcybozuᚑgoᚋckeᚋsabakanᚋmockᚐMachineParams(ctx, tmp) + } + + var zeroVal *MachineParams + return zeroVal, nil +} func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field___Type_enumValues_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err } args["includeDeprecated"] = arg0 return args, nil } +func (ec *executionContext) field___Type_enumValues_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]interface{}, +) (bool, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["includeDeprecated"] + if !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 bool - if tmp, ok := rawArgs["includeDeprecated"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) - arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) - if err != nil { - return nil, err - } + arg0, err := ec.field___Type_fields_argsIncludeDeprecated(ctx, rawArgs) + if err != nil { + return nil, err } args["includeDeprecated"] = arg0 return args, nil } +func (ec *executionContext) field___Type_fields_argsIncludeDeprecated( + ctx context.Context, + rawArgs map[string]interface{}, +) (bool, error) { + // We won't call the directive if the argument is null. + // Set call_argument_directives_with_null to true to call directives + // even if the argument is null. + _, ok := rawArgs["includeDeprecated"] + if !ok { + var zeroVal bool + return zeroVal, nil + } + + ctx = graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + if tmp, ok := rawArgs["includeDeprecated"]; ok { + return ec.unmarshalOBoolean2bool(ctx, tmp) + } + + var zeroVal bool + return zeroVal, nil +} // endregion ***************************** args.gotpl ***************************** @@ -3423,11 +3526,51 @@ func (ec *executionContext) _BMC(ctx context.Context, sel ast.SelectionSet, obj case "__typename": out.Values[i] = graphql.MarshalString("BMC") case "bmcType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BMC_bmcType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BMC_bmcType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "ipv4": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._BMC_ipv4(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._BMC_ipv4(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -3467,11 +3610,51 @@ func (ec *executionContext) _Label(ctx context.Context, sel ast.SelectionSet, ob case "__typename": out.Values[i] = graphql.MarshalString("Label") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Label_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Label_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "value": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Label_value(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Label_value(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -3511,11 +3694,51 @@ func (ec *executionContext) _Machine(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("Machine") case "spec": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Machine_spec(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Machine_spec(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "status": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._Machine_status(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._Machine_status(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -3555,43 +3778,223 @@ func (ec *executionContext) _MachineSpec(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("MachineSpec") case "serial": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_serial(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_serial(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "labels": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_labels(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_labels(ctx, field, obj) case "rack": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_rack(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_rack(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "indexInRack": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_indexInRack(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_indexInRack(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "role": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_role(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_role(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "ipv4": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_ipv4(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_ipv4(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "registerDate": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_registerDate(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_registerDate(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "retireDate": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_retireDate(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_retireDate(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "bmc": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineSpec_bmc(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineSpec_bmc(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -3631,16 +4034,76 @@ func (ec *executionContext) _MachineStatus(ctx context.Context, sel ast.Selectio case "__typename": out.Values[i] = graphql.MarshalString("MachineStatus") case "state": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineStatus_state(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineStatus_state(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "timestamp": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineStatus_timestamp(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineStatus_timestamp(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "duration": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec._MachineStatus_duration(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec._MachineStatus_duration(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -3690,52 +4153,30 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr case "machine": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_machine(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_machine(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "searchMachines": field := field - innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Query_searchMachines(ctx, field) - if res == graphql.Null { - atomic.AddUint32(&fs.Invalids, 1) - } - return res - } - - rrm := func(ctx context.Context) graphql.Marshaler { - return ec.OperationContext.RootResolverMiddleware(ctx, - func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { + return ec._Query_searchMachines(ctx, field) + }) + if out.Values[i] == graphql.Null { + out.Invalids++ } - - out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) case "__type": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___type(ctx, field) }) case "__schema": + field := field + out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { return ec._Query___schema(ctx, field) }) @@ -3774,23 +4215,123 @@ func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__Directive") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_description(ctx, field, obj) case "locations": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_locations(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_locations(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "args": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isRepeatable": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Directive_isRepeatable(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Directive_isRepeatable(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -3830,18 +4371,98 @@ func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionS case "__typename": out.Values[i] = graphql.MarshalString("__EnumValue") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_description(ctx, field, obj) case "isDeprecated": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_isDeprecated(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___EnumValue_deprecationReason(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3878,28 +4499,148 @@ func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Field") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_description(ctx, field, obj) case "args": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_args(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_args(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "type": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "isDeprecated": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_isDeprecated(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "deprecationReason": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Field_deprecationReason(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3936,18 +4677,98 @@ func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.Selection case "__typename": out.Values[i] = graphql.MarshalString("__InputValue") case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_name(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_description(ctx, field, obj) case "type": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_type(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_type(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "defaultValue": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___InputValue_defaultValue(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -3984,22 +4805,142 @@ func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, case "__typename": out.Values[i] = graphql.MarshalString("__Schema") case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_description(ctx, field, obj) case "types": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_types(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_types(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "queryType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_queryType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_queryType(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "mutationType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_mutationType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) case "subscriptionType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_subscriptionType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) case "directives": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Schema_directives(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Schema_directives(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ @@ -4039,27 +4980,227 @@ func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, o case "__typename": out.Values[i] = graphql.MarshalString("__Type") case "kind": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_kind(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_kind(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "name": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_name(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_name(ctx, field, obj) case "description": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_description(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_description(ctx, field, obj) case "fields": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_fields(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_fields(ctx, field, obj) case "interfaces": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_interfaces(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_interfaces(ctx, field, obj) case "possibleTypes": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_possibleTypes(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) case "enumValues": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_enumValues(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_enumValues(ctx, field, obj) case "inputFields": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_inputFields(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_inputFields(ctx, field, obj) case "ofType": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_ofType(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_ofType(ctx, field, obj) case "specifiedByURL": + field := field + + if field.Deferrable != nil { + dfs, ok := deferred[field.Deferrable.Label] + di := 0 + if ok { + dfs.AddField(field) + di = len(dfs.Values) - 1 + } else { + dfs = graphql.NewFieldSet([]graphql.CollectedField{field}) + deferred[field.Deferrable.Label] = dfs + } + dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler { + return ec.___Type_specifiedByURL(ctx, field, obj) + }) + + // don't run the out.Concurrently() call below + out.Values[i] = graphql.Null + continue + } out.Values[i] = ec.___Type_specifiedByURL(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) @@ -4242,7 +5383,7 @@ func (ec *executionContext) marshalNMachine2githubᚗcomᚋcybozuᚑgoᚋckeᚋs func (ec *executionContext) marshalNMachine2ᚕᚖgithub.comᚋcybozuᚑgoᚋckeᚋsabakanᚋmockᚐMachineᚄ(ctx context.Context, sel ast.SelectionSet, v []*Machine) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4345,7 +5486,7 @@ func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlge func (ec *executionContext) marshalN__Directive2ᚕgithub.comᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4421,7 +5562,7 @@ func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx conte func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4477,7 +5618,7 @@ func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlg func (ec *executionContext) marshalN__InputValue2ᚕgithub.comᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4525,7 +5666,7 @@ func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋg func (ec *executionContext) marshalN__Type2ᚕgithub.comᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4677,7 +5818,7 @@ func (ec *executionContext) marshalOLabel2ᚕᚖgithub.comᚋcybozuᚑgoᚋcke } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4772,7 +5913,7 @@ func (ec *executionContext) marshalOMachineState2ᚕgithub.comᚋcybozuᚑgo } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4873,7 +6014,7 @@ func (ec *executionContext) marshalO__EnumValue2ᚕgithub.comᚋ99designsᚋgq } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4920,7 +6061,7 @@ func (ec *executionContext) marshalO__Field2ᚕgithub.comᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -4967,7 +6108,7 @@ func (ec *executionContext) marshalO__InputValue2ᚕgithub.comᚋ99designsᚋg } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } @@ -5021,7 +6162,7 @@ func (ec *executionContext) marshalO__Type2ᚕgithub.comᚋ99designsᚋgqlgen } ret := make(graphql.Array, len(v)) var wg sync.WaitGroup - isLen1 := len(v) == 1 + isLen1 := true if !isLen1 { wg.Add(len(v)) } diff --git a/sabakan/mock/gqlgen.yml b/sabakan/mock/gqlgen.yml index 347dc647..89987df6 100644 --- a/sabakan/mock/gqlgen.yml +++ b/sabakan/mock/gqlgen.yml @@ -1,11 +1,13 @@ # Generate test GraphQL server. schema: -- schema.graphql + - schema.graphql exec: filename: generated.go + package: mock model: filename: models.go resolver: - filename: resolver.go - type: Resolver + layout: follow-schema + dir: . + package: mock diff --git a/sabakan/mock/resolver.go b/sabakan/mock/resolver.go index d51c8f6f..ff68dbbb 100644 --- a/sabakan/mock/resolver.go +++ b/sabakan/mock/resolver.go @@ -1,13 +1,10 @@ package mock -import ( - "context" - "errors" - "fmt" - "time" -) +// This file will not be regenerated automatically. +// +// It serves as dependency injection for your app, add any dependencies you require here. -// THIS CODE IS A STARTING POINT ONLY. IT WILL NOT BE UPDATED WITH SCHEMA CHANGES. +import "time" var machines = map[string]*Machine{ "m1": { @@ -69,68 +66,10 @@ var machines = map[string]*Machine{ }, } +type Resolver struct{} + type mockResolver struct{} func (r mockResolver) Query() QueryResolver { - return queryResolver{} -} - -type queryResolver struct{} - -func (r queryResolver) Machine(ctx context.Context, serial string) (*Machine, error) { - if m, ok := machines[serial]; ok { - return m, nil - } - return nil, errors.New("not found") -} -func (r queryResolver) SearchMachines(ctx context.Context, having *MachineParams, notHaving *MachineParams) ([]*Machine, error) { - if having == nil { - if notHaving == nil { - return []*Machine{machines["m1"], machines["m2"], machines["m3"]}, nil - } - return []*Machine{machines["m1"], machines["m3"]}, nil - } - - if len(having.Labels) == 1 { - if having.Labels[0].Name != "foo" { - return nil, errors.New("wrong label name: " + having.Labels[0].Name) - } - if having.Labels[0].Value != "bar" { - return nil, errors.New("wrong label value: " + having.Labels[0].Value) - } - return []*Machine{machines["m3"]}, nil - } - - if len(having.Racks) == 1 { - if having.Racks[0] != 1 { - return nil, fmt.Errorf("wrong rack number: %d", having.Racks[0]) - } - return []*Machine{machines["m1"]}, nil - } - - if len(having.Roles) == 1 { - if having.Roles[0] != "worker" { - return nil, errors.New("wrong role: " + having.Roles[0]) - } - return []*Machine{machines["m2"]}, nil - } - - if len(having.States) == 1 { - if string(having.States[0]) == "bad" { - return nil, errors.New("bad state value") - } - if having.States[0] != MachineStateUninitialized { - return nil, errors.New("unexpected state: " + string(having.States[0])) - } - return []*Machine{machines["m3"]}, nil - } - - if having.MinDaysBeforeRetire != nil { - if *having.MinDaysBeforeRetire != 90 { - return nil, fmt.Errorf("unexpected days: %d", *having.MinDaysBeforeRetire) - } - return []*Machine{machines["m2"]}, nil - } - - return nil, nil + return &queryResolver{} } diff --git a/sabakan/mock/schema.resolvers.go b/sabakan/mock/schema.resolvers.go new file mode 100644 index 00000000..23ef5559 --- /dev/null +++ b/sabakan/mock/schema.resolvers.go @@ -0,0 +1,77 @@ +package mock + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. +// Code generated by github.com/99designs/gqlgen version v0.17.50 + +import ( + "context" + "errors" + "fmt" +) + +// Machine is the resolver for the machine field. +func (r *queryResolver) Machine(ctx context.Context, serial string) (*Machine, error) { + if m, ok := machines[serial]; ok { + return m, nil + } + return nil, errors.New("not found") +} + +// SearchMachines is the resolver for the searchMachines field. +func (r *queryResolver) SearchMachines(ctx context.Context, having *MachineParams, notHaving *MachineParams) ([]*Machine, error) { + if having == nil { + if notHaving == nil { + return []*Machine{machines["m1"], machines["m2"], machines["m3"]}, nil + } + return []*Machine{machines["m1"], machines["m3"]}, nil + } + + if len(having.Labels) == 1 { + if having.Labels[0].Name != "foo" { + return nil, errors.New("wrong label name: " + having.Labels[0].Name) + } + if having.Labels[0].Value != "bar" { + return nil, errors.New("wrong label value: " + having.Labels[0].Value) + } + return []*Machine{machines["m3"]}, nil + } + + if len(having.Racks) == 1 { + if having.Racks[0] != 1 { + return nil, fmt.Errorf("wrong rack number: %d", having.Racks[0]) + } + return []*Machine{machines["m1"]}, nil + } + + if len(having.Roles) == 1 { + if having.Roles[0] != "worker" { + return nil, errors.New("wrong role: " + having.Roles[0]) + } + return []*Machine{machines["m2"]}, nil + } + + if len(having.States) == 1 { + if string(having.States[0]) == "bad" { + return nil, errors.New("bad state value") + } + if having.States[0] != MachineStateUninitialized { + return nil, errors.New("unexpected state: " + string(having.States[0])) + } + return []*Machine{machines["m3"]}, nil + } + + if having.MinDaysBeforeRetire != nil { + if *having.MinDaysBeforeRetire != 90 { + return nil, fmt.Errorf("unexpected days: %d", *having.MinDaysBeforeRetire) + } + return []*Machine{machines["m2"]}, nil + } + + return nil, nil +} + +// Query returns QueryResolver implementation. +func (r *Resolver) Query() QueryResolver { return &queryResolver{r} } + +type queryResolver struct{ *Resolver } diff --git a/sonobuoy/Makefile b/sonobuoy/Makefile index 567e44ce..90737144 100644 --- a/sonobuoy/Makefile +++ b/sonobuoy/Makefile @@ -1,7 +1,7 @@ ### Configurable variables -SONOBUOY_VERSION = 0.57.1 -KUBECTL_VERSION = 1.29.7 -DOCKER_COMPOSE_VERSION = 2.28.1 +SONOBUOY_VERSION = 0.57.2 +KUBECTL_VERSION = 1.30.5 +DOCKER_COMPOSE_VERSION = 2.29.6 CT_VERSION = 0.9.3 ### Unconfigurable @@ -13,7 +13,7 @@ SUDO = sudo endif SONOBUOY_URL = https://github.com/vmware-tanzu/sonobuoy/releases/download/v$(SONOBUOY_VERSION)/sonobuoy_$(SONOBUOY_VERSION)_linux_amd64.tar.gz -KUBECTL_URL = https://storage.googleapis.com/kubernetes-release/release/v$(KUBECTL_VERSION)/bin/linux/amd64/kubectl +KUBECTL_URL = https://dl.k8s.io/v$(KUBECTL_VERSION)/bin/linux/amd64/kubectl DOCKER_COMPOSE_URL = https://github.com/docker/compose/releases/download/v$(DOCKER_COMPOSE_VERSION)/docker-compose-Linux-x86_64 CKECLI = ./bin/ckecli --config=./cke.config KUBECONFIG := $(shell pwd)/.kubeconfig diff --git a/static/resources.go b/static/resources.go index c1696bf2..48475646 100644 --- a/static/resources.go +++ b/static/resources.go @@ -60,8 +60,8 @@ var Resources = []cke.ResourceDefinition{ Namespace: "kube-system", Name: "node-dns", Revision: 4, - Image: "ghcr.io/cybozu/unbound:1.20.0.2,ghcr.io/cybozu/unbound_exporter:0.4.6.2", - Definition: []byte("kind: DaemonSet\napiVersion: apps/v1\nmetadata:\n name: node-dns\n namespace: kube-system\n annotations:\n cke.cybozu.com/image: \"ghcr.io/cybozu/unbound:1.20.0.2,ghcr.io/cybozu/unbound_exporter:0.4.6.2\"\n cke.cybozu.com/revision: \"4\"\nspec:\n selector:\n matchLabels:\n cke.cybozu.com/appname: node-dns\n updateStrategy:\n type: RollingUpdate\n rollingUpdate:\n maxSurge: 35%\n maxUnavailable: 0\n template:\n metadata:\n labels:\n cke.cybozu.com/appname: node-dns\n spec:\n priorityClassName: system-node-critical\n nodeSelector:\n kubernetes.io/os: linux\n hostNetwork: true\n tolerations:\n - operator: Exists\n terminationGracePeriodSeconds: 1\n containers:\n - name: unbound\n image: ghcr.io/cybozu/unbound:1.20.0.2\n args:\n - -c\n - /etc/unbound/unbound.conf\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n add:\n - NET_BIND_SERVICE\n drop:\n - all\n readOnlyRootFilesystem: true\n readinessProbe:\n tcpSocket:\n port: 53\n host: localhost\n periodSeconds: 1\n livenessProbe:\n tcpSocket:\n port: 53\n host: localhost\n periodSeconds: 1\n initialDelaySeconds: 1\n failureThreshold: 6\n volumeMounts:\n - name: config-volume\n mountPath: /etc/unbound\n - name: var-run-unbound\n mountPath: /var/run/unbound\n resources:\n requests:\n cpu: 50m\n memory: 250Mi\n - name: reload\n image: ghcr.io/cybozu/unbound:1.20.0.2\n command:\n - /usr/local/bin/reload-unbound\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - all\n readOnlyRootFilesystem: true\n volumeMounts:\n - name: config-volume\n mountPath: /etc/unbound\n - name: var-run-unbound\n mountPath: /var/run/unbound\n - name: exporter\n image: ghcr.io/cybozu/unbound_exporter:0.4.6.2\n args:\n # must be same with the path written in /op/nodedns/nodedns.go\n - --unbound.host=unix:///var/run/unbound/unbound.sock\n - --web.reuse-port=true\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - all\n readOnlyRootFilesystem: true\n volumeMounts:\n - name: var-run-unbound\n mountPath: /var/run/unbound\n volumes:\n - name: config-volume\n configMap:\n name: node-dns\n items:\n - key: unbound.conf\n path: unbound.conf\n - name: var-run-unbound\n emptyDir: {}\n"), + Image: "ghcr.io/cybozu/unbound:1.21.0.1,ghcr.io/cybozu/unbound_exporter:0.4.6.2", + Definition: []byte("kind: DaemonSet\napiVersion: apps/v1\nmetadata:\n name: node-dns\n namespace: kube-system\n annotations:\n cke.cybozu.com/image: \"ghcr.io/cybozu/unbound:1.21.0.1,ghcr.io/cybozu/unbound_exporter:0.4.6.2\"\n cke.cybozu.com/revision: \"4\"\nspec:\n selector:\n matchLabels:\n cke.cybozu.com/appname: node-dns\n updateStrategy:\n type: RollingUpdate\n rollingUpdate:\n maxSurge: 35%\n maxUnavailable: 0\n template:\n metadata:\n labels:\n cke.cybozu.com/appname: node-dns\n spec:\n priorityClassName: system-node-critical\n nodeSelector:\n kubernetes.io/os: linux\n hostNetwork: true\n tolerations:\n - operator: Exists\n terminationGracePeriodSeconds: 1\n containers:\n - name: unbound\n image: ghcr.io/cybozu/unbound:1.21.0.1\n args:\n - -c\n - /etc/unbound/unbound.conf\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n add:\n - NET_BIND_SERVICE\n drop:\n - all\n readOnlyRootFilesystem: true\n readinessProbe:\n tcpSocket:\n port: 53\n host: localhost\n periodSeconds: 1\n livenessProbe:\n tcpSocket:\n port: 53\n host: localhost\n periodSeconds: 1\n initialDelaySeconds: 1\n failureThreshold: 6\n volumeMounts:\n - name: config-volume\n mountPath: /etc/unbound\n - name: var-run-unbound\n mountPath: /var/run/unbound\n resources:\n requests:\n cpu: 50m\n memory: 250Mi\n - name: reload\n image: ghcr.io/cybozu/unbound:1.21.0.1\n command:\n - /usr/local/bin/reload-unbound\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - all\n readOnlyRootFilesystem: true\n volumeMounts:\n - name: config-volume\n mountPath: /etc/unbound\n - name: var-run-unbound\n mountPath: /var/run/unbound\n - name: exporter\n image: ghcr.io/cybozu/unbound_exporter:0.4.6.2\n args:\n # must be same with the path written in /op/nodedns/nodedns.go\n - --unbound.host=unix:///var/run/unbound/unbound.sock\n - --web.reuse-port=true\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - all\n readOnlyRootFilesystem: true\n volumeMounts:\n - name: var-run-unbound\n mountPath: /var/run/unbound\n volumes:\n - name: config-volume\n configMap:\n name: node-dns\n items:\n - key: unbound.conf\n path: unbound.conf\n - name: var-run-unbound\n emptyDir: {}\n"), }, { Key: "Deployment/kube-system/cluster-dns", @@ -69,8 +69,8 @@ var Resources = []cke.ResourceDefinition{ Namespace: "kube-system", Name: "cluster-dns", Revision: 4, - Image: "ghcr.io/cybozu/coredns:1.11.1.3", - Definition: []byte("\nkind: Deployment\napiVersion: apps/v1\nmetadata:\n name: cluster-dns\n namespace: kube-system\n annotations:\n cke.cybozu.com/image: \"ghcr.io/cybozu/coredns:1.11.1.3\"\n cke.cybozu.com/revision: \"4\"\nspec:\n replicas: 2\n strategy:\n type: RollingUpdate\n rollingUpdate:\n maxUnavailable: 1\n selector:\n matchLabels:\n cke.cybozu.com/appname: cluster-dns\n template:\n metadata:\n labels:\n cke.cybozu.com/appname: cluster-dns\n k8s-app: coredns # sonobuoy requires\n annotations:\n prometheus.io/port: \"9153\"\n spec:\n priorityClassName: system-cluster-critical\n serviceAccountName: cke-cluster-dns\n tolerations:\n - key: node-role.kubernetes.io/master\n effect: NoSchedule\n - key: \"CriticalAddonsOnly\"\n operator: \"Exists\"\n - key: kubernetes.io/e2e-evict-taint-key\n operator: Exists\n # for sonobuoy https://github.com/vmware-tanzu/sonobuoy/pull/878\n containers:\n - name: coredns\n image: ghcr.io/cybozu/coredns:1.11.1.3\n imagePullPolicy: IfNotPresent\n resources:\n requests:\n cpu: 50m\n memory: 250Mi\n args: [ \"-conf\", \"/etc/coredns/Corefile\" ]\n lifecycle:\n preStop:\n exec:\n command: [\"sh\", \"-c\", \"sleep 5\"]\n volumeMounts:\n - name: config-volume\n mountPath: /etc/coredns\n readOnly: true\n ports:\n - containerPort: 1053\n name: dns\n protocol: UDP\n - containerPort: 1053\n name: dns-tcp\n protocol: TCP\n - containerPort: 9153\n name: metrics\n protocol: TCP\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - all\n readOnlyRootFilesystem: true\n readinessProbe:\n httpGet:\n path: /ready\n port: 8181\n scheme: HTTP\n livenessProbe:\n httpGet:\n path: /health\n port: 8080\n scheme: HTTP\n initialDelaySeconds: 60\n timeoutSeconds: 5\n successThreshold: 1\n failureThreshold: 5\n dnsPolicy: Default\n volumes:\n - name: config-volume\n configMap:\n name: cluster-dns\n items:\n - key: Corefile\n path: Corefile\n affinity:\n podAntiAffinity:\n requiredDuringSchedulingIgnoredDuringExecution:\n - labelSelector:\n matchLabels:\n cke.cybozu.com/appname: cluster-dns\n topologyKey: \"kubernetes.io/hostname\"\n"), + Image: "ghcr.io/cybozu/coredns:1.11.3.1", + Definition: []byte("\nkind: Deployment\napiVersion: apps/v1\nmetadata:\n name: cluster-dns\n namespace: kube-system\n annotations:\n cke.cybozu.com/image: \"ghcr.io/cybozu/coredns:1.11.3.1\"\n cke.cybozu.com/revision: \"4\"\nspec:\n replicas: 2\n strategy:\n type: RollingUpdate\n rollingUpdate:\n maxUnavailable: 1\n selector:\n matchLabels:\n cke.cybozu.com/appname: cluster-dns\n template:\n metadata:\n labels:\n cke.cybozu.com/appname: cluster-dns\n k8s-app: coredns # sonobuoy requires\n annotations:\n prometheus.io/port: \"9153\"\n spec:\n priorityClassName: system-cluster-critical\n serviceAccountName: cke-cluster-dns\n tolerations:\n - key: node-role.kubernetes.io/master\n effect: NoSchedule\n - key: \"CriticalAddonsOnly\"\n operator: \"Exists\"\n - key: kubernetes.io/e2e-evict-taint-key\n operator: Exists\n # for sonobuoy https://github.com/vmware-tanzu/sonobuoy/pull/878\n containers:\n - name: coredns\n image: ghcr.io/cybozu/coredns:1.11.3.1\n imagePullPolicy: IfNotPresent\n resources:\n requests:\n cpu: 50m\n memory: 250Mi\n args: [ \"-conf\", \"/etc/coredns/Corefile\" ]\n lifecycle:\n preStop:\n exec:\n command: [\"sh\", \"-c\", \"sleep 5\"]\n volumeMounts:\n - name: config-volume\n mountPath: /etc/coredns\n readOnly: true\n ports:\n - containerPort: 1053\n name: dns\n protocol: UDP\n - containerPort: 1053\n name: dns-tcp\n protocol: TCP\n - containerPort: 9153\n name: metrics\n protocol: TCP\n securityContext:\n allowPrivilegeEscalation: false\n capabilities:\n drop:\n - all\n readOnlyRootFilesystem: true\n readinessProbe:\n httpGet:\n path: /ready\n port: 8181\n scheme: HTTP\n livenessProbe:\n httpGet:\n path: /health\n port: 8080\n scheme: HTTP\n initialDelaySeconds: 60\n timeoutSeconds: 5\n successThreshold: 1\n failureThreshold: 5\n dnsPolicy: Default\n volumes:\n - name: config-volume\n configMap:\n name: cluster-dns\n items:\n - key: Corefile\n path: Corefile\n affinity:\n podAntiAffinity:\n requiredDuringSchedulingIgnoredDuringExecution:\n - labelSelector:\n matchLabels:\n cke.cybozu.com/appname: cluster-dns\n topologyKey: \"kubernetes.io/hostname\"\n"), }, { Key: "PodDisruptionBudget/kube-system/cluster-dns-pdb", diff --git a/tools/RELEASE.md b/tools/RELEASE.md index 1abcf839..7dfb5723 100644 --- a/tools/RELEASE.md +++ b/tools/RELEASE.md @@ -22,7 +22,9 @@ The patch version is increased with `cke-tools` update. 2. Make a branch to release ```console - $ git neco dev "bump-tools-$VERSION" + $ git checkout main + $ git pull + $ git checkout -b "bump-tools-$VERSION" ``` 3. Edit `CHANGELOG.md` in this directory. @@ -30,7 +32,8 @@ The patch version is increased with `cke-tools` update. ```console $ git commit -a -m "Bump cke-tools version to $VERSION" - $ git neco review + $ git push -u origin HEAD + $ gh pr create -f ``` 5. Merge the pull request.