public abstract class AbstractReleaseMojo extends AbstractHelmMojo
AbstractHelmMojo that provides other Helm-related
mojo
implementations the ability to work with a ReleaseManager.execute(Callable)| Modifier | Constructor and Description |
|---|---|
protected |
AbstractReleaseMojo()
Creates a new
AbstractReleaseMojo. |
| Modifier and Type | Method and Description |
|---|---|
protected DefaultKubernetesClient |
createClient()
Creates a
DefaultKubernetesClient for communicating with
Kubernetes clusters. |
protected ReleaseManager |
createReleaseManager(Tiller tiller)
Creates a
ReleaseManager and returns it. |
protected Tiller |
createTiller(DefaultKubernetesClient client)
Creates a
Tiller and returns it. |
void |
execute()
Skips execution if instructed, or calls
the
execute(Callable) method with a Callable
containing the results of an invocation of the createReleaseManager(Tiller) method. |
protected abstract void |
execute(Callable<ReleaseManager> releaseManagerCallable)
|
Config |
getClientConfiguration()
Returns the
Config describing how a DefaultKubernetesClient is to connect to a Kubernetes cluster. |
boolean |
getSkip()
Returns
true if this AbstractReleaseMojo should
not execute. |
Map<String,String> |
getTillerLabels()
Returns the Kubernetes labels that Tiller Pods have.
|
String |
getTillerNamespace()
Returns the Kubernetes namespace in which Tiller may be found.
|
int |
getTillerPort()
Returns the port on which Tiller may be found.
|
void |
setClientConfiguration(Config config)
Installs the
Config describing how a DefaultKubernetesClient is to connect to a Kubernetes cluster. |
void |
setSkip(boolean skip)
Controls whether this
AbstractReleaseMojo should execute. |
void |
setTillerLabels(Map<String,String> tillerLabels)
Sets the Kubernetes labels that Tiller Pods have.
|
void |
setTillerNamespace(String tillerNamespace)
Sets the Kubernetes namespace in which Tiller may be found.
|
void |
setTillerPort(int tillerPort)
Sets the port on which Tiller may be found.
|
protected void |
validateNamespace(String namespace)
Validates a Kubernetes
namespace for correctness.
|
getLog, getPluginContext, setLog, setPluginContextprotected AbstractReleaseMojo()
AbstractReleaseMojo.public void execute() throws MojoExecutionException, MojoFailureException
execute(Callable) method with a Callable
containing the results of an invocation of the createReleaseManager(Tiller) method.MojoExecutionException - if there was a problem
executing this mojoMojoFailureException - if the mojo executed properly,
but the job it was to perform failed in some waypublic Config getClientConfiguration()
Config describing how a DefaultKubernetesClient is to connect to a Kubernetes cluster.
This method may return null.
Overrides of this method may return null.
Config, or nullsetClientConfiguration(Config)public void setClientConfiguration(Config config)
Config describing how a DefaultKubernetesClient is to connect to a Kubernetes cluster.config - the Config to use; may be nullgetClientConfiguration()public boolean getSkip()
true if this AbstractReleaseMojo should
not execute.true if this AbstractReleaseMojo should
not execute; false otherwisesetSkip(boolean)public void setSkip(boolean skip)
AbstractReleaseMojo should execute.skip - if true, this AbstractReleaseMojo
will not executegetSkip()public String getTillerNamespace()
This method may return null.
nullpublic void setTillerNamespace(String tillerNamespace)
tillerNamespace - the Kubernetes namespace in which Tiller
may be found; may be null in which case kube-system will be used by the createTiller(DefaultKubernetesClient) method insteadpublic int getTillerPort()
44134public void setTillerPort(int tillerPort)
tillerPort - the port on which Tiller may be found; normally
44134public Map<String,String> getTillerLabels()
This method may return null.
nullpublic void setTillerLabels(Map<String,String> tillerLabels)
Tiller Pods are normally labeled with app = helm and
name = tiller.
tillerLabels - a Map containing the labels; may be
nullprotected abstract void execute(Callable<ReleaseManager> releaseManagerCallable) throws Exception
releaseManagerCallable - the Callable that will
provide a ReleaseManager; must not be nullException - if an error occursprotected DefaultKubernetesClient createClient() throws IOException
DefaultKubernetesClient for communicating with
Kubernetes clusters.
This method never returns null.
Overrides of this method must not return null.
The default implementation calls the getClientConfiguration() method and uses its
return value, unless it is null, in which case a new
DefaultKubernetesClient is created via its no-argument
constructor.
null DefaultKubernetesClientIOException - if there was a problem creating the clientprotected Tiller createTiller(DefaultKubernetesClient client) throws IOException
Tiller and returns it.
This method never returns null.
Overrides of this method must not return null.
This implementation passes the supplied DefaultKubernetesClient to the appropriate
Tiller constructor.
client - the DefaultKubernetesClient to use to
communicate with a Kubernetes cluster; must not be nullTiller; never nullNullPointerException - if client is nullIOException - if there was a problem creating a Tillerprotected ReleaseManager createReleaseManager(Tiller tiller) throws IOException
ReleaseManager and returns it.
This method never returns null.
Overrides of this method must not return null.
This implementation passes the supplied Tiller to the appropriate ReleaseManager constructor.
tiller - the Tiller to use to communicate with a
Tiller server; must not be nullReleaseManager; never nullNullPointerException - if tiller is nullIOException - if there was a problem creating a ReleaseManagerprotected void validateNamespace(String namespace)
The default implementation checks the supplied namespace to see if it is less than or equal to characters, and if it
matches the value of the ReleaseManager.DNS_LABEL_PATTERN field.
namespace - the namespace
to validate; may be nullIllegalArgumentException - if namespace is
invalidCopyright © 2017–2018, microBean. All rights reserved.