Kubernetes Executor displays warnings for default values on volumes
Summary
With configured volumes under runners.kubernetes.volumes.empty_dir
, the Kubernetes executor as of 16.6 is displaying warning messages in the job output.
Steps to reproduce
With the following configuration:
[[runners]]
[runners.kubernetes]
[[runners.kubernetes.volumes.empty_dir]]
name = "myvolume"
mount_path = "/tmp/myvolume"
Actual behavior
Every job will have a warning like:
WARNING: invalid limit quantity "" for empty volume "myvolume": quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'
Expected behavior
Job runs without warnings.
Environment description
GitLab Runner Kubernetes executor running on AWS EKS.
Used GitLab Runner version
Running with gitlab-runner 16.6.1 (f5da3c5a)
on <server>
feature flags: FF_RETRIEVE_POD_WARNING_EVENTS:true
Possible fixes
Seems to be caused by this line which was changed to use new logging mechanisms in !3983 (merged). It seems that checking volume.SizeLimit
for empty/nil before attempting resource.ParseQuantity
would allow default values to be used with no warnings.
Issue was also noted by @bertbaron !4404 (comment 1669121237)