Suppress unnecessary warnings when Kubernetes user values are empty
What does this MR do?
Avoid logging warning for empty Kubernetes user values. This was introduced in !5540 (merged).
Why was this MR needed?
Avoid unnecessary warning message to not alarm the user
What's the best way to test this MR?
gitlab-ci
variables:
FF_USE_POWERSHELL_PATH_RESOLVER: "true"
FF_RETRIEVE_POD_WARNING_EVENTS: "true"
FF_PRINT_POD_EVENTS: "true"
FF_SCRIPT_SECTIONS: "true"
CI_DEBUG_SERVICES: "true"
FF_USE_FASTZIP: "false"
node_modules_tests:
image: alpine
script:
- sleep 15
config.toml
listen_address = ":9252"
concurrent = 3
check_interval = 1
log_format = "runner"
connection_max_age = "15m0s"
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
pre_get_sources_script = "git config --system --add safe.directory $CI_PROJECT_DIR"
post_get_sources_script = "git config --local --add safe.directory $CI_PROJECT_DIR"
name = "investigation"
limit = 50
url = "https://gitlab.com/"
id = 0
token = "glrt-REDACTED"
token_obtained_at = 2024-09-30T14:38:04.623237Z
executor = "kubernetes"
environment = [
]
shell = "bash"
[runners.feature_flags]
FF_USE_ADVANCED_POD_SPEC_CONFIGURATION = true
FF_USE_POD_ACTIVE_DEADLINE_SECONDS = true
FF_PRINT_POD_EVENTS = true
[runners.kubernetes]
host = ""
bearer_token_overwrite_allowed = false
image = "alpine"
namespace = ""
namespace_overwrite_allowed = ""
namespace_per_job = false
privileged = true
node_selector_overwrite_allowed = ".*"
node_tolerations_overwrite_allowed = ""
pod_labels_overwrite_allowed = ""
service_account_overwrite_allowed = ""
pull_policy = "always"
allowed_pull_policies = ["always", "if-not-present", "never"]
[runners.kubernetes.pod_labels]
[runners.kubernetes.dns_config]
The job should pass without the warning WARNING: Error parsing 'uid' or 'gid' from image options, using the configured security context: failed to parse UID strconv.ParseInt: parsing "": invalid syntax
in contrast of this job log: https://gitlab.com/ra-group2/playground-bis/-/jobs/9966513761
Running with gitlab-runner development version (HEAD)
on investigation REDACTED, system ID: s_b188029b2abb
feature flags: FF_USE_POWERSHELL_PATH_RESOLVER:true, FF_SCRIPT_SECTIONS:true, FF_USE_ADVANCED_POD_SPEC_CONFIGURATION:true, FF_PRINT_POD_EVENTS:true
Preparing the "kubernetes" executor
00:01
WARNING: Namespace is empty, therefore assuming 'default'.
Using Kubernetes namespace: default
Using Kubernetes executor with image alpine ...
Using attach strategy to execute scripts...
Using effective pull policy of [Always] for container build
Using effective pull policy of [Always] for container helper
Using effective pull policy of [Always] for container init-permissions
Preparing environment
00:08
Using FF_USE_POD_ACTIVE_DEADLINE_SECONDS, the Pod activeDeadlineSeconds will be set to the job timeout: 1h0m0s...
WARNING: Advanced Pod Spec configuration enabled, merging the provided PodSpec to the generated one. This is a beta feature and is subject to change. Feedback is collected in this issue: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/29659 ...
Subscribing to Kubernetes Pod events...
Type Reason Message
Normal Scheduled Successfully assigned default/runner-REDACTED-project-25452826-concurrent-0-v69w2f3r to gke-ra-cluster-linux-pool-7ae7231b-o9hl
Normal Pulling Pulling image "registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest"
Normal Pulled Successfully pulled image "registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest" in 713ms (713ms including waiting). Image size: 32935734 bytes.
Normal Created Created container: init-permissions
Normal Started Started container init-permissions
Normal Pulling Pulling image "alpine"
Normal Pulled Successfully pulled image "alpine" in 145ms (145ms including waiting). Image size: 3653068 bytes.
Normal Created Created container: build
Normal Started Started container build
Normal Pulling Pulling image "registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest"
Normal Pulled Successfully pulled image "registry.gitlab.com/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-latest" in 501ms (501ms including waiting). Image size: 32935734 bytes.
Normal Created Created container: helper
Normal Started Started container helper
Running on runner-REDACTED-project-25452826-concurrent-0-v69w2f3r via ratchade--20240612-H2W0T...
Getting source from Git repository
00:02
$ git config --system --add safe.directory $CI_PROJECT_DIR
Fetching changes with git depth set to 50...
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /builds/ra-group2/playground-bis/.git/
Created fresh repository.
Checking out 95e9e125 as detached HEAD (ref is nodejs_test)...
Skipping Git submodules setup
$ git config --local --add safe.directory $CI_PROJECT_DIR
Executing "step_script" stage of the job script
00:16
$ sleep 15
Cleaning up project directory and file based variables
00:01
Job succeeded