Skip to content

Commit

Permalink
Updates latest Envoy to 1.21 and tidies proc.go (#422)
Browse files Browse the repository at this point in the history
This update the last known Envoy version to 1.21 now that it exists in
Homebrew. Note: this is the first to work with arm64+darwin.

See Homebrew/homebrew-core#90921

Signed-off-by: Adrian Cole <[email protected]>
  • Loading branch information
codefromthecrypt authored Jan 22, 2022
1 parent 21fd58e commit ffeecb5
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

golangci_lint := github.com/golangci/golangci-lint/cmd/[email protected]
goimports := golang.org/x/tools/cmd/[email protected]
hugo := github.com/gohugoio/hugo@v0.91.2
hugo := github.com/gohugoio/hugo@v0.92.0
licenser := github.com/liamawhite/[email protected]
nfpm := github.com/goreleaser/nfpm/v2/cmd/[email protected]
6 changes: 3 additions & 3 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ To run Envoy, execute `func-e run -c your_envoy_config.yaml`. This
downloads and installs the latest version of Envoy for you.

To list versions of Envoy you can use, execute `func-e versions -a`. To
choose one, invoke `func-e use 1.20.1`. This installs into
`$FUNC_E_HOME/versions/1.20.1`, if not already present. You may also use
minor version, such as `func-e use 1.20`.
choose one, invoke `func-e use 1.21.0`. This installs into
`$FUNC_E_HOME/versions/1.21.0`, if not already present. You may also use
minor version, such as `func-e use 1.21`.

You may want to override `$ENVOY_VERSIONS_URL` to supply custom builds or
otherwise control the source of Envoy binaries. When overriding, validate
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ require (
github.com/tklauser/go-sysconf v0.3.9 // indirect
github.com/tklauser/numcpus v0.3.0 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
5 changes: 2 additions & 3 deletions internal/moreos/moreos_func-e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ var (
fakeFuncESrc []byte // Embedding the fakeFuncESrc is easier than file I/O and ensures it doesn't skew coverage

// Include the source imported by fakeFuncESrc directly and indirectly
// TODO: replace wildcard with {{goos}} after https://github.com/golang/go/issues/48348.
//go:embed moreos.go
//go:embed proc_*.go
// We can't use wildcards because golang/go#48348 declined adding support for {{goos}} variables
//go:embed moreos.go proc.go proc_attr_darwin.go proc_attr_linux.go proc_windows.go
moreosSrcDir embed.FS
)

Expand Down
6 changes: 2 additions & 4 deletions internal/moreos/proc_darwin.go → internal/moreos/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !windows

package moreos

import (
Expand All @@ -21,10 +23,6 @@ import (

const exe = ""

func processGroupAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{Setpgid: true}
}

func interrupt(p *os.Process) error {
if err := p.Signal(syscall.SIGINT); err != nil && err != os.ErrProcessDone {
return err
Expand Down
23 changes: 23 additions & 0 deletions internal/moreos/proc_attr_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2022 Tetrate
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package moreos

import (
"syscall"
)

func processGroupAttr() *syscall.SysProcAttr {
return &syscall.SysProcAttr{Setpgid: true}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Tetrate
// Copyright 2022 Tetrate
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -15,32 +15,11 @@
package moreos

import (
"os"
"syscall"
)

const exe = ""

func processGroupAttr() *syscall.SysProcAttr {
// Pdeathsig aims to ensure the process group is cleaned up even if this process dies. When func-e
// dies, the process (envoy) will get SIGKILL.
return &syscall.SysProcAttr{Setpgid: true, Pdeathsig: syscall.SIGKILL}
}

func interrupt(p *os.Process) error {
if err := p.Signal(syscall.SIGINT); err != nil && err != os.ErrProcessDone {
return err
}
return nil
}

func ensureProcessDone(p *os.Process) error {
if err := p.Kill(); err != nil && err != os.ErrProcessDone {
return err
}
return nil
}

func isExecutable(f os.FileInfo) bool {
return f.Mode()&0o111 != 0
}
2 changes: 1 addition & 1 deletion internal/version/last_known_envoy.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.1
1.21.0
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
publish = "public"

[build.environment]
HUGO_VERSION = "0.85.0"
HUGO_VERSION = "0.92.0"

[context.production]
command = "git submodule update --init && hugo --gc --minify"
Expand Down
6 changes: 3 additions & 3 deletions packaging/nfpm/func-e.8
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ To run Envoy, execute \fB\fCfunc-e run -c your_envoy_config.yaml\fR\&. This

.PP
To list versions of Envoy you can use, execute \fB\fCfunc-e versions -a\fR\&. To
choose one, invoke \fB\fCfunc-e use 1.20.1\fR\&. This installs into
\fB\fC$FUNC_E_HOME/versions/1.20.1\fR, if not already present. You may also use
minor version, such as \fB\fCfunc-e use 1.20\fR\&.
choose one, invoke \fB\fCfunc-e use 1.21.0\fR\&. This installs into
\fB\fC$FUNC_E_HOME/versions/1.21.0\fR, if not already present. You may also use
minor version, such as \fB\fCfunc-e use 1.21\fR\&.

.PP
You may want to override \fB\fC$ENVOY_VERSIONS_URL\fR to supply custom builds or
Expand Down

0 comments on commit ffeecb5

Please sign in to comment.