Skip to content

Commit

Permalink
Move etcd certs from examples to fixtures (#41971)
Browse files Browse the repository at this point in the history
These certs are test data, not an example meant for others to use.
In addition, update the README to clarify this.

Closes gravitational/teleport-private#1497
  • Loading branch information
zmb3 authored May 23, 2024
1 parent b5f46c5 commit 345be73
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/services/Dockerfile.etcd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG ETCD_VERSION

FROM bitnami/etcd:${ETCD_VERSION}

COPY examples/etcd/certs /certs
COPY fixtures/etcdcerts /certs

HEALTHCHECK CMD etcdctl --insecure-discovery --endpoint=https://etcd0:2379 --key-file /certs/client-key.pem --cert-file /certs/client-cert.pem --ca-file /certs/ca-cert.pem cluster-health

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ci-service-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
paths:
- .github/services/Dockerfile.*
- examples/etcd/certs/*.pem
- fixtures/etcdcerts/*.pem
branches:
- master

Expand Down
4 changes: 0 additions & 4 deletions examples/etcd/certs/README

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions fixtures/etcdcerts/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# etcdcerts

This directory contains certificates used for Teleport's etcd integration tests.
They should not be used for any other workloads.

You can remove the certs with `make clean`, and regenerate them with `make`.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions integration/hsm/hsm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func etcdBackendConfig(t *testing.T) *backend.Config {
Params: backend.Params{
"peers": []string{etcdTestEndpoint()},
"prefix": prefix,
"tls_key_file": "../../examples/etcd/certs/client-key.pem",
"tls_cert_file": "../../examples/etcd/certs/client-cert.pem",
"tls_ca_file": "../../examples/etcd/certs/ca-cert.pem",
"tls_key_file": "../../fixtures/etcdcerts/client-key.pem",
"tls_cert_file": "../../fixtures/etcdcerts/client-cert.pem",
"tls_ca_file": "../../fixtures/etcdcerts/ca-cert.pem",
},
}
t.Cleanup(func() {
Expand Down
12 changes: 6 additions & 6 deletions lib/backend/etcdbk/etcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func TestMain(m *testing.M) {
var commonEtcdParams = backend.Params{
"peers": []string{etcdTestEndpoint()},
"prefix": examplePrefix,
"tls_key_file": "../../../examples/etcd/certs/client-key.pem",
"tls_cert_file": "../../../examples/etcd/certs/client-cert.pem",
"tls_ca_file": "../../../examples/etcd/certs/ca-cert.pem",
"tls_key_file": "../../../fixtures/etcdcerts/client-key.pem",
"tls_cert_file": "../../../fixtures/etcdcerts/client-cert.pem",
"tls_ca_file": "../../../fixtures/etcdcerts/ca-cert.pem",
}

var commonEtcdOptions = []Option{
Expand Down Expand Up @@ -177,9 +177,9 @@ func TestCompareAndSwapOversizedValue(t *testing.T) {
bk, err := New(context.Background(), backend.Params{
"peers": []string{etcdTestEndpoint()},
"prefix": "/teleport",
"tls_key_file": "../../../examples/etcd/certs/client-key.pem",
"tls_cert_file": "../../../examples/etcd/certs/client-cert.pem",
"tls_ca_file": "../../../examples/etcd/certs/ca-cert.pem",
"tls_key_file": "../../../fixtures/etcdcerts/client-key.pem",
"tls_cert_file": "../../../fixtures/etcdcerts/client-cert.pem",
"tls_ca_file": "../../../fixtures/etcdcerts/ca-cert.pem",
"dial_timeout": 500 * time.Millisecond,
"etcd_max_client_msg_size_bytes": maxClientMsgSize,
}, commonEtcdOptions...)
Expand Down

0 comments on commit 345be73

Please sign in to comment.