public class ReleaseManager extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static int |
DNS_LABEL_MAX_LENGTH
The maximum number of characters a Kubernetes
identifier of type
DNS_LABEL is permitted to contain
(63). |
static Pattern |
DNS_LABEL_PATTERN
|
static int |
DNS_SUBDOMAIN_MAX_LENGTH
The maximum number of characters a Kubernetes
identifier of type
DNS_SUBDOMAIN is permitted to contain
(253). |
static Pattern |
DNS_SUBDOMAIN_PATTERN
|
static int |
HELM_RELEASE_NAME_MAX_LENGTH
The maximum number of characters a Helm release name is permitted
to contain (53).
|
static Pattern |
RFC_1123_PATTERN
An alias for the
DNS_SUBDOMAIN_PATTERN field. |
Constructor and Description |
---|
ReleaseManager(Tiller tiller)
Creates a new
ReleaseManager . |
public static final int DNS_SUBDOMAIN_MAX_LENGTH
DNS_SUBDOMAIN
is permitted to contain
(253).public static final Pattern DNS_SUBDOMAIN_PATTERN
public static final int DNS_LABEL_MAX_LENGTH
DNS_LABEL
is permitted to contain
(63).public static final Pattern DNS_LABEL_PATTERN
public static final int HELM_RELEASE_NAME_MAX_LENGTH
public static final Pattern RFC_1123_PATTERN
DNS_SUBDOMAIN_PATTERN
field.DNS_SUBDOMAIN_PATTERN
public ReleaseManager(Tiller tiller)
ReleaseManager
.tiller
- the Tiller
instance representing a
connection to the Tiller
server; must not be null
NullPointerException
- if tiller
is null
Tiller
protected final Tiller getTiller()
Tiller
instance used to communicate with
Helm's back-end Tiller component.
This method never returns null
.
null
Tiller
ReleaseManager(Tiller)
,
Tiller
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if an error occurspublic Future<Tiller.GetReleaseContentResponse> getContent(Tiller.GetReleaseContentRequest request) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.GetReleaseContentRequest
describing
the release; must not be null
Future
containing a Tiller.GetReleaseContentResponse
that has the information requested;
never null
NullPointerException
- if request
is null
IOException
public Future<Tiller.GetHistoryResponse> getHistory(Tiller.GetHistoryRequest request) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.GetHistoryRequest
describing the release; must not be null
Future
containing a Tiller.GetHistoryResponse
that has the information requested;
never null
NullPointerException
- if request
is null
IOException
public Future<Tiller.GetReleaseStatusResponse> getStatus(Tiller.GetReleaseStatusRequest request) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.GetReleaseStatusRequest
describing the
release; must not be null
Future
containing a Tiller.GetReleaseStatusResponse
that has the information requested;
never null
NullPointerException
- if request
is null
IOException
public Future<Tiller.InstallReleaseResponse> install(Tiller.InstallReleaseRequest.Builder requestBuilder, ChartOuterClass.Chart.Builder chartBuilder) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
requestBuilder
- the Tiller.InstallReleaseRequest.Builder
representing the
installation request; must not be null
and must
pass
validation; its Tiller.InstallReleaseRequest.Builder.setChart(hapi.chart.ChartOuterClass.Chart.Builder)
method will be called with the supplied chartBuilder
as
its argument valuechartBuilder
- a ChartOuterClass.Chart.Builder
representing the Helm
chart to install; must not be null
Future
containing a Tiller.InstallReleaseResponse
that has the information requested; never
null
MissingDependenciesException
- if the supplied chartBuilder
has a requirements.yaml
resource in it that
mentions subcharts that it does not containNullPointerException
- if request
is null
IOException
AbstractChartLoader
public Iterator<Tiller.ListReleasesResponse> list(Tiller.ListReleasesRequest request)
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.ListReleasesRequest
describing the
releases to be returned; must not be null
Iterator
of Tiller.ListReleasesResponse
objects comprising the information requested; never null
NullPointerException
- if request
is null
PatternSyntaxException
- if the Tiller.ListReleasesRequestOrBuilder.getFilter()
return value is
non-null
, non-empty but not
a valid regular expressionpublic Future<Tiller.RollbackReleaseResponse> rollback(Tiller.RollbackReleaseRequest request) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.RollbackReleaseRequest
describing the
release; must not be null
Future
containing a Tiller.RollbackReleaseResponse
that has the information requested;
never null
NullPointerException
- if request
is null
IOException
public Iterator<Tiller.TestReleaseResponse> test(Tiller.TestReleaseRequest request)
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.TestReleaseRequest
describing the
release to be tested; must not be null
Iterator
of Tiller.TestReleaseResponse
objects comprising the information requested; never null
NullPointerException
- if request
is null
public Future<Tiller.UninstallReleaseResponse> uninstall(Tiller.UninstallReleaseRequest request) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
request
- the Tiller.UninstallReleaseRequest
describing the
release; must not be null
Future
containing a Tiller.UninstallReleaseResponse
that has the information requested;
never null
NullPointerException
- if request
is null
IOException
public Future<Tiller.UpdateReleaseResponse> update(Tiller.UpdateReleaseRequest.Builder requestBuilder, ChartOuterClass.Chart.Builder chartBuilder) throws IOException
This method never returns null
.
Overrides of this method must not return null
.
requestBuilder
- the Tiller.UpdateReleaseRequest.Builder
representing the installation request; must not be null
and must pass validation;
its Tiller.UpdateReleaseRequest.Builder.setChart(hapi.chart.ChartOuterClass.Chart.Builder)
method will be called with the supplied chartBuilder
as
its argument valuechartBuilder
- a ChartOuterClass.Chart.Builder
representing the Helm
chart with which to update the release; must not be null
Future
containing a Tiller.UpdateReleaseResponse
that has the information requested; never
null
NullPointerException
- if request
is null
IOException
AbstractChartLoader
protected void validate(Tiller.GetReleaseContentRequestOrBuilder request)
Tiller.GetReleaseContentRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.GetHistoryRequestOrBuilder request)
Tiller.GetHistoryRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.GetReleaseStatusRequestOrBuilder request)
Tiller.GetReleaseStatusRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.InstallReleaseRequestOrBuilder request)
Tiller.InstallReleaseRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.ListReleasesRequestOrBuilder request)
Tiller.ListReleasesRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.RollbackReleaseRequestOrBuilder request)
Tiller.RollbackReleaseRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.TestReleaseRequestOrBuilder request)
Tiller.TestReleaseRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.UninstallReleaseRequestOrBuilder request)
Tiller.UninstallReleaseRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validate(Tiller.UpdateReleaseRequestOrBuilder request)
Tiller.UpdateReleaseRequestOrBuilder
.request
- the request to validateNullPointerException
- if request
is null
IllegalArgumentException
- if request
is invalidvalidateReleaseName(String)
protected void validateReleaseName(String name)
name
is a valid Helm release
name.
Because frequently Helm releases are not required to be named
by the end user, a null
or empty name
is valid.
Because Helm release names are often used in hostnames, they
should conform to RFC 1123.
This method performs that validation by default, using the DNS_SUBDOMAIN_PATTERN
field.
name
- the name to validate; may be null
or
String.isEmpty() since Tiller will generate a valid
name in such a case using the moniker
project; if non-null
must match the pattern
represented by the value of the DNS_SUBDOMAIN_PATTERN
fieldDNS_SUBDOMAIN_PATTERN
,
RFC
1123protected void validateNamespace(String namespace)
namespace
is a valid namespace.
Namespaces must
conform to RFC 1123.
This method performs that validation by default, using the DNS_SUBDOMAIN_PATTERN
field.
namespace
- the namespace to validate; may be null
or
String.isEmpty()DNS_LABEL_PATTERN
,
RFC
1123Copyright © 2017–2018, microBean. All rights reserved.