-
Bug
-
Resolution: Unresolved
-
Major
-
None
Only some specific fields are taken into account during merge. Only some specific child Pod fields are merged into resulting Pod but other may exists (e.g. host aliases)
Reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.19/#podspec-v1-core
Example:
pipeline { agent { kubernetes { inheritFrom 'default' yamlMergeStrategy: merge(), yaml """ spec: hostAliases: - ip: 10.0.0.1 hostnames: - some.virtualized.service.company.com """ } } stages { stage('Main') { steps { script { # Better to see build logs with generated YAML sh 'cat /etc/hosts' } } } } }
Host aliases are lost but if inheritance is disabled, field is kept.