From 89accb281fb2619214d77ca2d17e2c2f96b2c7a4 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 11 Jan 2017 03:00:33 -0800 Subject: [PATCH] matchbox: Switch to Go 1.7+ standard context * Drop build support for Go 1.6 --- .travis.yml | 1 - CHANGES.md | 9 +++++++-- matchbox/cli/group_create.go | 2 +- matchbox/cli/group_describe.go | 2 +- matchbox/cli/group_list.go | 2 +- matchbox/cli/ignition_create.go | 2 +- matchbox/cli/profile_create.go | 2 +- matchbox/cli/profile_describe.go | 2 +- matchbox/cli/profile_list.go | 2 +- matchbox/http/cloud.go | 2 +- matchbox/http/cloud_test.go | 2 +- matchbox/http/context.go | 2 +- matchbox/http/context_test.go | 2 +- matchbox/http/ctxh.go | 2 +- matchbox/http/ctxh_test.go | 2 +- matchbox/http/generic.go | 2 +- matchbox/http/generic_test.go | 2 +- matchbox/http/grub.go | 2 +- matchbox/http/handlers.go | 2 +- matchbox/http/handlers_test.go | 2 +- matchbox/http/ignition.go | 2 +- matchbox/http/ignition_test.go | 2 +- matchbox/http/ipxe.go | 2 +- matchbox/http/ipxe_test.go | 2 +- matchbox/http/metadata.go | 2 +- matchbox/http/metadata_test.go | 2 +- matchbox/http/pixiecore.go | 2 +- matchbox/http/pixiecore_test.go | 2 +- matchbox/server/server.go | 2 +- matchbox/server/server_test.go | 2 +- 30 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index c944f4cf..edd9eefb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ sudo: required services: - docker go: - - 1.6.4 - 1.7.4 - 1.8rc1 - tip diff --git a/CHANGES.md b/CHANGES.md index bd8ca81d..721d3346 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,13 @@ Rename `bootcfg` to CoreOS `matchbox`! * Add Profile `args` field to list kernel args * Update [Fuze](https://github.com/coreos/container-linux-config-transpiler) and [Ignition](https://github.com/coreos/ignition) to v0.11.2 +* Switch from `golang.org/x/net/context` to `context` +* Deprecate Profile `cmd` field map of kernel args +* Deprecate Pixiecore support +* Drop build support for Go 1.6 + +#### Rename + * Rename `bootcfg` binary to `matchbox` * Rename `bootcfg` packages to `matchbox` * Publish a `quay.io/coreos/matchbox` container image. The `quay.io/coreos/bootcfg` image will no longer be updated. @@ -15,8 +22,6 @@ Rename `bootcfg` to CoreOS `matchbox`! * Change config directory to `/etc/matchbox` * Change default `-data-path` to `/var/lib/matchbox` * Change default `-assets-path` to `/var/lib/matchbox/assets` -* Deprecate Profile `cmd` field map of kernel args -* Deprecate Pixiecore support #### Examples diff --git a/matchbox/cli/group_create.go b/matchbox/cli/group_create.go index 441be245..d1f1e332 100644 --- a/matchbox/cli/group_create.go +++ b/matchbox/cli/group_create.go @@ -3,8 +3,8 @@ package cli import ( "io/ioutil" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/cli/group_describe.go b/matchbox/cli/group_describe.go index 5418c739..87efd3d0 100644 --- a/matchbox/cli/group_describe.go +++ b/matchbox/cli/group_describe.go @@ -4,8 +4,8 @@ import ( "fmt" "os" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) diff --git a/matchbox/cli/group_list.go b/matchbox/cli/group_list.go index 47421232..445552b6 100644 --- a/matchbox/cli/group_list.go +++ b/matchbox/cli/group_list.go @@ -4,8 +4,8 @@ import ( "fmt" "os" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) diff --git a/matchbox/cli/ignition_create.go b/matchbox/cli/ignition_create.go index efced277..cc3f4ae1 100644 --- a/matchbox/cli/ignition_create.go +++ b/matchbox/cli/ignition_create.go @@ -4,8 +4,8 @@ import ( "io/ioutil" "path/filepath" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) diff --git a/matchbox/cli/profile_create.go b/matchbox/cli/profile_create.go index 14c53863..d97c0c1a 100644 --- a/matchbox/cli/profile_create.go +++ b/matchbox/cli/profile_create.go @@ -3,8 +3,8 @@ package cli import ( "io/ioutil" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/cli/profile_describe.go b/matchbox/cli/profile_describe.go index 442553c8..4337e439 100644 --- a/matchbox/cli/profile_describe.go +++ b/matchbox/cli/profile_describe.go @@ -4,8 +4,8 @@ import ( "fmt" "os" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) diff --git a/matchbox/cli/profile_list.go b/matchbox/cli/profile_list.go index 9c5ea0b6..6866d41b 100644 --- a/matchbox/cli/profile_list.go +++ b/matchbox/cli/profile_list.go @@ -4,8 +4,8 @@ import ( "fmt" "os" + "context" "github.com/spf13/cobra" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" ) diff --git a/matchbox/http/cloud.go b/matchbox/http/cloud.go index 79b9a811..9c655399 100644 --- a/matchbox/http/cloud.go +++ b/matchbox/http/cloud.go @@ -6,9 +6,9 @@ import ( "strings" "time" + "context" "github.com/Sirupsen/logrus" cloudinit "github.com/coreos/coreos-cloudinit/config" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" diff --git a/matchbox/http/cloud_test.go b/matchbox/http/cloud_test.go index 4b3c7b9f..497e570c 100644 --- a/matchbox/http/cloud_test.go +++ b/matchbox/http/cloud_test.go @@ -5,9 +5,9 @@ import ( "net/http/httptest" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/http/context.go b/matchbox/http/context.go index 02513720..e2e4be10 100644 --- a/matchbox/http/context.go +++ b/matchbox/http/context.go @@ -3,7 +3,7 @@ package http import ( "errors" - "golang.org/x/net/context" + "context" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" ) diff --git a/matchbox/http/context_test.go b/matchbox/http/context_test.go index 3b88551a..2255045d 100644 --- a/matchbox/http/context_test.go +++ b/matchbox/http/context_test.go @@ -3,8 +3,8 @@ package http import ( "testing" + "context" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" ) diff --git a/matchbox/http/ctxh.go b/matchbox/http/ctxh.go index 2f05f4d7..81d92560 100644 --- a/matchbox/http/ctxh.go +++ b/matchbox/http/ctxh.go @@ -3,7 +3,7 @@ package http import ( "net/http" - "golang.org/x/net/context" + "context" ) // ContextHandler defines a handler which receives a passed context.Context diff --git a/matchbox/http/ctxh_test.go b/matchbox/http/ctxh_test.go index 9fd08005..c31de882 100644 --- a/matchbox/http/ctxh_test.go +++ b/matchbox/http/ctxh_test.go @@ -6,8 +6,8 @@ import ( "net/http/httptest" "testing" + "context" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" ) func TestNewHandler(t *testing.T) { diff --git a/matchbox/http/generic.go b/matchbox/http/generic.go index 650b1b67..85ab5ffc 100644 --- a/matchbox/http/generic.go +++ b/matchbox/http/generic.go @@ -6,8 +6,8 @@ import ( "strings" "time" + "context" "github.com/Sirupsen/logrus" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" diff --git a/matchbox/http/generic_test.go b/matchbox/http/generic_test.go index 9bf9c0b1..8da45dff 100644 --- a/matchbox/http/generic_test.go +++ b/matchbox/http/generic_test.go @@ -5,9 +5,9 @@ import ( "net/http/httptest" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/http/grub.go b/matchbox/http/grub.go index 9dd2b9b9..600b8fa6 100644 --- a/matchbox/http/grub.go +++ b/matchbox/http/grub.go @@ -5,8 +5,8 @@ import ( "net/http" "text/template" + "context" "github.com/Sirupsen/logrus" - "golang.org/x/net/context" ) var grubTemplate = template.Must(template.New("GRUB2 config").Parse(`default=0 diff --git a/matchbox/http/handlers.go b/matchbox/http/handlers.go index d8cbb87d..abaae8d5 100644 --- a/matchbox/http/handlers.go +++ b/matchbox/http/handlers.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - "golang.org/x/net/context" + "context" "github.com/coreos/coreos-baremetal/matchbox/server" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" diff --git a/matchbox/http/handlers_test.go b/matchbox/http/handlers_test.go index 14a8235c..a0f8eed6 100644 --- a/matchbox/http/handlers_test.go +++ b/matchbox/http/handlers_test.go @@ -6,9 +6,9 @@ import ( "net/http/httptest" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/http/ignition.go b/matchbox/http/ignition.go index 3cd0cba2..1a0a35b1 100644 --- a/matchbox/http/ignition.go +++ b/matchbox/http/ignition.go @@ -5,10 +5,10 @@ import ( "net/http" "strings" + "context" "github.com/Sirupsen/logrus" fuze "github.com/coreos/fuze/config" ignition "github.com/coreos/ignition/config" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" diff --git a/matchbox/http/ignition_test.go b/matchbox/http/ignition_test.go index 12f152aa..6ecc16bf 100644 --- a/matchbox/http/ignition_test.go +++ b/matchbox/http/ignition_test.go @@ -5,9 +5,9 @@ import ( "net/http/httptest" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/http/ipxe.go b/matchbox/http/ipxe.go index a6e140bc..3068a434 100644 --- a/matchbox/http/ipxe.go +++ b/matchbox/http/ipxe.go @@ -6,8 +6,8 @@ import ( "net/http" "text/template" + "context" "github.com/Sirupsen/logrus" - "golang.org/x/net/context" ) const ipxeBootstrap = `#!ipxe diff --git a/matchbox/http/ipxe_test.go b/matchbox/http/ipxe_test.go index 422390ca..fb8b006c 100644 --- a/matchbox/http/ipxe_test.go +++ b/matchbox/http/ipxe_test.go @@ -5,9 +5,9 @@ import ( "net/http/httptest" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" fake "github.com/coreos/coreos-baremetal/matchbox/storage/testfakes" diff --git a/matchbox/http/metadata.go b/matchbox/http/metadata.go index 0b484a2a..4c866706 100644 --- a/matchbox/http/metadata.go +++ b/matchbox/http/metadata.go @@ -6,8 +6,8 @@ import ( "net/http" "strings" + "context" "github.com/Sirupsen/logrus" - "golang.org/x/net/context" ) const plainContentType = "plain/text" diff --git a/matchbox/http/metadata_test.go b/matchbox/http/metadata_test.go index 085d02e0..e11ff753 100644 --- a/matchbox/http/metadata_test.go +++ b/matchbox/http/metadata_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" ) diff --git a/matchbox/http/pixiecore.go b/matchbox/http/pixiecore.go index 4c4499ce..b07ea831 100644 --- a/matchbox/http/pixiecore.go +++ b/matchbox/http/pixiecore.go @@ -4,8 +4,8 @@ import ( "net/http" "path/filepath" + "context" "github.com/Sirupsen/logrus" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" diff --git a/matchbox/http/pixiecore_test.go b/matchbox/http/pixiecore_test.go index 6116f3f5..d372469b 100644 --- a/matchbox/http/pixiecore_test.go +++ b/matchbox/http/pixiecore_test.go @@ -5,9 +5,9 @@ import ( "net/http/httptest" "testing" + "context" logtest "github.com/Sirupsen/logrus/hooks/test" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" "github.com/coreos/coreos-baremetal/matchbox/server" "github.com/coreos/coreos-baremetal/matchbox/storage/storagepb" diff --git a/matchbox/server/server.go b/matchbox/server/server.go index b9704179..c202d6d3 100644 --- a/matchbox/server/server.go +++ b/matchbox/server/server.go @@ -4,7 +4,7 @@ import ( "errors" "sort" - "golang.org/x/net/context" + "context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" "github.com/coreos/coreos-baremetal/matchbox/storage" diff --git a/matchbox/server/server_test.go b/matchbox/server/server_test.go index 3b978630..469d570f 100644 --- a/matchbox/server/server_test.go +++ b/matchbox/server/server_test.go @@ -3,8 +3,8 @@ package server import ( "testing" + "context" "github.com/stretchr/testify/assert" - "golang.org/x/net/context" pb "github.com/coreos/coreos-baremetal/matchbox/server/serverpb" "github.com/coreos/coreos-baremetal/matchbox/storage"