Skip to content

Commit

Permalink
fix: linter errors for take-along-labels
Browse files Browse the repository at this point in the history
Signed-off-by: dntosas <[email protected]>
  • Loading branch information
dntosas committed Oct 11, 2023
1 parent b47eba2 commit b21fe0a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ USER = $(shell id -u)
GROUP = $(shell id -g)
PROJECT = "capi2argo-cluster-operator"
GOBUILD_OPTS = -ldflags="-s -w -X ${PROJECT}/cmd.Version=${VERSION} -X ${PROJECT}/cmd.CommitHash=${COMMIT}"
GO_IMAGE = "golang:1.20-alpine"
GO_IMAGE_CI = "golangci/golangci-lint:v1.52.2"
GO_IMAGE = "golang:1.21-alpine"
GO_IMAGE_CI = "golangci/golangci-lint:v1.54.2"
DISTROLESS_IMAGE = "gcr.io/distroless/static:nonroot"
IMAGE_TAG_BASE ?= "ghcr.io/dntosas/${PROJECT}"

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.26.1
ENVTEST_K8S_VERSION = 1.27.1

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand All @@ -39,7 +39,7 @@ vet: ## Run go vet against code.

.PHONY: lint
lint: ## Run golangci-lint against code.
@docker run --rm --volume "${PWD}:/app" -w /app "${GO_IMAGE_CI}" golangci-lint run --enable revive,gofmt,exportloopref --exclude-use-default=false --modules-download-mode=vendor --build-tags integration
golangci-lint run --enable revive,gofmt,exportloopref --exclude-use-default=false --modules-download-mode=vendor --build-tags integration

.PHONY: test
test: envtest ## Run go tests against code.
Expand Down
4 changes: 2 additions & 2 deletions charts/capi2argo-cluster-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.1.13
appVersion: 0.1.14
description: Capi-2-Argo Cluster Operator (CACO) converts ClusterAPI Cluster credentials into ArgoCD Cluster definitions and keep them synchronized.
home: https://github.com/dntosas/capi2argo-cluster-operator
keywords:
Expand All @@ -11,7 +11,7 @@ maintainers:
name: capi2argo-cluster-operator
sources:
- https://github.com/dntosas/capi2argo-cluster-operator
version: 0.1.13
version: 0.1.14
dependencies:
- name: common
repository: "https://charts.bitnami.com/bitnami"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ rules:
- get
- list
- watch

{{- end }}
2 changes: 1 addition & 1 deletion charts/capi2argo-cluster-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ replicaCount: 1
image:
registry: ghcr.io
repository: dntosas/capi2argo-cluster-operator
tag: v0.1.13
tag: v0.1.14
pullPolicy: Always
pullSecrets: []

Expand Down
13 changes: 6 additions & 7 deletions controllers/argo_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (

var (
// ArgoNamespace represents the Namespace that hold ArgoCluster secrets.
ArgoNamespace string
ArgoNamespace string
// TestKubeConfig represents
TestKubeConfig *rest.Config
)

Expand Down Expand Up @@ -63,13 +64,11 @@ func NewArgoCluster(c *CapiCluster, s *corev1.Secret, cluster *clusterv1.Cluster
log := ctrl.Log.WithName("argoCluster")

takeAlongLabels := map[string]string{}
errors := []string{}
var errList []string
if cluster != nil {
takeAlongLabels, errors = buildTakeAlongLabels(cluster)
if errors != nil {
for _, e := range errors {
log.Info(e)
}
takeAlongLabels, errList = buildTakeAlongLabels(cluster)
for _, e := range errList {
log.Info(e)
}

Check warning on line 72 in controllers/argo_cluster.go

View check run for this annotation

Codecov / codecov/patch

controllers/argo_cluster.go#L71-L72

Added lines #L71 - L72 were not covered by tests
}
return &ArgoCluster{
Expand Down

0 comments on commit b21fe0a

Please sign in to comment.