aenix-io / etcd-operator

New generation community-driven etcd-operator!
https://etcd.aenix.io
Apache License 2.0
90 stars 13 forks source link

Revisit ResourceVersion usage in resource factories #90

Closed sergeyshevch closed 7 months ago

sergeyshevch commented 7 months ago

@aobort in https://github.com/aenix-io/etcd-operator/pull/84#discussion_r1540079094 found that resource update correctly works without copying of ResourceVersion to newly generated structure in k8s 1.29+

We need to verify it for different k8s versions and remove if it isn't required

aobort commented 7 months ago

How many k8s versions prior the latest one do we want to support and need to be tested?

sircthulhu commented 7 months ago

@aobort according to kubernetes releases, version 1.27 is going to be the end of line in June, 2024. I suppose we need to support all "alive" versions

aobort commented 7 months ago

Removed copying of ResourceVersion to newly generated structure and run tests for k8s versions 1.27.1, 1.28.0, 1.29.0:

❯ for ver in {1.27.1,1.28.0,1.29.0}; do ENVTEST_K8S_VERSION=$ver make test; done
/Users/A117675684/Repos/aenix.io/etcd-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/Users/A117675684/Repos/aenix.io/etcd-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
KUBEBUILDER_ASSETS="/Users/A117675684/Repos/aenix.io/etcd-operator/bin/k8s/1.27.1-darwin-arm64" go test $(go list ./... | grep -v /e2e) -coverprofile cover.out
?       github.com/aenix-io/etcd-operator/cmd   [no test files]
?       github.com/aenix-io/etcd-operator/test/utils    [no test files]
ok      github.com/aenix-io/etcd-operator/api/v1alpha1  4.283s  coverage: 14.0% of statements
ok      github.com/aenix-io/etcd-operator/internal/controller   6.520s  coverage: 50.0% of statements
ok      github.com/aenix-io/etcd-operator/internal/controller/factory   4.564s  coverage: 92.2% of statements
/Users/A117675684/Repos/aenix.io/etcd-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/Users/A117675684/Repos/aenix.io/etcd-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
KUBEBUILDER_ASSETS="/Users/A117675684/Repos/aenix.io/etcd-operator/bin/k8s/1.28.0-darwin-arm64" go test $(go list ./... | grep -v /e2e) -coverprofile cover.out
?       github.com/aenix-io/etcd-operator/cmd   [no test files]
?       github.com/aenix-io/etcd-operator/test/utils    [no test files]
ok      github.com/aenix-io/etcd-operator/api/v1alpha1  4.405s  coverage: 14.0% of statements
ok      github.com/aenix-io/etcd-operator/internal/controller   6.426s  coverage: 50.0% of statements
ok      github.com/aenix-io/etcd-operator/internal/controller/factory   5.115s  coverage: 92.2% of statements
/Users/A117675684/Repos/aenix.io/etcd-operator/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/Users/A117675684/Repos/aenix.io/etcd-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
KUBEBUILDER_ASSETS="/Users/A117675684/Repos/aenix.io/etcd-operator/bin/k8s/1.29.0-darwin-arm64" go test $(go list ./... | grep -v /e2e) -coverprofile cover.out
?       github.com/aenix-io/etcd-operator/cmd   [no test files]
?       github.com/aenix-io/etcd-operator/test/utils    [no test files]
ok      github.com/aenix-io/etcd-operator/api/v1alpha1  4.459s  coverage: 14.0% of statements
ok      github.com/aenix-io/etcd-operator/internal/controller   6.872s  coverage: 50.0% of statements
ok      github.com/aenix-io/etcd-operator/internal/controller/factory   4.785s  coverage: 92.2% of statements