Commit 0867802b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #50831 from Random-Liu/instance-metadata-from-flag

Automatic merge from submit-queue (batch tested with PRs 50693, 50831, 47506, 49119, 50871) Add instance metadata from flag even when using image config. Also add instance metadata from flag even when we are using image config. * Sometimes we need to dynamically generate instance metadata, it's troublesome to put them into image config. * Sometimes we want to apply instance metadata to all images, it's duplicated to add them to each image in the image config. /assign @yguo0905 Could you help me review this?
parents aa31d193 2c129e4d
...@@ -208,11 +208,15 @@ func main() { ...@@ -208,11 +208,15 @@ func main() {
images = []string{imageConfig.Image} images = []string{imageConfig.Image}
} }
for _, image := range images { for _, image := range images {
metadata := imageConfig.Metadata
if len(strings.TrimSpace(*instanceMetadata)) > 0 {
metadata += "," + *instanceMetadata
}
gceImage := internalGCEImage{ gceImage := internalGCEImage{
image: image, image: image,
imageDesc: imageConfig.ImageDesc, imageDesc: imageConfig.ImageDesc,
project: imageConfig.Project, project: imageConfig.Project,
metadata: getImageMetadata(imageConfig.Metadata), metadata: getImageMetadata(metadata),
machine: imageConfig.Machine, machine: imageConfig.Machine,
tests: imageConfig.Tests, tests: imageConfig.Tests,
resources: imageConfig.Resources, resources: imageConfig.Resources,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment