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

Upgrade to Go 1.22 #779

Merged
merged 5 commits into from
Apr 10, 2024
Merged
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/ci.yaml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20.8'
go-version: '1.22.2'
- shell: bash
run: |
make manifests
@@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20.8'
go-version: '1.22.2'
- name: operator image
run: make docker-build-operator IMG=humio/humio-operator:${{ github.sha }}
- name: helper image
10 changes: 7 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -36,9 +36,13 @@ jobs:
# a pull request then we can checkout the head.
fetch-depth: 2

- uses: actions/setup-go@v4
with:
go-version: '1.22.2'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -49,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
@@ -63,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20.8'
go-version: '1.22.2'
- name: cleanup kind
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.19.0/kind-linux-amd64
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.22 as builder

ARG RELEASE_VERSION=master
ARG RELEASE_COMMIT=none
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

# Image URL to use all building/pushing image targets
IMG ?= humio/humio-operator:latest
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
@@ -38,7 +36,7 @@ help: ## Display this help.
##@ Development

manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
hack/gen-crds.sh # NOTE: This line was custom added for the humio-operator project.

generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -54,7 +52,7 @@ test: manifests generate fmt vet ginkgo ## Run tests.
ifndef HUMIO_E2E_LICENSE
$(error HUMIO_E2E_LICENSE not set)
endif
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@395cfc7486e652d19fe1b544a436f9852ba26e4f
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
$(SHELL) -c "\
eval \$$($(GOBIN)/setup-envtest use -p env ${TEST_K8S_VERSION}); \
export USE_CERTMANAGER=false; \
@@ -91,7 +89,7 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi

CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.2)
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)

KUSTOMIZE = $(shell pwd)/bin/kustomize
kustomize: ## Download kustomize locally if necessary.
@@ -105,6 +103,7 @@ set -e ;\
TMP_DIR=$$(mktemp -d) ;\
cd $$TMP_DIR ;\
go mod init tmp ;\
go version ;\
echo "Downloading $(2)" ;\
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
rm -rf $$TMP_DIR ;\
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

61 changes: 34 additions & 27 deletions charts/humio-operator/crds/core.humio.com_humioactions.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: humioactions.core.humio.com
labels:
app: 'humio-operator'
@@ -28,14 +26,19 @@ spec:
description: HumioAction is the Schema for the humioactions API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -58,9 +61,9 @@ spec:
type: boolean
type: object
externalClusterName:
description: ExternalClusterName refers to an object of type HumioExternalCluster
where the Humio resources should be created. This conflicts with
ManagedClusterName.
description: |-
ExternalClusterName refers to an object of type HumioExternalCluster where the Humio resources should be created.
This conflicts with ManagedClusterName.
type: string
humioRepositoryProperties:
description: HumioRepositoryProperties indicates this is a Humio Repository
@@ -78,8 +81,10 @@ spec:
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
optional:
description: Specify whether the Secret or its key must
@@ -88,12 +93,14 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
type: object
managedClusterName:
description: ManagedClusterName refers to an object of type HumioCluster
that is managed by the operator where the Humio resources should
be created. This conflicts with ExternalClusterName.
description: |-
ManagedClusterName refers to an object of type HumioCluster that is managed by the operator where the Humio
resources should be created.
This conflicts with ExternalClusterName.
type: string
name:
description: Name is the name of the Action
@@ -116,8 +123,10 @@ spec:
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
optional:
description: Specify whether the Secret or its key must
@@ -126,6 +135,7 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
useProxy:
type: boolean
@@ -157,8 +167,10 @@ spec:
be a valid secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
description: |-
Name of the referent.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
optional:
description: Specify whether the Secret or its key must
@@ -167,6 +179,7 @@ spec:
required:
- key
type: object
x-kubernetes-map-type: atomic
type: object
channels:
items:
@@ -242,9 +255,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
50 changes: 25 additions & 25 deletions charts/humio-operator/crds/core.humio.com_humioalerts.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.2
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: humioalerts.core.humio.com
labels:
app: 'humio-operator'
@@ -28,14 +26,19 @@ spec:
description: HumioAlert is the Schema for the humioalerts API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
@@ -52,19 +55,20 @@ spec:
description: Description is the description of the Alert
type: string
externalClusterName:
description: ExternalClusterName refers to an object of type HumioExternalCluster
where the Humio resources should be created. This conflicts with
ManagedClusterName.
description: |-
ExternalClusterName refers to an object of type HumioExternalCluster where the Humio resources should be created.
This conflicts with ManagedClusterName.
type: string
labels:
description: Labels are a set of labels on the Alert
items:
type: string
type: array
managedClusterName:
description: ManagedClusterName refers to an object of type HumioCluster
that is managed by the operator where the Humio resources should
be created. This conflicts with ExternalClusterName.
description: |-
ManagedClusterName refers to an object of type HumioCluster that is managed by the operator where the Humio
resources should be created.
This conflicts with ExternalClusterName.
type: string
name:
description: Name is the name of the alert inside Humio
@@ -73,12 +77,14 @@ spec:
description: Query defines the desired state of the Humio query
properties:
end:
description: 'End is the end time for the query. Defaults to "now"
Deprecated: Will be ignored. All alerts end at "now".'
description: |-
End is the end time for the query. Defaults to "now"
Deprecated: Will be ignored. All alerts end at "now".
type: string
isLive:
description: 'IsLive sets whether the query is a live query. Defaults
to "true" Deprecated: Will be ignored. All alerts are live.'
description: |-
IsLive sets whether the query is a live query. Defaults to "true"
Deprecated: Will be ignored. All alerts are live.
type: boolean
queryString:
description: QueryString is the Humio query that will trigger
@@ -123,9 +129,3 @@ spec:
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading