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 go.mod dependencies, and fix issues #828

Merged
merged 1 commit into from
Dec 22, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.19

- name: Check linting
uses: golangci/golangci-lint-action@v3
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.19

- name: Execute go mod tidy and check the outcome
working-directory: ./operators
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.19

- uses: actions/setup-python@v2
with:
Expand All @@ -75,13 +75,12 @@ jobs:
- name: Install Kubebuilder
run: |
version=2.3.1 # latest stable version
arch=amd64
kubernetes_version=1.19.2
curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_${arch}.tar.gz"
tar -zxvf kubebuilder_${version}_linux_${arch}.tar.gz
mv kubebuilder_${version}_linux_${arch} kubebuilder
curl -L -O "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-${kubernetes_version}-linux-${arch}.tar.gz"
tar -zxvf kubebuilder-tools-${kubernetes_version}-linux-${arch}.tar.gz kubebuilder/bin/kube-apiserver --overwrite -C kubebuilder/bin
kubernetes_version=1.25.0
curl -L -O "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${version}/kubebuilder_${version}_linux_$(go env GOARCH).tar.gz"
tar -zxvf kubebuilder_${version}_linux_$(go env GOARCH).tar.gz
mv kubebuilder_${version}_linux_$(go env GOARCH) kubebuilder
curl --fail -sSLo envtest-bins.tar.gz "https://go.kubebuilder.io/test-tools/${kubernetes_version}/$(go env GOOS)/$(go env GOARCH)"
tar -zxvf envtest-bins.tar.gz kubebuilder/bin/kube-apiserver --overwrite -C kubebuilder/bin
sudo mv kubebuilder /usr/local/

- name: Perform the tests
Expand Down Expand Up @@ -112,7 +111,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.16
go-version: 1.19

- name: Run the automatic generation
working-directory: operators/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16 as builder
FROM golang:1.19 as builder

COPY ./ /tmp/custom-error-pages
WORKDIR /tmp/custom-error-pages
Expand Down
19 changes: 16 additions & 3 deletions infrastructure/ingress-controller/custom-error-pages/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
module github.com/netgroup-polito/CrownLabs/infrastructure/ingress-controller/custom-error-pages

go 1.16
go 1.19

require (
github.com/prometheus/client_golang v1.11.0
k8s.io/klog/v2 v2.9.0
github.com/prometheus/client_golang v1.14.0
k8s.io/klog/v2 v2.80.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/sys v0.3.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
)
163 changes: 28 additions & 135 deletions infrastructure/ingress-controller/custom-error-pages/go.sum

Large diffs are not rendered by default.

19 changes: 2 additions & 17 deletions operators/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ gen: generate fmt vet manifests

#run all tests
test:
# KubeVirt registers two versions of its API, which is not supported by
# the kubernetes client. This environment variable is required to force
# KubeVirt register only a specific version of the API
KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1alpha3 \
go test ./... -coverprofile coverage.out -covermode=count
go test ./... -coverprofile coverage.out -covermode=count

test-python: python-dependencies
python3 ./cmd/delete-stale-instances/test_delete_stale_instances.py
Expand Down Expand Up @@ -63,24 +59,13 @@ generate: controller-gen
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
@{ \
set -e ;\
CONTROLLER_GEN_TMP_DIR=$$(mktemp -d) ;\
cd $$CONTROLLER_GEN_TMP_DIR ;\
go mod init tmp ;\
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.1 ;\
rm -rf $$CONTROLLER_GEN_TMP_DIR ;\
}
@go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
endif

run-instance: generate
# KubeVirt registers two versions of its API, which is not supported by
# the kubernetes client. This environment variable is required to force
# KubeVirt register only a specific version of the API
KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION=v1alpha3 \
go run cmd/instance-operator/main.go\
--webdav-secret-name=nextcloud-credentials\
--namespace-whitelist=crownlabs.polito.it/operator-selector=local\
Expand Down
1 change: 1 addition & 0 deletions operators/api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions operators/api/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions operators/build/golang-common/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.16 as builder
FROM golang:1.19 as builder
WORKDIR /tmp/builder

COPY go.mod ./go.mod
Expand All @@ -23,9 +23,4 @@ ARG COMPONENT
COPY --from=builder /tmp/builder/$COMPONENT /usr/bin/$COMPONENT
RUN ln -s /usr/bin/$COMPONENT /usr/bin/crownlabs-component

# KubeVirt registers two versions of its API, which is not supported by
# the kubernetes client. This environment variable is required to force
# KubeVirt register only a specific version of the API
ENV KUBEVIRT_CLIENT_GO_SCHEME_REGISTRATION_VERSION v1alpha3

ENTRYPOINT [ "/usr/bin/crownlabs-component" ]
6 changes: 3 additions & 3 deletions operators/cmd/instance-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
"k8s.io/klog/v2"
"k8s.io/klog/v2/klogr"
virtv1 "kubevirt.io/client-go/api/v1"
cdiv1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1"
virtv1 "kubevirt.io/api/core/v1"
cdiv1beta1 "kubevirt.io/containerized-data-importer-api/pkg/apis/core/v1beta1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"

Expand All @@ -54,7 +54,7 @@ func init() {
utilruntime.Must(crownlabsv1alpha2.AddToScheme(scheme))

utilruntime.Must(virtv1.AddToScheme(scheme))
utilruntime.Must(cdiv1.AddToScheme(scheme))
utilruntime.Must(cdiv1beta1.AddToScheme(scheme))
}

func main() {
Expand Down
9 changes: 1 addition & 8 deletions operators/deploy/crds/crownlabs.polito.it_imagelists.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: imagelists.crownlabs.polito.it
spec:
Expand Down Expand Up @@ -76,9 +75,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions operators/deploy/crds/crownlabs.polito.it_instances.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: instances.crownlabs.polito.it
spec:
Expand Down Expand Up @@ -195,9 +194,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: instancesnapshots.crownlabs.polito.it
spec:
Expand Down Expand Up @@ -101,9 +100,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions operators/deploy/crds/crownlabs.polito.it_templates.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: templates.crownlabs.polito.it
spec:
Expand Down Expand Up @@ -245,9 +244,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions operators/deploy/crds/crownlabs.polito.it_tenants.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: tenants.crownlabs.polito.it
spec:
Expand Down Expand Up @@ -245,9 +244,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
9 changes: 1 addition & 8 deletions operators/deploy/crds/crownlabs.polito.it_workspaces.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
name: workspaces.crownlabs.polito.it
spec:
Expand Down Expand Up @@ -130,9 +129,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading