google-compute-engine-plugin
google-compute-engine-plugin copied to clipboard
[Feature] No configuration to set GCE labels of the launched instance
There is not way to set GCE labels of the newly created instances.
The only labels that are set seem to be set by this code:
for (InstanceConfiguration configuration : configurations) {
configuration.setCloud(this);
configuration.readResolve();
// Apply a label that associates an instance configuration with
// this cloud provide\
configuration.appendLabel(CLOUD_ID_LABEL_KEY, getInstanceId());
// Apply a label that identifies the name of this instance configuration
configuration.appendLabel(CONFIG_LABEL_KEY, configuration.getNamePrefix());
}
}
Where keys are predefined:
public static final String CONFIG_LABEL_KEY = "jenkins_config_name";
public static final String CLOUD_ID_LABEL_KEY = "jenkins_cloud_id";
What is desired:
GCE Labels are configurable via UI and JCASC configuration the in a similar way to how Network Tags could be defined now
@ansafonov Thanks for reporting this. As a workaround for now this is possible with instance templates.