Skip to content

Commit

Permalink
bump: golang to v1.21 and remove harvester dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Jack Yu <jack.yu@suse.com>
  • Loading branch information
Yu-Jack authored and bk201 committed Apr 23, 2024
1 parent 1a9b8ab commit 46b72a9
Show file tree
Hide file tree
Showing 70 changed files with 82 additions and 52,210 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.suse.com/bci/golang:1.20
FROM registry.suse.com/bci/golang:1.21

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH
Expand Down
11 changes: 2 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
module github.com/rancher/support-bundle-kit

go 1.20
go 1.21

replace (
github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go v3.2.1-0.20200107013213-dc14462fd587+incompatible
github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d
github.com/docker/docker => github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce
github.com/harvester/harvester => github.com/harvester/harvester v0.0.2-0.20220823063817-dc6a30894d63
github.com/knative/pkg => github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e
github.com/openshift/api => github.com/openshift/api v0.0.0-20191219222812-2987a591a72c
github.com/openshift/client-go => github.com/openshift/client-go v0.0.0-20191125132246-f6563a70e19a
Expand Down Expand Up @@ -43,6 +42,7 @@ replace (
k8s.io/controller-manager => k8s.io/controller-manager v0.27.11
k8s.io/cri-api => k8s.io/cri-api v0.27.11
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.11
k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.27.11
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.11
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.11
k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
Expand All @@ -66,7 +66,6 @@ replace (
require (
github.com/Jeffail/gabs/v2 v2.6.1
github.com/gorilla/mux v1.8.0
github.com/harvester/harvester v1.2.1
github.com/mitchellh/go-homedir v1.1.0
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.27.4
Expand Down Expand Up @@ -165,7 +164,6 @@ require (
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
//github.com/harvester/harvester v0.0.2-0.20210528023109-d95127388f17
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -182,8 +180,6 @@ require (
github.com/nxadm/tail v1.4.8 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/selinux v1.10.0 // indirect
github.com/openshift/custom-resource-status v1.1.2 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
Expand Down Expand Up @@ -252,9 +248,6 @@ require (
k8s.io/legacy-cloud-providers v0.0.0 // indirect
k8s.io/mount-utils v0.23.7 // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
kubevirt.io/api v0.0.0-20220430221853-33880526e414 // indirect
kubevirt.io/containerized-data-importer-api v1.47.0 // indirect
kubevirt.io/controller-lifecycle-operator-sdk/api v0.0.0-20220329064328-f3cc58c6ed90 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
Expand Down
104 changes: 69 additions & 35 deletions go.sum

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pkg/utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ import (
"net/http"
"strings"

"github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1"
"github.com/sirupsen/logrus"
)

type ErrorResponse struct {
// Errors happened during request.
Errors []string `json:"errors,omitempty"`
}

func httpResponseBody(obj interface{}) []byte {
respBody, err := json.Marshal(obj)
if err != nil {
Expand All @@ -34,7 +38,7 @@ func HttpResponseError(rw http.ResponseWriter, statusCode int, err error) {

func HttpResponseErrorMsg(rw http.ResponseWriter, statusCode int, errMsg string) {
rw.WriteHeader(statusCode)
_, _ = rw.Write(httpResponseBody(v1beta1.ErrorResponse{Errors: []string{errMsg}}))
_, _ = rw.Write(httpResponseBody(ErrorResponse{Errors: []string{errMsg}}))
}

// HttpGetDispositionFilename parses value of "Content-Disposition" header
Expand Down
177 changes: 0 additions & 177 deletions vendor/github.com/harvester/harvester/LICENSE

This file was deleted.

Loading

0 comments on commit 46b72a9

Please sign in to comment.