Something went wrong. Try again.
A Forgejo Runner plugin that spawn jobs as Kubernetes pods
Something went wrong. Try again.
1234567891011121314151617use tonic::Status;
pub(super) fn validate_container_environment_name(value: &str) -> Result<(), Status> { let mut bytes = value.bytes(); let first = bytes .next() .ok_or_else(|| Status::invalid_argument("container environment variable name is empty"))?; if !(first.is_ascii_alphabetic() || first == b'_') || !bytes.all(|byte| byte.is_ascii_alphanumeric() || byte == b'_') { return Err(Status::invalid_argument(format!( "invalid container environment variable name {value:?}" ))); } Ok(())}