public class ConfigurationPropertyValidator extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Throwable> |
checkHttpTimeoutProperty(Function<String,T> exceptionFactory)
Checks the
jib.httpTimeout system property for invalid (non-integer or negative)
values. |
static ImageReference |
getGeneratedTargetDockerTag(String targetImage,
JibLogger logger,
String projectName,
String projectVersion,
HelpfulSuggestions helpfulSuggestions)
Returns an
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configured |
static Credential |
getImageCredential(JibLogger logger,
String usernameProperty,
String passwordProperty,
AuthProperty auth)
Gets a
Credential from a username and password. |
public static <T extends Throwable> void checkHttpTimeoutProperty(Function<String,T> exceptionFactory) throws T extends Throwable
jib.httpTimeout system property for invalid (non-integer or negative)
values.T - the exception type to throw if invalid valuesexceptionFactory - factory to create an exception with the given descriptionT - if invalid valuesT extends Throwable@Nullable public static Credential getImageCredential(JibLogger logger, String usernameProperty, String passwordProperty, AuthProperty auth)
Credential from a username and password. First tries system properties, then
tries build configuration, otherwise returns null.logger - the JibLogger used to print warnings messagesusernameProperty - the name of the username system propertypasswordProperty - the name of the password system propertyauth - the configured credentialsAuthorization from the system properties or build configuration, or
null if neither is configured.public static ImageReference getGeneratedTargetDockerTag(@Nullable String targetImage, JibLogger logger, String projectName, String projectVersion, HelpfulSuggestions helpfulSuggestions) throws InvalidImageReferenceException
ImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configuredtargetImage - the configured target image referencelogger - the JibLogger used to show messagesprojectName - the project name, as determined by the pluginprojectVersion - the project version, as determined by the pluginhelpfulSuggestions - used for generating the message notifying the user of the generated
tagImageReference parsed from the configured target image, or one of the form
project-name:project-version if target image is not configuredInvalidImageReferenceException - if the configured or generated image reference is
invalidCopyright © 2018. All rights reserved.