public class PodTemplateUtils extends Object
Constructor and Description |
---|
PodTemplateUtils() |
Modifier and Type | Method and Description |
---|---|
static io.fabric8.kubernetes.api.model.Container |
combine(io.fabric8.kubernetes.api.model.Container parent,
io.fabric8.kubernetes.api.model.Container template)
Combines a Container with its parent.
|
static ContainerTemplate |
combine(ContainerTemplate parent,
ContainerTemplate template)
Combines a
ContainerTemplate with its parent. |
static io.fabric8.kubernetes.api.model.Pod |
combine(List<io.fabric8.kubernetes.api.model.Pod> pods)
Combines all given pods together in order.
|
static io.fabric8.kubernetes.api.model.Pod |
combine(io.fabric8.kubernetes.api.model.Pod parent,
io.fabric8.kubernetes.api.model.Pod template)
Combines a Pod with its parent.
|
static PodTemplate |
combine(PodTemplate parent,
PodTemplate template)
Combines a
PodTemplate with its parent. |
static PodTemplate |
getTemplateByLabel(Label label,
Collection<PodTemplate> templates)
Gets the
PodTemplate by Label . |
static PodTemplate |
getTemplateByName(String name,
Collection<PodTemplate> templates)
Gets the
PodTemplate by name. |
static io.fabric8.kubernetes.api.model.Pod |
parseFromYaml(String yaml) |
static String |
substitute(String s,
Map<String,String> properties)
Deprecated.
|
static String |
substitute(String s,
Map<String,String> properties,
String defaultValue)
Deprecated.
check if it is null or empty in the caller method, then use
substitute(String,Map) |
static String |
substituteEnv(String s)
Substitutes a placeholder with a value found in the environment.
|
static String |
substituteEnv(String s,
String defaultValue)
Deprecated.
check if it is null or empty in the caller method, then use
substituteEnv(String) |
static boolean |
validateContainerName(String name) |
static boolean |
validateLabel(String label) |
static Collection<String> |
validateYamlContainerNames(List<String> yamls) |
static Collection<String> |
validateYamlContainerNames(String yaml) |
public static ContainerTemplate combine(@CheckForNull ContainerTemplate parent, @Nonnull ContainerTemplate template)
ContainerTemplate
with its parent.parent
- The parent container template (nullable).template
- The actual container templatepublic static io.fabric8.kubernetes.api.model.Container combine(@CheckForNull io.fabric8.kubernetes.api.model.Container parent, @Nonnull io.fabric8.kubernetes.api.model.Container template)
parent
- The parent container (nullable).template
- The actual containerpublic static io.fabric8.kubernetes.api.model.Pod combine(List<io.fabric8.kubernetes.api.model.Pod> pods)
pods
- the pods to combinepublic static io.fabric8.kubernetes.api.model.Pod combine(io.fabric8.kubernetes.api.model.Pod parent, io.fabric8.kubernetes.api.model.Pod template)
parent
- The parent Pod (nullable).template
- The child Podpublic static PodTemplate combine(PodTemplate parent, PodTemplate template)
PodTemplate
with its parent.parent
- The parent container template (nullable).template
- The actual container templatepublic static PodTemplate getTemplateByLabel(@CheckForNull Label label, Collection<PodTemplate> templates)
PodTemplate
by Label
.label
- The label.templates
- The list of all templates.public static PodTemplate getTemplateByName(@CheckForNull String name, Collection<PodTemplate> templates)
PodTemplate
by name.name
- The name.templates
- The list of all templates.public static String substituteEnv(String s)
s
- The placeholder. Should be use the format: ${placeholder}.@Deprecated public static String substituteEnv(String s, String defaultValue)
substituteEnv(String)
s
- The placeholder. Should be use the format: ${placeholder}.defaultValue
- The default value to return if no match is found.@Deprecated public static String substitute(String s, Map<String,String> properties)
Util.replaceMacro(String, Map)
s
- The placeholder. Should be use the format: ${placeholder}.properties
- The map with the key value pairs to use for substitution.@Deprecated public static String substitute(String s, Map<String,String> properties, String defaultValue)
substitute(String,Map)
s
- The placeholder. Should be use the format: ${placeholder}.properties
- The map with the key value pairs to use for substitution.defaultValue
- The default value to return if no match is found.public static io.fabric8.kubernetes.api.model.Pod parseFromYaml(String yaml)
public static Collection<String> validateYamlContainerNames(List<String> yamls)
public static Collection<String> validateYamlContainerNames(String yaml)
public static boolean validateContainerName(String name)
public static boolean validateLabel(String label)
Copyright © 2016–2019. All rights reserved.