google-compute-engine-plugin icon indicating copy to clipboard operation
google-compute-engine-plugin copied to clipboard

[Feature] No configuration to set GCE labels of the launched instance

Open ansafonov opened this issue 6 years ago • 1 comments

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 avatar Dec 19 '19 00:12 ansafonov

@ansafonov Thanks for reporting this. As a workaround for now this is possible with instance templates.

stephenashank avatar Dec 19 '19 01:12 stephenashank