Package io.fabric8.maven.docker.config
Class ConfigHelper
- java.lang.Object
-
- io.fabric8.maven.docker.config.ConfigHelper
-
public class ConfigHelper extends Object
Utility class which helps in resolving, customizing, initializing and validating image configuration.- Since:
- 17/05/16
- Author:
- roland
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceConfigHelper.CustomizerAllow subclasses to customize the given set of image configurations.static interfaceConfigHelper.NameFormatterFormat an image name by replacing certain placeholdersstatic interfaceConfigHelper.ResolverA resolver can map one given image configuration to one or more image configurations This is e.g.
-
Field Summary
Fields Modifier and Type Field Description static StringEXTERNALCONFIG_ACTIVATION_PROPERTY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetExternalConfigActivationProperty(org.apache.maven.project.MavenProject project)static StringinitAndValidate(List<ImageConfiguration> images, String apiVersion, ConfigHelper.NameFormatter nameFormatter, Logger log)Initialize and validate the configuration.static booleanmatchesConfiguredImages(String imageList, ImageConfiguration imageConfig)static List<ImageConfiguration>resolveImages(Logger logger, List<ImageConfiguration> images, ConfigHelper.Resolver imageResolver, String imageNameFilter, ConfigHelper.Customizer imageCustomizer)Resolve image with an external image resolverstatic voidvalidateExternalPropertyActivation(org.apache.maven.project.MavenProject project, List<ImageConfiguration> images)
-
-
-
Field Detail
-
EXTERNALCONFIG_ACTIVATION_PROPERTY
public static final String EXTERNALCONFIG_ACTIVATION_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
resolveImages
public static List<ImageConfiguration> resolveImages(Logger logger, List<ImageConfiguration> images, ConfigHelper.Resolver imageResolver, String imageNameFilter, ConfigHelper.Customizer imageCustomizer)
Resolve image with an external image resolver- Parameters:
images- the original image config list (can be null)imageResolver- the resolver used to extend on an image configurationimageNameFilter- filter to select only certain image configurations with the given nameimageCustomizer- final customization hook for mangling the configuration- Returns:
- a list of resolved and customized image configuration.
-
validateExternalPropertyActivation
public static void validateExternalPropertyActivation(org.apache.maven.project.MavenProject project, List<ImageConfiguration> images) throws org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoFailureException
-
getExternalConfigActivationProperty
public static String getExternalConfigActivationProperty(org.apache.maven.project.MavenProject project)
-
initAndValidate
public static String initAndValidate(List<ImageConfiguration> images, String apiVersion, ConfigHelper.NameFormatter nameFormatter, Logger log)
Initialize and validate the configuration.- Parameters:
images- the images to checkapiVersion- the original API version intended to usenameFormatter- formatter for image nameslog- a logger for printing out diagnostic messages- Returns:
- the minimal API Docker API required to be used for the given configuration.
-
matchesConfiguredImages
public static boolean matchesConfiguredImages(String imageList, ImageConfiguration imageConfig)
-
-