Skip to content

Conversation

@markylaing
Copy link
Contributor

Tests the case where a certificate add operation is running on cluster member A, but the POST /1.0/certificates request containing the join token is sent to cluster member B.

@markylaing markylaing self-assigned this Jul 11, 2024
@markylaing markylaing requested a review from tomponline as a code owner July 11, 2024 09:07
@@ -0,0 +1,5 @@
is_uuid_v4() {

Check failure

Code scanning / shellcheck

SC2148

Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
is_uuid_v4() {
# Case insensitive match for a v4 UUID. The third group must start with 4, and the fourth group must start with 8, 9,
# a, or b. This accounts for the version and variant. See https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4.
echo -n "${1}" | grep --ignore-case '^[0-9a-f]\{8\}-[0-9a-f]\{4\}-4[0-9a-f]\{3\}-[89ab][0-9a-f]\{3\}-[0-9a-f]\{12\}$'

Check warning

Code scanning / shellcheck

SC3037

In POSIX sh, echo flags are undefined.
@markylaing markylaing force-pushed the test-certificate-token-remote-operation branch from 4cba125 to d855161 Compare July 11, 2024 09:41
is_uuid_v4() {
# Case insensitive match for a v4 UUID. The third group must start with 4, and the fourth group must start with 8, 9,
# a, or b. This accounts for the version and variant. See https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-4.
printf "${1}" | grep --ignore-case '^[0-9a-f]\{8\}-[0-9a-f]\{4\}-4[0-9a-f]\{3\}-[89ab][0-9a-f]\{3\}-[0-9a-f]\{12\}$'

Check warning

Code scanning / shellcheck

SC2059

Don't use variables in the printf format string. Use printf '..%s..' "$foo".
Tests the case where a certificate add operation is running on cluster
member A, but the `POST /1.0/certificates` request containing the join
token is sent to cluster member B.

Signed-off-by: Mark Laing <[email protected]>
@tomponline tomponline merged commit 36bca7f into canonical:main Jul 11, 2024
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.

2 participants