Skip to content

Commit

Permalink
Merge pull request #1072 from pyrra-dev/go-1.22
Browse files Browse the repository at this point in the history
Update to Go 1.22
  • Loading branch information
metalmatze authored Jun 29, 2024
2 parents c0cd419 + 155c9c0 commit 307afca
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 40 deletions.
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
run:
deadline: 5m
go: 1.20
go: 1.22

output:
formats:
- format: colored-line-number

linters:
enable:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vet:
# Generate manifests e.g. CRD, RBAC etc.
.PHONY: generate
generate: controller-gen gojsontoyaml ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=pyrra-kubernetes crd rbac:roleName="pyrra-kubernetes" webhook paths="./..." output:crd:artifacts:config=jsonnet/controller-gen
$(CONTROLLER_GEN) crd rbac:roleName="pyrra-kubernetes" webhook paths="./..." output:crd:artifacts:config=jsonnet/controller-gen
find jsonnet/controller-gen -name '*.yaml' -print0 | xargs -0 -I{} sh -c '$(GOJSONTOYAML) -yamltojson < "$$1" | jq > "$(PWD)/jsonnet/controller-gen/$$(basename -s .yaml $$1).json"' -- {}
find jsonnet/controller-gen -type f ! -name '*.json' -delete

Expand All @@ -69,7 +69,7 @@ docker-push:
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: servicelevelobjectives.pyrra.dev
spec:
group: pyrra.dev
Expand Down Expand Up @@ -35,10 +34,19 @@ spec:
description: ServiceLevelObjective is the Schema for the ServiceLevelObjectives 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 @@ -51,6 +59,9 @@ spec:
absent:
default: true
type: boolean
absentName:
description: AbsentName is used as the name of the absent alert generated by Pyrra. Defaults to "SLOMetricAbsent".
type: string
burnrates:
default: true
type: boolean
Expand All @@ -62,13 +73,19 @@ spec:
type: string
type: object
description:
description: Description describes the ServiceLevelObjective in more detail and gives extra context for engineers that might not directly work on the service.
description: |-
Description describes the ServiceLevelObjective in more detail and
gives extra context for engineers that might not directly work on the service.
type: string
indicator:
description: ServiceLevelIndicator is the underlying data source that indicates how the service is doing. This will be a Prometheus metric with specific selectors for your service.
description: |-
ServiceLevelIndicator is the underlying data source that indicates how the service is doing.
This will be a Prometheus metric with specific selectors for your service.
properties:
bool_gauge:
description: BoolGauge is the indicator that measures whether a boolean gauge is successful.
description: |-
BoolGauge is the indicator that measures whether a boolean gauge is
successful.
properties:
grouping:
description: Total is the metric that returns how many requests there are in total.
Expand Down Expand Up @@ -109,7 +126,9 @@ spec:
- total
type: object
latencyNative:
description: LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency. This uses the new native histograms in Prometheus.
description: |-
LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency.
This uses the new native histograms in Prometheus.
properties:
grouping:
description: Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.
Expand Down Expand Up @@ -161,7 +180,10 @@ spec:
type: object
type: object
target:
description: 'Target is a string that''s casted to a float64 between 0 - 100. It represents the desired availability of the service in the given window. float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245'
description: |-
Target is a string that's casted to a float64 between 0 - 100.
It represents the desired availability of the service in the given window.
float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245
type: string
window:
description: Window within which the Target is supposed to be kept. Usually something like 1d, 7d or 28d.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: servicelevelobjectives.pyrra.dev
spec:
group: pyrra.dev
Expand Down Expand Up @@ -35,10 +34,19 @@ spec:
description: ServiceLevelObjective is the Schema for the ServiceLevelObjectives 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 @@ -51,6 +59,9 @@ spec:
absent:
default: true
type: boolean
absentName:
description: AbsentName is used as the name of the absent alert generated by Pyrra. Defaults to "SLOMetricAbsent".
type: string
burnrates:
default: true
type: boolean
Expand All @@ -62,13 +73,19 @@ spec:
type: string
type: object
description:
description: Description describes the ServiceLevelObjective in more detail and gives extra context for engineers that might not directly work on the service.
description: |-
Description describes the ServiceLevelObjective in more detail and
gives extra context for engineers that might not directly work on the service.
type: string
indicator:
description: ServiceLevelIndicator is the underlying data source that indicates how the service is doing. This will be a Prometheus metric with specific selectors for your service.
description: |-
ServiceLevelIndicator is the underlying data source that indicates how the service is doing.
This will be a Prometheus metric with specific selectors for your service.
properties:
bool_gauge:
description: BoolGauge is the indicator that measures whether a boolean gauge is successful.
description: |-
BoolGauge is the indicator that measures whether a boolean gauge is
successful.
properties:
grouping:
description: Total is the metric that returns how many requests there are in total.
Expand Down Expand Up @@ -109,7 +126,9 @@ spec:
- total
type: object
latencyNative:
description: LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency. This uses the new native histograms in Prometheus.
description: |-
LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency.
This uses the new native histograms in Prometheus.
properties:
grouping:
description: Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.
Expand Down Expand Up @@ -161,7 +180,10 @@ spec:
type: object
type: object
target:
description: 'Target is a string that''s casted to a float64 between 0 - 100. It represents the desired availability of the service in the given window. float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245'
description: |-
Target is a string that's casted to a float64 between 0 - 100.
It represents the desired availability of the service in the given window.
float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245
type: string
window:
description: Window within which the Target is supposed to be kept. Usually something like 1d, 7d or 28d.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.11.1
creationTimestamp: null
controller-gen.kubebuilder.io/version: v0.14.0
name: servicelevelobjectives.pyrra.dev
spec:
group: pyrra.dev
Expand Down Expand Up @@ -35,10 +34,19 @@ spec:
description: ServiceLevelObjective is the Schema for the ServiceLevelObjectives 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 @@ -51,6 +59,9 @@ spec:
absent:
default: true
type: boolean
absentName:
description: AbsentName is used as the name of the absent alert generated by Pyrra. Defaults to "SLOMetricAbsent".
type: string
burnrates:
default: true
type: boolean
Expand All @@ -62,13 +73,19 @@ spec:
type: string
type: object
description:
description: Description describes the ServiceLevelObjective in more detail and gives extra context for engineers that might not directly work on the service.
description: |-
Description describes the ServiceLevelObjective in more detail and
gives extra context for engineers that might not directly work on the service.
type: string
indicator:
description: ServiceLevelIndicator is the underlying data source that indicates how the service is doing. This will be a Prometheus metric with specific selectors for your service.
description: |-
ServiceLevelIndicator is the underlying data source that indicates how the service is doing.
This will be a Prometheus metric with specific selectors for your service.
properties:
bool_gauge:
description: BoolGauge is the indicator that measures whether a boolean gauge is successful.
description: |-
BoolGauge is the indicator that measures whether a boolean gauge is
successful.
properties:
grouping:
description: Total is the metric that returns how many requests there are in total.
Expand Down Expand Up @@ -109,7 +126,9 @@ spec:
- total
type: object
latencyNative:
description: LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency. This uses the new native histograms in Prometheus.
description: |-
LatencyNative is the indicator that measures a certain percentage to be faster than the expected latency.
This uses the new native histograms in Prometheus.
properties:
grouping:
description: Grouping allows an SLO to be defined for many SLI at once, like HTTP handlers for example.
Expand Down Expand Up @@ -161,7 +180,10 @@ spec:
type: object
type: object
target:
description: 'Target is a string that''s casted to a float64 between 0 - 100. It represents the desired availability of the service in the given window. float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245'
description: |-
Target is a string that's casted to a float64 between 0 - 100.
It represents the desired availability of the service in the given window.
float64 are not supported: https://github.com/kubernetes-sigs/controller-tools/issues/245
type: string
window:
description: Window within which the Target is supposed to be kept. Usually something like 1d, 7d or 28d.
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 github.com/pyrra-dev/pyrra

go 1.20
go 1.22

require (
github.com/alecthomas/kong v0.9.0
Expand Down
Loading

0 comments on commit 307afca

Please sign in to comment.