Search in sources :

Example 16 with GroupArtifactVersion

use of org.eclipse.jkube.kit.config.resource.GroupArtifactVersion in project jkube by eclipse.

the class ProjectLabelEnricher method createLabels.

private Map<String, String> createLabels(boolean withoutVersion) {
    Map<String, String> ret = new HashMap<>();
    boolean enableProjectLabel = Configs.asBoolean(getConfig(Config.USE_PROJECT_LABEL));
    final GroupArtifactVersion groupArtifactVersion = getContext().getGav();
    if (enableProjectLabel) {
        ret.put("project", groupArtifactVersion.getArtifactId());
    } else {
        ret.put("app", getConfig(Config.APP, groupArtifactVersion.getArtifactId()));
    }
    ret.put("group", groupArtifactVersion.getGroupId());
    ret.put(LABEL_PROVIDER, getConfig(Config.PROVIDER));
    if (!withoutVersion) {
        ret.put("version", groupArtifactVersion.getVersion());
    }
    return ret;
}
Also used : HashMap(java.util.HashMap) GroupArtifactVersion(org.eclipse.jkube.kit.config.resource.GroupArtifactVersion)

Aggregations

GroupArtifactVersion (org.eclipse.jkube.kit.config.resource.GroupArtifactVersion)16 ImageConfiguration (org.eclipse.jkube.kit.config.image.ImageConfiguration)11 BuildConfiguration (org.eclipse.jkube.kit.config.image.build.BuildConfiguration)9 Before (org.junit.Before)8 Test (org.junit.Test)7 VolumeConfig (org.eclipse.jkube.kit.config.resource.VolumeConfig)6 Expectations (mockit.Expectations)2 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 ResourceConfig (org.eclipse.jkube.kit.config.resource.ResourceConfig)1