Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
facchettos committed Feb 9, 2024
1 parent 74ef4e9 commit d990bdd
Show file tree
Hide file tree
Showing 42 changed files with 21 additions and 3,020 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/go-logr/logr v1.4.1
github.com/go-openapi/loads v0.21.2
github.com/go-spectest/markdown v0.0.7
github.com/google/go-github/v53 v53.2.1-0.20230815134205-bb00f570d301
github.com/gorilla/websocket v1.5.1
github.com/hashicorp/go-hclog v0.14.1
Expand Down Expand Up @@ -87,7 +86,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 // indirect
github.com/karrick/godirwalk v1.17.0 // indirect
github.com/loft-sh/admin-apis v0.0.0-20240203010124-3600c1c582a8 // indirect
github.com/loft-sh/apiserver v0.0.0-20240125143607-a106e2f2e0f1 // indirect
github.com/loft-sh/jspolicy v0.2.2 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,6 @@ github.com/go-openapi/validate v0.19.12/go.mod h1:Rzou8hA/CBw8donlS6WNEUQupNvUZ0
github.com/go-openapi/validate v0.19.15/go.mod h1:tbn/fdOwYHgrhPBzidZfJC2MIVvs9GA7monOmWBbeCI=
github.com/go-openapi/validate v0.20.1/go.mod h1:b60iJT+xNNLfaQJUqLI7946tYiFEOuE9E4k54HpKcJ0=
github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
github.com/go-spectest/markdown v0.0.7 h1:Pr+A/YBCtEruReeMMzBKQ4ftvNtlWuaiWRqgNaETA8Q=
github.com/go-spectest/markdown v0.0.7/go.mod h1:OaFedfVlu5+eqe5tI2j3+LD/39T7k5JZAklxTul98EQ=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
Expand Down Expand Up @@ -600,8 +598,6 @@ github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213 h1:qGQQKEcAR99REcM
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/karrick/godirwalk v1.17.0 h1:b4kY7nqDdioR/6qnbHQyDvmA17u5G1cZ6J+CZXwSWoI=
github.com/karrick/godirwalk v1.17.0/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
Expand Down
22 changes: 21 additions & 1 deletion hack/compat-matrix/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"bytes"
_ "embed"
"os"
"path/filepath"
"slices"
Expand All @@ -12,8 +14,13 @@ import (
"golang.org/x/exp/maps"
)

//go:embed matrix-template.tmpl
var template []byte

func main() {
table := tablewriter.NewWriter(os.Stdout)
buff := &bytes.Buffer{}
_, _ = buff.Write(template)
table := tablewriter.NewWriter(buff)
table.SetHeader([]string{"Vcluster Distro", "k8s Host version", "Distro version"})
updateTableWithDistro(table, "k3s", values.K3SVersionMap)
updateTableWithDistro(table, "k0s", values.K0SVersionMap)
Expand All @@ -23,6 +30,19 @@ func main() {
table.SetBorders(tablewriter.Border{Left: true, Top: false, Right: true, Bottom: false})
table.SetCenterSeparator("|")
table.Render()
rendered := buff.Bytes()
currentFile, err := os.ReadFile(os.Args[1])
if err != nil {
os.Stderr.WriteString(err.Error())
os.Exit(1)
}
if !slices.Equal(rendered, currentFile) {
err := os.WriteFile(os.Args[1], rendered, 644)

Check failure on line 40 in hack/compat-matrix/main.go

View workflow job for this annotation

GitHub Actions / lint

SA9002: file mode '644' evaluates to 01204; did you mean '0644'? (staticcheck)
if err != nil {
os.Stderr.WriteString(err.Error())
os.Exit(1)
}
}
}

func updateTableWithDistro(table *tablewriter.Table, distroName string, versionMap map[string]string) {
Expand Down
8 changes: 0 additions & 8 deletions hack/compat-matrix/matrix-template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@

The following table provides a compatibility matrix of which k8s version are supported aginst which vcluster distro versions:



| Vcluster Distro | k8s Host version | Distro Version |
| --------------- | ---------------- | -------------------- |
| {{ .Distro }} | {{ .HostVersion}} | v1.28.2-eks-1-28-6 |
| | 1.27 | v1.27.6-eks-1-27-13 |
| | 1.26 | v1.26.9-eks-1-26-19 |
| | 1.25 | v1.25.14-eks-1-25-23 |
23 changes: 0 additions & 23 deletions vendor/github.com/go-spectest/markdown/.gitignore

This file was deleted.

56 changes: 0 additions & 56 deletions vendor/github.com/go-spectest/markdown/.golangci.yml

This file was deleted.

20 changes: 0 additions & 20 deletions vendor/github.com/go-spectest/markdown/.octocov.yml

This file was deleted.

21 changes: 0 additions & 21 deletions vendor/github.com/go-spectest/markdown/LICENSE

This file was deleted.

26 changes: 0 additions & 26 deletions vendor/github.com/go-spectest/markdown/Makefile

This file was deleted.

Loading

0 comments on commit d990bdd

Please sign in to comment.