Skip to content

Commit

Permalink
Merge pull request #153 from salasberryfin/downgrade-wrangler-version
Browse files Browse the repository at this point in the history
chore: downgrade wrangler version
  • Loading branch information
salasberryfin committed Jul 19, 2023
2 parents 63eb8c4 + 538d381 commit 2afb989
Show file tree
Hide file tree
Showing 13 changed files with 299 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ steps:
when:
ref:
- refs/head/master
- refs/head/rancher/v2.6
- refs/tags/*
event:
- tag
Expand Down Expand Up @@ -107,6 +108,7 @@ steps:
when:
ref:
- refs/head/master
- refs/head/rancher/v2.6
- refs/tags/*
event:
- tag
Expand Down
26 changes: 26 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: ":seedling:"
# Go
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
ignore:
# Ignore controller-runtime as its upgraded manually.
- dependency-name: "sigs.k8s.io/controller-runtime"
# Ignore k8s and its transitives modules as they are upgraded manually
# together with controller-runtime.
- dependency-name: "k8s.io/*"
# Ignore wrangler
- dependency-name: "github.com/rancher/wrangler"
commit-message:
prefix: ":seedling:"
14 changes: 14 additions & 0 deletions .github/workflows/apidiff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Go API Diff
on:
pull_request:
jobs:
go-apidiff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: joelanford/go-apidiff@main
27 changes: 27 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build
on:
pull_request:
push:
branches:
- master
- rancher/v2.6
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-build-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-go-${{ hashFiles('**/go.sum') }}
- name: Build GKE operator binary
run: make operator
23 changes: 23 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint
on:
pull_request:
push:
branches:
- master
- rancher/v2.6
tags:
- 'v*'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- name: Analysis
uses: golangci/golangci-lint-action@v3
with:
args: -v
31 changes: 31 additions & 0 deletions .github/workflows/nightly-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Nightly
on:
schedule:
- cron: '0 1 * * *'
jobs:
nightly:
env:
REPO: ttl.sh/gke-operator-nightly
TAG: 1d
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build binary
run: make build
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Build and push image
uses: docker/[email protected]
with:
context: .
tags: ${{ env.REPO}}-${{ env.NOW }}:${{ env.TAG }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
file: package/Dockerfile
38 changes: 38 additions & 0 deletions .github/workflows/scan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Scan
on:
pull_request:
push:
branches:
- master
- rancher/v2.6
tags:
- "v*"
jobs:
scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build binary
run: make build
- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]
- name: Build image
uses: docker/[email protected]
with:
context: .
tags: ghcr.io/rancher/gke-operator:${{ github.sha }}
load: true
push: false
file: package/Dockerfile
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: "ghcr.io/rancher/gke-operator:${{ github.sha }}"
format: "table"
exit-code: "1"
ignore-unfixed: true
severity: "CRITICAL,HIGH"
27 changes: 27 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify
on:
pull_request:
push:
branches:
- master
- rancher/v2.6
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/[email protected]
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }}
- name: Run make verify
run: |
make verify
56 changes: 53 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,66 @@
TARGETS := $(shell ls scripts)

ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
BIN_DIR := $(abspath $(ROOT_DIR)/bin)
GO_INSTALL = ./scripts/go_install.sh

MOCKGEN_VER := v1.6.0
MOCKGEN_BIN := mockgen
MOCKGEN := $(BIN_DIR)/$(MOCKGEN_BIN)-$(MOCKGEN_VER)
MOCKGEN_PKG := github.com/golang/mock/mockgen

GO_APIDIFF_VER := v0.6.0
GO_APIDIFF_BIN := go-apidiff
GO_APIDIFF := $(BIN_DIR)/$(GO_APIDIFF_BIN)-$(GO_APIDIFF_VER)
GO_APIDIFF_PKG := github.com/joelanford/go-apidiff


$(MOCKGEN):
GOBIN=$(BIN_DIR) $(GO_INSTALL) $(MOCKGEN_PKG) $(MOCKGEN_BIN) $(MOCKGEN_VER)

$(GO_APIDIFF):
GOBIN=$(BIN_DIR) $(GO_INSTALL) $(GO_APIDIFF_PKG) $(GO_APIDIFF_BIN) $(GO_APIDIFF_VER)

.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper

.PHONY: $(TARGETS)
$(TARGETS): .dapper
./.dapper $@

clean:
rm -rf build bin dist
.PHONY: generate-go
generate-go: $(MOCKGEN)
go generate ./pkg/gke/...

.PHONY: $(TARGETS)
.PHONY: generate-crd
generate-crd: $(MOCKGEN)
go generate main.go

.PHONY: generate
generate:
$(MAKE) generate-go
$(MAKE) generate-crd

.PHONY: operator
operator:
go build -o bin/gke-operator main.go

ALL_VERIFY_CHECKS = generate

.PHONY: verify
verify: $(addprefix verify-,$(ALL_VERIFY_CHECKS))

.PHONY: verify-generate
verify-generate: generate
@if !(git diff --quiet HEAD); then \
git diff; \
echo "generated files are out of date, run make generate"; exit 1; \
fi

.PHONY: clean
clean:
rm -rf build bin dist
13 changes: 10 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.19
replace k8s.io/client-go => k8s.io/client-go v0.25.4

require (
github.com/rancher/lasso v0.0.0-20210616224652-fc3ebd901c08
github.com/rancher/wrangler v1.0.2
github.com/rancher/lasso v0.0.0-20221221222919-b7ec3b315a41
github.com/rancher/wrangler v1.0.1
github.com/rancher/wrangler-api v0.6.1-0.20200427172631-a7c2f09b783e
github.com/sirupsen/logrus v1.9.3
golang.org/x/oauth2 v0.9.0
Expand All @@ -20,6 +20,8 @@ require (
cloud.google.com/go v0.97.0 // indirect
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.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
Expand All @@ -42,10 +44,15 @@ require (
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/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/pkg/errors v0.9.1 // 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
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
Expand All @@ -72,5 +79,5 @@ require (
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.2.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit 2afb989

Please sign in to comment.