Description
Context names can be generated by other tools. We need to make sure we are handling all characters that people are using and can use.
Because context names are used in URLs there is a possibility of error being introduced.
Acceptance criteria
- There should be links added to this issue to relevant parts of the code in the front/ backend/ app/ that are related to context names.
- Check
makeDNSFriendly
and other context using pieces of code have tests for all different characters and URL safety. Tests have been added for each piece. - Check
makeDNSFriendly
and other context using pieces of code are validating inputs (in front/backend/app/etc). - Manually test context names with different characters work with the app, there should be a list of context names to manually test written in this issue
- Double check for other specifications, and add other relevant specs, and documentation to this issue. For example, the documentation for tools that create context names.
- Check kubectl and related code to see if we are handling things correctly. To see any specification or validation that is being used. There should be links to relevant parts of kubectl code/documentation added to this issue.
Additional info
ARN in EKS are like this... Identify AWS resources with Amazon Resource Names (ARNs) - AWS Identity and Access Management Note: can include * too, and double colon :: and others...
arn:aws:eks:us-west-2:123456789012:cluster/production-cluster
Resource ARNs can include a path. For example, in Amazon S3, the resource identifier is an object name that can include forward slashes (/) to form a path. Similarly, IAM user names and group names can include paths. Only alphanumeric characters and the following characters are allowed in IAM paths: forward slash (/), plus (+), equals (=), comma (,), period (.), at (@), underscore (_), and hyphen (-).
GKE follows the kubernetes context spec correctly AFAIK. eg. gke_my-project_us-central1-a_my-cluster But can't find a doc that says so.
AKS is something like {cluster-name}-{resource-group-name}-{subscription-id} With resource group name, and cluster name allowing more things... Not totally confirmed... but something like: Letters (A-Z, a-z), numbers (0-9), underscores (_), hyphens (-), parentheses ((, )), and periods (.). Maybe the best resource I can find... Resource naming restrictions - Azure Resource Manager | Microsoft Learn Shows the rules and restrictions for naming Azure resources.
:
is of course reserved in URLs for protocol port, and a supported in the path part of a URL... except it's handled differently in some URL processing code.