Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medusa bucket secret label #1262

Merged
merged 21 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2af7407
Add hash functions.
Miles-Garnsey Mar 27, 2024
e6ff5c3
Ensure that a Medusa StorageSecretRef always gets labelled with a uni…
Miles-Garnsey Mar 27, 2024
1fea500
Fix controller gen version so it works on ARM macs.
Miles-Garnsey Mar 27, 2024
cf981c2
controller-gen generated changes.
Miles-Garnsey Mar 27, 2024
96ceac1
Changelog.
Miles-Garnsey Mar 27, 2024
56ba4f9
Try reconciling this using a patching approach instead of ReconcileOb…
Miles-Garnsey Mar 27, 2024
8b09c4b
Fix changelog.
Miles-Garnsey Apr 3, 2024
e14083d
Micke's requested changes inc. unit test, changelog and conditional p…
Miles-Garnsey Apr 3, 2024
616e95a
Identified an issue where requeue would not happened on a context can…
Miles-Garnsey Apr 3, 2024
0bbb969
Fix test issue where secret wasn't being updated.
Miles-Garnsey Apr 3, 2024
3528dd0
Merge branch 'main' into feature/medusa-bucket-secret-label
Miles-Garnsey Apr 3, 2024
0d5bbf6
Make the linter happy.
Miles-Garnsey Apr 4, 2024
fa1389b
Fix very annoying regression.
Miles-Garnsey Apr 4, 2024
6a7d00f
Remove requeueAfter from error path in patch.
Miles-Garnsey Apr 4, 2024
e10860a
Change port used by the registry to avoid conflict with MacOS stuff.
Miles-Garnsey Apr 4, 2024
e71e35b
Downgrade kustomize, ensure e2e tests use repo-local kustomize, not s…
Miles-Garnsey Apr 5, 2024
2b69e44
Make sure default LOCALBIN is defined ahead of targets that use it.
Miles-Garnsey Apr 5, 2024
174ec66
Make sure kustomize gets downloaded.
Miles-Garnsey Apr 5, 2024
9aacfab
Fix missing patch permission on controller service account.
Miles-Garnsey Apr 5, 2024
d21a4ef
Longer timeout for restore - this keeps failing in CI.
Miles-Garnsey Apr 5, 2024
07c23c8
Roll kustomize to 4.5.7 per Micke's request.
Miles-Garnsey Apr 11, 2024
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
5 changes: 5 additions & 0 deletions CHANGELOG/CHANGELOG-1.14.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Changelog for the K8ssandra Operator, new PRs should update the `unreleased` sec

When cutting a new release, update the `unreleased` heading to the tag being generated and date, like `## vX.Y.Z - YYYY-MM-DD` and create a new placeholder section for `unreleased` entries.

## unreleased
* [BUGFIX] [#1253](https://github.com/k8ssandra/k8ssandra-operator/issues/1253) Medusa storage secrets are now labelled with a unique label.
* [FEATURE] [#1260](https://github.com/k8ssandra/k8ssandra-operator/issues/1260) Update controller-gen to version 0.14.0.


## v1.14.0 - 2024-04-02

* [FEATURE] [#1242](https://github.com/k8ssandra/k8ssandra-operator/issues/1242) Allow for creation of replicated secrets with a prefix, so that we can distinguish between multiple secrets with the same origin but targeting different clusters.
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ else
GOBIN=$(shell go env GOBIN)
endif

## Location to install dependencies to
export LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

KIND_CLUSTER ?= k8ssandra-0
GO_FLAGS=

Expand Down Expand Up @@ -146,7 +151,7 @@ lint: golangci-lint ## Run golangci-lint against code.
$(GOLANGCI_LINT) run ./...

ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
test: manifests generate fmt vet lint envtest ## Run tests.
test: manifests generate fmt vet lint envtest kustomize ## Run tests.
ifdef TEST
@echo Running test $(TEST)
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $(GO_FLAGS) ./apis/... ./pkg/... ./test/yq/... ./controllers/... -run="$(TEST)" -covermode=atomic -coverprofile coverage.out
Expand All @@ -157,7 +162,7 @@ endif
E2E_TEST_TIMEOUT ?= 3600s

PHONY: e2e-test
e2e-test: ## Run e2e tests. Set E2E_TEST to run a specific test. Set TEST_ARGS to pass args to the test. You need to prepare the cluster(s) first by invoking single-prepare or multi-prepare.
e2e-test: kustomize ## Run e2e tests. Set E2E_TEST to run a specific test. Set TEST_ARGS to pass args to the test. You need to prepare the cluster(s) first by invoking single-prepare or multi-prepare.
ifdef E2E_TEST
@echo Running e2e test $(E2E_TEST)
go test -v -timeout $(E2E_TEST_TIMEOUT) ./test/e2e/... -run="$(E2E_TEST)" -args $(TEST_ARGS)
Expand Down Expand Up @@ -206,7 +211,7 @@ kind-multi-e2e-test: multi-create multi-prepare e2e-test

single-create: cleanup create-kind-cluster cert-manager nginx-kind

single-prepare: build manifests docker-build kind-load-image
single-prepare: build manifests docker-build kind-load-image kustomize

single-up: single-create single-prepare kustomize
kubectl config use-context kind-k8ssandra-0
Expand Down Expand Up @@ -315,11 +320,6 @@ undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.

##@ Tools / Dependencies

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
Expand All @@ -328,8 +328,8 @@ GOLANGCI_LINT ?= $(LOCALBIN)/golangci-lint # TODO Add linting to the GHA also

## Tool Versions
CERT_MANAGER_VERSION ?= v1.12.2
KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.12.0
KUSTOMIZE_VERSION ?= v4.5.7
CONTROLLER_TOOLS_VERSION ?= v0.14.0
GOLINT_VERSION ?= 1.55.0

cert-manager: ## Install cert-manager to the cluster
Expand Down
1 change: 0 additions & 1 deletion apis/config/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/control/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions apis/k8ssandra/v1alpha1/k8ssandracluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"github.com/k8ssandra/k8ssandra-operator/pkg/encryption"
"github.com/k8ssandra/k8ssandra-operator/pkg/images"
"github.com/k8ssandra/k8ssandra-operator/pkg/meta"
"github.com/k8ssandra/k8ssandra-operator/pkg/utils"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -537,3 +538,11 @@ func (kc *K8ssandraCluster) DefaultNumTokens(serverVersion *semver.Version) floa
}
return float64(16)
}

// GetClusterIdHash should be used to derive short form unique identifiers for the cluster,
// this is to be used to name resources that are cluster specific in preference of concatenations
// of the namespaced name, as the latter are becoming too long and causing issues due to DNS name length
// constraints within k8s
func (kc *K8ssandraCluster) GetClusterIdHash(nchars int) string {
return utils.HashNameNamespace(kc.Name, kc.Namespace)
}
1 change: 0 additions & 1 deletion apis/k8ssandra/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/medusa/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/reaper/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/replication/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/stargate/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apis/telemetry/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading