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

Bump to Golang 1.19 #19

Merged
merged 1 commit into from
Feb 16, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.6.0
commands:
- dapper ci
volumes:
Expand Down Expand Up @@ -70,7 +70,7 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.6.0
commands:
- dapper ci
volumes:
Expand Down Expand Up @@ -132,7 +132,7 @@ platform:

steps:
- name: build
image: rancher/dapper:v0.4.1
image: rancher/dapper:v0.6.0
commands:
- dapper ci
volumes:
Expand Down
19 changes: 0 additions & 19 deletions .golangci.json

This file was deleted.

8 changes: 3 additions & 5 deletions Dockerfile.dapper
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM golang:1.16.14-alpine3.14
FROM registry.suse.com/bci/golang:1.19-20.13

ARG DAPPER_HOST_ARCH
ENV ARCH $DAPPER_HOST_ARCH

RUN apk -U add bash git gcc musl-dev docker vim less file curl wget ca-certificates
RUN go install golang.org/x/lint/golint@06c8688daad7faa9da5a0c2f163a3d14aac986ca
RUN go install golang.org/x/tools/cmd/goimports@aa82965741a9fecd12b026fbb3d3c6ed3231b8f8
RUN zypper -n in git-core docker wget
RUN if [ "${ARCH}" == "amd64" ]; then \
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.39.0; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.1; \
fi

ENV DAPPER_ENV REPO TAG DRONE_TAG
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ TARGETS := $(shell ls scripts)
$(TARGETS): .dapper
./.dapper $@

.DEFAULT_GOAL := default
.DEFAULT_GOAL := ci

.PHONY: $(TARGETS)
36 changes: 32 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/rancher/channelserver

go 1.16
go 1.19

replace k8s.io/client-go => k8s.io/client-go v0.20.0

Expand All @@ -11,8 +11,36 @@ require (
github.com/gorilla/mux v1.7.3
github.com/pkg/errors v0.9.1
github.com/rancher/apiserver v0.0.0-20201023000256-1a0a904f9197
github.com/rancher/wrangler v0.8.11-0.20220120160420-18c996a8e956
github.com/sirupsen/logrus v1.6.0
github.com/rancher/wrangler v1.0.2
github.com/sirupsen/logrus v1.8.1
github.com/urfave/cli/v2 v2.4.0
sigs.k8s.io/yaml v1.2.0
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/go-querystring v1.0.0 // indirect
github.com/google/gofuzz v1.1.0 // indirect
github.com/gorilla/websocket v1.4.1 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
k8s.io/api v0.25.4 // indirect
k8s.io/apimachinery v0.25.4 // indirect
k8s.io/apiserver v0.18.0 // indirect
k8s.io/klog v1.0.0 // indirect
k8s.io/klog/v2 v2.70.1 // 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
)
254 changes: 54 additions & 200 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM alpine
FROM registry.suse.com/bci/bci-micro:15.4.17.1
COPY bin/channelserver /usr/bin/
CMD ["channelserver"]
ENTRYPOINT ["channelserver"]
7 changes: 4 additions & 3 deletions pkg/config/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package config
import (
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"

"github.com/blang/semver"
"github.com/google/go-github/v29/github"
Expand All @@ -31,7 +32,7 @@ func getURLs(ctx context.Context, urls ...Source) ([]byte, int, error) {
}

func get(ctx context.Context, url Source) ([]byte, error) {
content, err := ioutil.ReadFile(url.URL())
content, err := os.ReadFile(url.URL())
if err == nil {
return content, nil
}
Expand All @@ -51,7 +52,7 @@ func get(ctx context.Context, url Source) ([]byte, error) {
return nil, fmt.Errorf("status %v", resp.Status)
}

return ioutil.ReadAll(resp.Body)
return io.ReadAll(resp.Body)
}

func GetChannelsConfig(ctx context.Context, content []byte, subKey string) (*model.ChannelsConfig, error) {
Expand Down
4 changes: 2 additions & 2 deletions scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ mkdir -p bin
if [ "$(uname)" = "Linux" ]; then
OTHER_LINKFLAGS="-extldflags -static -s"
fi
LINKFLAGS="-X github.com/rancher/channelserver.Version=$VERSION"
LINKFLAGS="-X github.com/rancher/channelserver.GitCommit=$COMMIT $LINKFLAGS"
LINKFLAGS="-X main.Version=$VERSION"
LINKFLAGS="-X main.GitCommit=$COMMIT $LINKFLAGS"
CGO_ENABLED=0 go build -ldflags "$LINKFLAGS $OTHER_LINKFLAGS" -o bin/channelserver
if [ "$CROSS" = "true" ] && [ "$ARCH" = "amd64" ]; then
GOOS=darwin go build -ldflags "$LINKFLAGS" -o bin/channelserver-darwin
Expand Down
8 changes: 0 additions & 8 deletions scripts/default

This file was deleted.