Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support K8s 1.25 #422

Merged
merged 6 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.suse.com/bci/golang:1.17
FROM registry.suse.com/bci/golang:1.19-18.38

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
Expand All @@ -10,7 +10,6 @@ RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.46.2; \
fi

ENV GO111MODULE off
ENV DAPPER_ENV REPO TAG DRONE_TAG
ENV DAPPER_SOURCE /go/src/github.com/rancher/norman/
ENV DAPPER_OUTPUT ./bin ./dist
Expand Down
5 changes: 2 additions & 3 deletions clientbase/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -93,7 +92,7 @@ func IsNotFound(err error) bool {
}

func NewAPIError(resp *http.Response, url string) *APIError {
contents, err := ioutil.ReadAll(resp.Body)
contents, err := io.ReadAll(resp.Body)
var body string
if err != nil {
body = "Unreadable body."
Expand Down Expand Up @@ -273,7 +272,7 @@ func NewAPIClient(opts *ClientOpts) (APIBaseClient, error) {
}

var schemas types.SchemaCollection
bytes, err := ioutil.ReadAll(resp.Body)
bytes, err := io.ReadAll(resp.Body)
if err != nil {
return result, err
}
Expand Down
9 changes: 4 additions & 5 deletions clientbase/ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"regexp"
Expand Down Expand Up @@ -39,7 +38,7 @@ func (a *APIOperations) DoDelete(url string) error {
return err
}
defer func() {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_, _ = io.Copy(io.Discard, resp.Body)
resp.Body.Close()
}()

Expand Down Expand Up @@ -81,7 +80,7 @@ func (a *APIOperations) DoGet(url string, opts *types.ListOpts, respObject inter
return NewAPIError(resp, url)
}

byteContent, err := ioutil.ReadAll(resp.Body)
byteContent, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down Expand Up @@ -155,7 +154,7 @@ func (a *APIOperations) DoModify(method string, url string, createObj interface{
return NewAPIError(resp, url)
}

byteContent, err := ioutil.ReadAll(resp.Body)
byteContent, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down Expand Up @@ -362,7 +361,7 @@ func (a *APIOperations) doAction(
return NewAPIError(resp, actionURL)
}

byteContent, err := ioutil.ReadAll(resp.Body)
byteContent, err := io.ReadAll(resp.Body)
if err != nil {
return err
}
Expand Down
7 changes: 3 additions & 4 deletions generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package generator
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
Expand Down Expand Up @@ -499,7 +498,7 @@ func prepareDirs(dirs ...string) error {
return err
}

files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
return err
}
Expand All @@ -522,7 +521,7 @@ func Gofmt(workDir, pkg string) error {
return nil
}

content, err := ioutil.ReadFile(path)
content, err := os.ReadFile(path)
if err != nil {
return err
}
Expand Down Expand Up @@ -573,7 +572,7 @@ func generateFakes(k8sDir string, controllers []*types.Schema) error {
}
// create the file
filePath := path.Join(k8sDir, "fakes", "zz_generated_"+addUnderscore(controller.ID)+"_mock.go")
err = ioutil.WriteFile(filePath, out.Bytes(), 0644)
err = os.WriteFile(filePath, out.Bytes(), 0644)
if err != nil {
return err
}
Expand Down
73 changes: 61 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,24 +1,73 @@
module github.com/rancher/norman

go 1.12
go 1.19

require (
github.com/ghodss/yaml v1.0.0
github.com/gorilla/websocket v1.4.2
github.com/imdario/mergo v0.3.7 // indirect
github.com/maruel/panicparse v0.0.0-20171209025017-c0182c169410
github.com/maruel/ut v1.0.0 // indirect
github.com/matryer/moq v0.0.0-20200607124540-4638a53893e6
github.com/pkg/errors v0.9.1
github.com/rancher/lasso v0.0.0-20220519004610-700f167d8324
github.com/rancher/wrangler v0.6.2-0.20200820173016-2068de651106
github.com/rancher/lasso v0.0.0-20221202205459-e7138f16489c
github.com/rancher/wrangler v1.0.1-0.20221202234327-1cafffeaa9a1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717
k8s.io/api v0.24.0
k8s.io/apiextensions-apiserver v0.24.0
k8s.io/apimachinery v0.24.0
k8s.io/client-go v0.24.0
github.com/stretchr/testify v1.8.0
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/text v0.3.7
golang.org/x/tools v0.1.12
k8s.io/api v0.25.4
k8s.io/apiextensions-apiserver v0.25.4
k8s.io/apimachinery v0.25.4
k8s.io/client-go v0.25.4
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185
)

require (
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/maruel/ut v1.0.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.70.1 // indirect
k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading