mirror of https://github.com/k3s-io/k3s
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?pull/6/head
commit
0867802bbc
|
@ -208,11 +208,15 @@ func main() {
|
|||
images = []string{imageConfig.Image}
|
||||
}
|
||||
for _, image := range images {
|
||||
metadata := imageConfig.Metadata
|
||||
if len(strings.TrimSpace(*instanceMetadata)) > 0 {
|
||||
metadata += "," + *instanceMetadata
|
||||
}
|
||||
gceImage := internalGCEImage{
|
||||
image: image,
|
||||
imageDesc: imageConfig.ImageDesc,
|
||||
project: imageConfig.Project,
|
||||
metadata: getImageMetadata(imageConfig.Metadata),
|
||||
metadata: getImageMetadata(metadata),
|
||||
machine: imageConfig.Machine,
|
||||
tests: imageConfig.Tests,
|
||||
resources: imageConfig.Resources,
|
||||
|
|
Loading…
Reference in New Issue