fix: add warning for long secret names #359

Merged
decentral1se merged 14 commits from rix/abra:add-secret-length-linting into main 2024-04-06 21:41:37 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 344590b19b - Show all commits

View File

@ -269,8 +269,8 @@ func ensureSecretLengths(secrets map[string]string, domainName string, sanitised
domainAndFormatLength := len(sanitisedAppName) + 4
for secretName := range secrets {
if len(secretName)+domainAndFormatLength > 64 {
return fmt.Errorf("%s is too long (> 64 chars when combined with %s)", secretName, sanitisedAppName)
if len(secretName)+domainAndFormatLength > config.MAX_DOCKER_SECRET_LENGTH {
return fmt.Errorf("%s is too long (> %d chars when combined with %s)", secretName, config.MAX_DOCKER_SECRET_LENGTH, sanitisedAppName)
}
}
decentral1se marked this conversation as resolved Outdated

nitpick: drop extra newline?

nitpick: drop extra newline?
Outdated
Review

Think I've got this one now but let me know if I misinterpreted which line you were talking about : )

Think I've got this one now but let me know if I misinterpreted which line you were talking about : )

View File

@ -35,6 +35,7 @@ var CATALOGUE_JSON_REPO_NAME = "recipes-catalogue-json"
var SSH_URL_TEMPLATE = "ssh://git@git.coopcloud.tech:2222/coop-cloud/%s.git"
const MAX_SANITISED_APP_NAME_LENGTH = 45
const MAX_DOCKER_SECRET_LENGTH = 64
// GetServers retrieves all servers.
func GetServers() ([]string, error) {