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

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

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

abarganier
Copy link
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
Member

This change is Reviewable

Copy link
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
Contributor Author

TFTR!

@abarganier
Copy link
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