Skip to content

Commit

Permalink
add k8s versions matrix to test job (#100)
Browse files Browse the repository at this point in the history
Fixes: #90

Signed-off-by: Artem Bortnikov <artem.bortnikov@telekom.com>
  • Loading branch information
aobort committed Apr 1, 2024
1 parent 17025dd commit 4f114fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/make-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ jobs:
build:
# Pull request has label 'ok-to-test' or the author is a member of the organization
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test') || contains(fromJSON('["COLLABORATOR", "MEMBER", "OWNER"]'), github.event.pull_request.author_association)
strategy:
matrix:
k8s_version: [1.27.1,1.28.0,1.29.0]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.1
- run: make test
- run: ENVTEST_K8S_VERSION=${{ matrix.k8s_version }} make test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= ghcr.io/aenix-io/etcd-operator:latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.29.0
ENVTEST_K8S_VERSION ?= 1.29.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down
9 changes: 0 additions & 9 deletions internal/controller/factory/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ func reconcileStatefulSet(ctx context.Context, rclient client.Client, crdName st
return fmt.Errorf("cannot get existing statefulset: %s, for crd_object: %s, err: %w", sts.Name, crdName, err)
}
sts.Annotations = labels.Merge(currentSts.Annotations, sts.Annotations)
if sts.ResourceVersion != "" {
sts.ResourceVersion = currentSts.ResourceVersion
}
sts.Status = currentSts.Status
return rclient.Update(ctx, sts)
}
Expand All @@ -62,9 +59,6 @@ func reconcileConfigMap(ctx context.Context, rclient client.Client, crdName stri
return fmt.Errorf("cannot get existing configMap: %s, for crd_object: %s, err: %w", configMap.Name, crdName, err)
}
configMap.Annotations = labels.Merge(currentConfigMap.Annotations, configMap.Annotations)
if configMap.ResourceVersion != "" {
configMap.ResourceVersion = currentConfigMap.ResourceVersion
}
return rclient.Update(ctx, configMap)
}

Expand All @@ -81,9 +75,6 @@ func reconcileService(ctx context.Context, rclient client.Client, crdName string
return fmt.Errorf("cannot get existing service: %s, for crd_object: %s, err: %w", svc.Name, crdName, err)
}
svc.Annotations = labels.Merge(currentSvc.Annotations, svc.Annotations)
if svc.ResourceVersion != "" {
svc.ResourceVersion = currentSvc.ResourceVersion
}
svc.Status = currentSvc.Status
return rclient.Update(ctx, svc)
}

0 comments on commit 4f114fe

Please sign in to comment.