Skip to content

tenant: use -h to check if tenant scoped client certs available#142

Merged
abarganier merged 1 commit intocockroachdb:masterfrom
abarganier:check-tenant-scoped-certs
Jul 18, 2022
Merged

tenant: use -h to check if tenant scoped client certs available#142
abarganier merged 1 commit intocockroachdb:masterfrom
abarganier:check-tenant-scoped-certs

Conversation

@abarganier
Copy link
Copy Markdown
Contributor

Previously, whether the test server created tenant-scoped client
certificates for tests was based on a hardcoded version gate. This
was sufficient in the past, but as tenant-scoped client certs are
now being backported to older cockroachdb versions, a more dynamic
approach to determine whether or not these certificates are available
is needed.

This patch adds a mechanism to do so. The new approach runs the
cockroach cert create-client --help command to view the available
flags for the current cockroach binary. If the --tenant-scope flag
is present in the help text, then we can say with confidence that
tenant scoped client certificates are available. We can use this
to signal the broader system to make use of these certificates when
running tests in secure mode.

This follows the approach used in:
cockroachdb/cockroach#83703

Previously, whether the test server created tenant-scoped client
certificates for tests was based on a hardcoded version gate. This
was sufficient in the past, but as tenant-scoped client certs are
now being backported to older cockroachdb versions, a more dynamic
approach to determine whether or not these certificates are available
is needed.

This patch adds a mechanism to do so. The new approach runs the
`cockroach cert create-client --help` command to view the available
flags for the current cockroach binary. If the `--tenant-scope` flag
is present in the help text, then we can say with confidence that
tenant scoped client certificates are available. We can use this
to signal the broader system to make use of these certificates when
running tests in secure mode.

This follows the approach used in:
cockroachdb/cockroach#83703
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this is a great idea

@abarganier abarganier merged commit 21a2370 into cockroachdb:master Jul 18, 2022
@abarganier
Copy link
Copy Markdown
Contributor Author

TFTR!

@abarganier
Copy link
Copy Markdown
Contributor Author

NB: Pushed tag v2.2.15 with this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants