Skip to content

Commit

Permalink
Upgrade go to 1.22 (#286)
Browse files Browse the repository at this point in the history
Requirements : 
* Upgrade controller-runtime to 0.15.0
* Upgrade golangci-lint to 1.59.1
  • Loading branch information
antonincms authored Aug 1, 2024
1 parent 342dbf8 commit fd228ca
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version-file: go.mod

# Build docker image
- name: Build docker image
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version-file: go.mod

# Instead of using our own CI, we uses https://golangci-lint.run/
# It combines 48 linters and execute them in parallel
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.49
version: v1.59.1
args: --timeout 5m

test:
Expand All @@ -33,7 +33,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: 1.19
go-version-file: go.mod

# Execute tests
- name: Execute tests
Expand Down
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.19 as builder
FROM golang:1.22 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ YQ?= $(LOCALBIN)/yq

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.5
CONTROLLER_TOOLS_VERSION ?= v0.9.2
CONTROLLER_TOOLS_VERSION ?= v0.15.0
CRD_REF_DOCS_VERSION ?= v0.0.8
GOLANG_CI_LINT_VERSION ?= v1.49.0
GOLANG_CI_LINT_VERSION ?= v1.59.1
YQ_VERSION ?= v4.31.1

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
Expand Down
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.

30 changes: 17 additions & 13 deletions config/crd/bases/core.kubestitute.quortex.io_instances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: instances.core.kubestitute.quortex.io
spec:
group: core.kubestitute.quortex.io
Expand Down Expand Up @@ -34,14 +33,19 @@ spec:
description: Instance is the Schema for the instances 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
Expand All @@ -52,11 +56,11 @@ spec:
description: The AutoScaling Group name.
type: string
honorCooldown:
description: Indicates whether Amazon EC2 Auto Scaling waits for the
cooldown period to complete before initiating a scaling activity
to set your Auto Scaling group to its new capacity. By default,
Amazon EC2 Auto Scaling does not honor the cooldown period during
manual scaling activities.
description: |-
Indicates whether Amazon EC2 Auto Scaling waits for the cooldown period to
complete before initiating a scaling activity to set your Auto Scaling group
to its new capacity. By default, Amazon EC2 Auto Scaling does not honor the
cooldown period during manual scaling activities.
type: boolean
required:
- autoscalingGroup
Expand Down
25 changes: 15 additions & 10 deletions config/crd/bases/core.kubestitute.quortex.io_priorityexpanders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: priorityexpanders.core.kubestitute.quortex.io
spec:
group: core.kubestitute.quortex.io
Expand All @@ -28,23 +27,29 @@ spec:
description: PriorityExpander is the Schema for the priorityexpanders 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
spec:
description: PriorityExpanderSpec defines the desired state of PriorityExpander
properties:
template:
description: The Go template to parse, which will generate the priority
expander config map for cluster autoscaler to use.
description: |-
The Go template to parse, which will generate the priority expander
config map for cluster autoscaler to use.
type: string
required:
- template
Expand Down
101 changes: 58 additions & 43 deletions config/crd/bases/core.kubestitute.quortex.io_schedulers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.2
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.15.0
name: schedulers.core.kubestitute.quortex.io
spec:
group: core.kubestitute.quortex.io
Expand All @@ -21,62 +20,76 @@ spec:
description: Scheduler is the Schema for the schedulers 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
spec:
description: SchedulerSpec defines the desired state of Scheduler
properties:
autoscalingGroupFallback:
description: Name of the autoscaling group in which the scheduler
will trigger fallback instances. This autoscaling group must not
be managed by the cluster-autoscaler. These ASG must not be managed
by the cluster-autoscaler. Conflict with autoscalingGroupFallbacks.
description: |-
Name of the autoscaling group in which the scheduler will trigger
fallback instances.
This autoscaling group must not be managed by the cluster-autoscaler.
These ASG must not be managed by the cluster-autoscaler.
Conflict with autoscalingGroupFallbacks.
type: string
autoscalingGroupFallbacks:
description: List of autoscaling groups names in which the scheduler
will trigger fallback instances. These ASG must not be managed by
the cluster-autoscaler. Conflict with autoscalingGroupFallback.
description: |-
List of autoscaling groups names in which the scheduler will trigger
fallback instances.
These ASG must not be managed by the cluster-autoscaler.
Conflict with autoscalingGroupFallback.
items:
type: string
minItems: 1
type: array
autoscalingGroupTarget:
description: Name of the autoscaling group which the scheduler will
use to apply the rules. Conflict with autoscalingGroupTargets.
description: |-
Name of the autoscaling group which the scheduler will use to
apply the rules.
Conflict with autoscalingGroupTargets.
type: string
autoscalingGroupTargets:
description: List of autoscaling groups names which the scheduler
will use to apply the rules. The values are summed. Conflict with
autoscalingGroupTarget.
description: |-
List of autoscaling groups names which the scheduler will use
to apply the rules. The values are summed.
Conflict with autoscalingGroupTarget.
items:
type: string
minItems: 1
type: array
scaleDownRules:
description: Scheduler rules used to match criteria on Target ASG
to trigger Scale Down on Fallback ASG.
description: |-
Scheduler rules used to match criteria on Target ASG to trigger Scale Down
on Fallback ASG.
properties:
policies:
description: Policies is a list of potential scaling polices which
can be evaluated for scaling decisions. At least one policy
must be specified. Instances will be scaled down one by one.
description: |-
Policies is a list of potential scaling polices which can be evaluated for scaling decisions.
At least one policy must be specified.
Instances will be scaled down one by one.
items:
description: SchedulerPolicy is a single policy which must hold
true for a specified past interval.
properties:
leftOperand:
description: LeftOperand is the left operand of the comparison.
It could be the target ASG Health field from which this
policy is applied or an integer.
description: |-
LeftOperand is the left operand of the comparison. It could be the target ASG Health field from
which this policy is applied or an integer.
properties:
field:
description: An Field for value.
Expand Down Expand Up @@ -111,9 +124,9 @@ spec:
format: int32
type: integer
rightOperand:
description: RightOperand is the left operand of the comparison.
It could be the target ASG Health field from which this
policy is applied or an integer.
description: |-
RightOperand is the left operand of the comparison. It could be the target ASG Health field from
which this policy is applied or an integer.
properties:
field:
description: An Field for value.
Expand Down Expand Up @@ -143,22 +156,24 @@ spec:
type: integer
type: object
scaleUpRules:
description: Scheduler rules used to match criteria on Target ASG
to trigger Scale Up on Fallback ASG.
description: |-
Scheduler rules used to match criteria on Target ASG to trigger Scale Up
on Fallback ASG.
properties:
policies:
description: Policies is a list of potential scaling polices which
can be evaluated for scaling decisions. At least one policy
must be specified. For scale ups the matching policy which triggers
the highest number of replicas will be used.
description: |-
Policies is a list of potential scaling polices which can be evaluated for scaling decisions.
At least one policy must be specified.
For scale ups the matching policy which triggers the highest number of replicas
will be used.
items:
description: AdvancedSchedulerPolicy is a policy that allow
arithmetic operation to compute replicas.
properties:
leftOperand:
description: LeftOperand is the left operand of the comparison.
It could be the target ASG Health field from which this
policy is applied or an integer.
description: |-
LeftOperand is the left operand of the comparison. It could be the target ASG Health field from
which this policy is applied or an integer.
properties:
field:
description: An Field for value.
Expand Down Expand Up @@ -258,9 +273,9 @@ spec:
type: object
type: object
rightOperand:
description: RightOperand is the left operand of the comparison.
It could be the target ASG Health field from which this
policy is applied or an integer.
description: |-
RightOperand is the left operand of the comparison. It could be the target ASG Health field from
which this policy is applied or an integer.
properties:
field:
description: An Field for value.
Expand Down
1 change: 0 additions & 1 deletion config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module quortex.io/kubestitute

go 1.19
go 1.22

require (
github.com/Masterminds/sprig/v3 v3.2.3
Expand Down
Loading

0 comments on commit fd228ca

Please sign in to comment.