/** * Add a dynamic pod template. Won't be displayed in UI, and persisted separately from the cloud instance. * @param t the template to add */ public void addDynamicTemplate(PodTemplate t) { PodTemplateMap.get().addTemplate(this, t); }
/** * Remove a dynamic pod template. * @param t the template to remove */ public void removeDynamicTemplate(PodTemplate t) { PodTemplateMap.get().removeTemplate(this, t); }
@Nonnull @Override public List<PodTemplate> getList(@Nonnull KubernetesCloud cloud) { return PodTemplateMap.get().getTemplates(cloud); } }
/** * Returns a read-only view of the templates available for the corresponding cloud instance. * @param cloud The kubernetes cloud instance for which templates are needed * @return a read-only view of the templates available for the corresponding cloud instance. */ @Nonnull public List<PodTemplate> getTemplates(@Nonnull KubernetesCloud cloud) { return Collections.unmodifiableList(getOrCreateTemplateList(cloud)); }
/** * Adds a template for the corresponding cloud instance. * @param cloud The cloud instance. * @param podTemplate The pod template to add. */ public void addTemplate(@Nonnull KubernetesCloud cloud, @Nonnull PodTemplate podTemplate) { List<PodTemplate> list = getOrCreateTemplateList(cloud); list.add(podTemplate); map.put(cloud.name, list); }
public void removeTemplate(@Nonnull KubernetesCloud cloud, @Nonnull PodTemplate podTemplate) { getOrCreateTemplateList(cloud).remove(podTemplate); }