Skip to content

Commit

Permalink
Revert the etcdbr bump & address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anveshreddy18 committed Jul 17, 2024
1 parent b16e7f0 commit 585d628
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 18 deletions.
12 changes: 6 additions & 6 deletions docs/development/getting-started-locally-fakegcs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ make deploy
To configure `FakeGCS` to be used as backup store for etcd, Uncomment the `spec.backup.store` section of the etcd yaml in `config/samples/druid_v1alpha1_etcd.yaml` and replace it with the following:

```yaml
store:
secretRef:
name: etcd-backup-gcp
container: etcd-bucket
provider: gcp # options: aws,azure,gcp,openstack,alicloud,dell,openshift,local
prefix: etcd-test
store:
secretRef:
name: etcd-backup-gcp
container: etcd-bucket
provider: gcp
prefix: etcd-test
```
Now, apply the required Kubernetes manifests to create an etcd custom resource (CR) and a secret for GCP credentials, facilitating FakeGCS access:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/gardener/etcd-druid
go 1.22

require (
github.com/gardener/etcd-backup-restore v0.29.0
github.com/gardener/etcd-backup-restore v0.26.0
github.com/gardener/gardener v1.86.4
github.com/go-logr/logr v1.2.4
github.com/golang-jwt/jwt/v5 v5.2.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/gardener/etcd-backup-restore v0.29.0 h1:awzXySrK8GBMiMigdi9dEfqyulas2FEwnBWxzheULtA=
github.com/gardener/etcd-backup-restore v0.29.0/go.mod h1:cAY12PXK6oJgh5X/V6AuQ8eCpJspPNlnbNSwwjToj18=
github.com/gardener/etcd-backup-restore v0.26.0 h1:ux0U5OT6IwtFiGbx4d3q+KYGRg6dTxBULPm8DL73E98=
github.com/gardener/etcd-backup-restore v0.26.0/go.mod h1:cAY12PXK6oJgh5X/V6AuQ8eCpJspPNlnbNSwwjToj18=
github.com/gardener/gardener v1.86.4 h1:uxMalw67jddMXliPhv5vs1nOB7G8hbFE1XKoyZjIMlE=
github.com/gardener/gardener v1.86.4/go.mod h1:8eHlXs2EkaghrgQwK8qEiVw3dZGpNJaq+I9IkPpReA4=
github.com/gardener/hvpa-controller/api v0.5.0 h1:f4F3O7YUrenwh4S3TgPREPiB287JjjUiUL18OqPLyAA=
Expand Down
7 changes: 4 additions & 3 deletions hack/ci-e2e-kind-gcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ set -o pipefail

make kind-up

trap "
( make kind-down )
" EXIT
trap '{
kind export logs "${ARTIFACTS:-/tmp}/etcd-druid-e2e" --name etcd-druid-e2e || true
make kind-down
}' EXIT

kubectl wait --for=condition=ready node --all
echo "{ \"serviceaccount.json\": \"\", \"storageAPIEndpoint\": \"http://fake-gcs.default:8000/storage/v1/\", \"emulatorEnabled\": \"true\" }" >/tmp/svc_acc.json
Expand Down
4 changes: 2 additions & 2 deletions internal/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const (
EnvGoogleApplicationCredentials = "GOOGLE_APPLICATION_CREDENTIALS"
// EnvGoogleStorageAPIEndpoint is the environment variable key for Google storage API endpoint override.
EnvGoogleStorageAPIEndpoint = "GOOGLE_STORAGE_API_ENDPOINT"
// EnvEmulatorEnabled is the environment variable key for Google storage emulator.
EnvEmulatorEnabled = "GOOGLE_EMULATOR_ENABLED"
// EnvGCSEmulatorEnabled is the environment variable key for Google storage emulator.
EnvGCSEmulatorEnabled = "GOOGLE_EMULATOR_ENABLED"
// EnvOpenstackApplicationCredentials is the environment variable key for OpenStack application credentials.
EnvOpenstackApplicationCredentials = "OPENSTACK_APPLICATION_CREDENTIALS"
// EnvAlicloudApplicationCredentials is the environment variable key for Alicloud application credentials.
Expand Down
2 changes: 1 addition & 1 deletion internal/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func GetProviderEnvVars(store *druidv1alpha1.StoreSpec) ([]corev1.EnvVar, error)
case GCS:
envVars = append(envVars, utils.GetEnvVarFromValue(common.EnvGoogleApplicationCredentials, fmt.Sprintf("%sserviceaccount.json", common.VolumeMountPathGCSBackupSecret)))
envVars = append(envVars, utils.GetEnvVarFromSecret(common.EnvGoogleStorageAPIEndpoint, store.SecretRef.Name, "storageAPIEndpoint", true))
envVars = append(envVars, utils.GetEnvVarFromSecret(common.EnvEmulatorEnabled, store.SecretRef.Name, "emulatorEnabled", true))
envVars = append(envVars, utils.GetEnvVarFromSecret(common.EnvGCSEmulatorEnabled, store.SecretRef.Name, "emulatorEnabled", true))

case Swift:
envVars = append(envVars, utils.GetEnvVarFromValue(common.EnvOpenstackApplicationCredentials, common.VolumeMountPathNonGCSProviderBackupSecret))
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func getProviders() ([]TestProvider, error) {
},
},
}
fakegcsenabled := getEnvOrFallback("GOOGLE_EMULATOR_ENABLED", "")
fakegcsenabled := getEnvOrFallback(common.EnvGCSEmulatorEnabled, "")
if enable, err := strconv.ParseBool(fakegcsenabled); err == nil && enable {
gcsEmulatorURL := getEnvOrFallback("GCS_EMULATOR_HOST", "")
provider.Storage.SecretData["storageAPIEndpoint"] = []byte("http://" + gcsEmulatorURL + "/storage/v1/")
Expand Down
4 changes: 2 additions & 2 deletions test/integration/controllers/compaction/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ func validateStoreGCPForCompactionJob(instance *druidv1alpha1.Etcd, j *batchv1.J
})),
})),
}),
common.EnvEmulatorEnabled: MatchFields(IgnoreExtras, Fields{
"Name": Equal(common.EnvEmulatorEnabled),
common.EnvGCSEmulatorEnabled: MatchFields(IgnoreExtras, Fields{
"Name": Equal(common.EnvGCSEmulatorEnabled),
"ValueFrom": PointTo(MatchFields(IgnoreExtras, Fields{
"SecretKeyRef": PointTo(MatchFields(IgnoreExtras, Fields{
"LocalObjectReference": MatchFields(IgnoreExtras, Fields{
Expand Down

0 comments on commit 585d628

Please sign in to comment.