Skip to content
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
50 changes: 31 additions & 19 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
run:
deadline: 3m
issues:
skip-dirs:
- mock*
skip-files:
- "zz_generated.*\\.go$"
- ".*conversion.*\\.go$"
version: "2"
linters:
default: none
enable:
- goconst
- gosec
- govet
- gofmt
- unconvert
- ineffassign
- goconst
# - gocyclo
- misspell
- nakedret
- prealloc
- gosec
disable-all: true
# Run with --fast=false for more extensive checks
fast: true
issue:
max-same-issues: 0
max-per-linter: 0
- unconvert
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
- mock*
- "zz_generated.*\\.go$"
- ".*conversion.*\\.go$"
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
- mock*
- "zz_generated.*\\.go$"
- ".*conversion.*\\.go$"
2 changes: 1 addition & 1 deletion .pipelines/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- task: GoTool@0
inputs:
version: "1.22.4"
version: "1.23.0"
displayName: "Install Go"

- script: |-
Expand Down
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ SHELL:=/usr/bin/env bash
# Go version
GO_VERSION := $(shell go env GOVERSION | sed "s/[^[:digit:].-]//g")
ifeq ($(GO_VERSION),)
GO_VERSION := 1.22.4
GO_VERSION := 1.23.0
endif

# Use GOPROXY environment variable if set
Expand Down Expand Up @@ -64,7 +64,7 @@ export PATH := $(TOOLS_BIN_DIR):$(PATH)
OUTPUT_BASE := --output-base=$(ROOT_DIR)

# the current cluster API version
CAPI_VERSION := v1.9.4
CAPI_VERSION := v1.10.3

# Binaries.
GO_INSTALL = ./scripts/go_install.sh
Expand All @@ -86,9 +86,10 @@ ENVSUBST_VER := v2.0.0-20210730161058-179042472c46
ENVSUBST_BIN := envsubst
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)-$(ENVSUBST_VER)

GOLANGCI_LINT_VER := v1.64.5
GOLANGCI_LINT_VER := v2.2.2
GOLANGCI_LINT_BIN := golangci-lint
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER)
GOLANGCI_LINT_PKG := github.com/golangci/golangci-lint/v2/cmd/golangci-lint

KUSTOMIZE_VER := v5.6.0
KUSTOMIZE_BIN := kustomize
Expand All @@ -115,7 +116,7 @@ KUBECTL_BIN := kubectl
KUBECTL := $(TOOLS_BIN_DIR)/$(KUBECTL_BIN)-$(KUBECTL_VER)

# ENVTEST is used for running controller tests.
SETUP_ENVTEST_VER := v0.0.0-20240522175850-2e9781e9fc60 # updating this to match the version that pulls from controller-tools, details in https://github.com/kubernetes-sigs/cluster-api/pull/10569
SETUP_ENVTEST_VER := release-0.21
SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))

Expand All @@ -131,7 +132,7 @@ KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env -p path $(KUBEBUILD
# Version
MAJOR_VER ?= 1
MINOR_VER ?= 1
PATCH_VER ?= 3
PATCH_VER ?= 21

# Define Docker related variables. Releases should modify and double check these vars.
REGISTRY ?= mocimages.azurecr.io
Expand Down Expand Up @@ -221,7 +222,7 @@ setup-envtest: $(SETUP_ENVTEST) ## Set up envtest (download kubebuilder assets)
mockgen: $(MOCKGEN) ## Generate mocks using mockgen.

$(GOLANGCI_LINT): ## Build golangci-lint from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) github.com/golangci/golangci-lint/cmd/golangci-lint $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER)
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(GOLANGCI_LINT_PKG) $(GOLANGCI_LINT_BIN) $(GOLANGCI_LINT_VER)

$(KUSTOMIZE): ## Build kustomize from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) sigs.k8s.io/kustomize/kustomize/v5 $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ spec:
communicate with the control plane.
properties:
host:
description: The hostname on which the API server is serving.
description: host is the hostname on which the API server is serving.
maxLength: 512
type: string
port:
description: The port on which the API server is serving.
description: port is the port on which the API server is serving.
format: int32
type: integer
required:
Expand Down Expand Up @@ -272,27 +273,32 @@ spec:
properties:
lastTransitionTime:
description: |-
Last time the condition transitioned from one status to another.
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
A human readable message indicating details about the transition.
message is a human readable message indicating details about the transition.
This field may be empty.
maxLength: 10240
minLength: 1
type: string
reason:
description: |-
The reason for the condition's last transition in CamelCase.
reason is the reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may be empty.
maxLength: 256
minLength: 1
type: string
severity:
description: |-
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
maxLength: 32
type: string
status:
description: status of the condition, one of True, False, Unknown.
Expand All @@ -302,6 +308,8 @@ spec:
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
maxLength: 256
minLength: 1
type: string
required:
- lastTransitionTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ spec:
used to communicate with the control plane.
properties:
host:
description: The hostname on which the API server is serving.
description: host is the hostname on which the API server
is serving.
maxLength: 512
type: string
port:
description: The port on which the API server is serving.
description: port is the port on which the API server
is serving.
format: int32
type: integer
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,27 +136,32 @@ spec:
properties:
lastTransitionTime:
description: |-
Last time the condition transitioned from one status to another.
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
A human readable message indicating details about the transition.
message is a human readable message indicating details about the transition.
This field may be empty.
maxLength: 10240
minLength: 1
type: string
reason:
description: |-
The reason for the condition's last transition in CamelCase.
reason is the reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may be empty.
maxLength: 256
minLength: 1
type: string
severity:
description: |-
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
maxLength: 32
type: string
status:
description: status of the condition, one of True, False, Unknown.
Expand All @@ -166,6 +171,8 @@ spec:
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
maxLength: 256
minLength: 1
type: string
required:
- lastTransitionTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,27 +199,32 @@ spec:
properties:
lastTransitionTime:
description: |-
Last time the condition transitioned from one status to another.
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
A human readable message indicating details about the transition.
message is a human readable message indicating details about the transition.
This field may be empty.
maxLength: 10240
minLength: 1
type: string
reason:
description: |-
The reason for the condition's last transition in CamelCase.
reason is the reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may be empty.
maxLength: 256
minLength: 1
type: string
severity:
description: |-
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
maxLength: 32
type: string
status:
description: status of the condition, one of True, False, Unknown.
Expand All @@ -229,6 +234,8 @@ spec:
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
maxLength: 256
minLength: 1
type: string
required:
- lastTransitionTime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,27 +219,32 @@ spec:
properties:
lastTransitionTime:
description: |-
Last time the condition transitioned from one status to another.
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when
the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
A human readable message indicating details about the transition.
message is a human readable message indicating details about the transition.
This field may be empty.
maxLength: 10240
minLength: 1
type: string
reason:
description: |-
The reason for the condition's last transition in CamelCase.
reason is the reason for the condition's last transition in CamelCase.
The specific API may choose whether or not this field is considered a guaranteed API.
This field may be empty.
maxLength: 256
minLength: 1
type: string
severity:
description: |-
severity provides an explicit classification of Reason code, so the users or machines can immediately
understand the current situation and act accordingly.
The Severity field MUST be set only when Status=False.
maxLength: 32
type: string
status:
description: status of the condition, one of True, False, Unknown.
Expand All @@ -249,6 +254,8 @@ spec:
type of condition in CamelCase or in foo.example.com/CamelCase.
Many .condition.type values are consistent across resources like Available, but because arbitrary conditions
can be useful (see .node.status.conditions), the ability to deconflict is important.
maxLength: 256
minLength: 1
type: string
required:
- lastTransitionTime
Expand Down
Loading