@Override public void close() throws IOException { super.close(); if (client != null) { client.close(); } }
/** * Creates a new {@link Tiller} that will use information from the * supplied {@link LocalPortForward} to establish a communications * channel with the Tiller server. * * @param portForward the {@link LocalPortForward} to use; must not * be {@code null} * * @exception NullPointerException if {@code portForward} is {@code * null} */ public Tiller(final LocalPortForward portForward) { super(); Objects.requireNonNull(portForward); this.config = null; this.portForward = null; // yes, null this.channel = this.buildChannel(portForward); }
public VersionOrBuilder getVersion() throws IOException { final ReleaseServiceBlockingStub stub = this.getReleaseServiceBlockingStub(); assert stub != null; final GetVersionResponse response = stub.getVersion(null); assert response != null; return response.getVersion(); }
@Test public void testNewTiller() throws Throwable { for (TillerConnectionType connectionType : TillerConnectionType.values()) { Tiller tiller = TillerFactory.newTiller(buildTillerConfig(connectionType)); assertNotNull(tiller); assertNotNull(tiller.getHealthStub()); tiller.close(); } }
/** * Uninstalls (deletes) a previously installed release. * * <p>This method never returns {@code null}.</p> * * <p>Overrides of this method must not return {@code null}.</p> * * @param request the {@link UninstallReleaseRequest} describing the * release; must not be {@code null} * * @return a {@link Future} containing a {@link * UninstallReleaseResponse} that has the information requested; * never {@code null} * * @exception NullPointerException if {@code request} is {@code * null} */ public Future<UninstallReleaseResponse> uninstall(final UninstallReleaseRequest request) throws IOException { Objects.requireNonNull(request); validate(request); final ReleaseServiceFutureStub stub = this.getTiller().getReleaseServiceFutureStub(); assert stub != null; return stub.uninstallRelease(request); }
final Tiller tiller = new Tiller((T)this.kubernetesClient, namespace, -1 /* use default */, labels); final HealthBlockingStub health = tiller.getHealthBlockingStub(); assert health != null; final HealthCheckRequest.Builder builder = HealthCheckRequest.newBuilder();
final io.fabric8.kubernetes.client.Config configuration = this.getTiller().getConfiguration(); if (configuration == null) { requestBuilder.setNamespace("default"); final ReleaseServiceFutureStub stub = this.getTiller().getReleaseServiceFutureStub(); assert stub != null; return stub.installRelease(requestBuilder.build());
@Override public CompletableFuture<Void> healthCheck() { ensureNotClosed(); CompletableFuture<HealthCheckResponse> completableFuture = new CompletableFuture<>(); StreamObserver<HealthCheckResponse> observer = createUnaryCallStreamObserverForCompletableFuture( completableFuture); tiller.getHealthStub().check(HealthCheckRequest.getDefaultInstance(), observer); return completableFuture.thenAccept(response -> { if (response.getStatus() != ServingStatus.SERVING) { throw new TillerClientException(String.format(HEALTH_CHECK_STATUS_MESSAGE_FORMAT, response.getStatus().toString())); } }); }
/** * Returns the history of a given Helm release. * * <p>This method never returns {@code null}.</p> * * <p>Overrides of this method must not return {@code null}.</p> * * @param request the {@link GetHistoryRequest} * describing the release; must not be {@code null} * * @return a {@link Future} containing a {@link * GetHistoryResponse} that has the information requested; * never {@code null} * * @exception NullPointerException if {@code request} is {@code * null} */ public Future<GetHistoryResponse> getHistory(final GetHistoryRequest request) throws IOException { Objects.requireNonNull(request); validate(request); final ReleaseServiceFutureStub stub = this.getTiller().getReleaseServiceFutureStub(); assert stub != null; return stub.getHistory(request); }
final Tiller tiller = new Tiller((T)this.kubernetesClient, namespace, -1 /* use default */, labels); final HealthBlockingStub health = tiller.getHealthBlockingStub(); assert health != null; final HealthCheckRequest.Builder builder = HealthCheckRequest.newBuilder();
final io.fabric8.kubernetes.client.Config configuration = this.getTiller().getConfiguration(); if (configuration == null) { requestBuilder.setNamespace("default"); final ReleaseServiceFutureStub stub = this.getTiller().getReleaseServiceFutureStub(); assert stub != null; return stub.installRelease(requestBuilder.build());
/** * Calls {@link Tiller#close() close()} on the {@link Tiller} * instance {@linkplain #ReleaseManager(Tiller) supplied at * construction time}. * * @exception IOException if an error occurs */ @Override public void close() throws IOException { this.getTiller().close(); }
/** * Returns the status of a given Helm release. * * <p>This method never returns {@code null}.</p> * * <p>Overrides of this method must not return {@code null}.</p> * * @param request the {@link GetReleaseStatusRequest} describing the * release; must not be {@code null} * * @return a {@link Future} containing a {@link * GetReleaseStatusResponse} that has the information requested; * never {@code null} * * @exception NullPointerException if {@code request} is {@code * null} */ public Future<GetReleaseStatusResponse> getStatus(final GetReleaseStatusRequest request) throws IOException { Objects.requireNonNull(request); validate(request); final ReleaseServiceFutureStub stub = this.getTiller().getReleaseServiceFutureStub(); assert stub != null; return stub.getReleaseStatus(request); }
public VersionOrBuilder getVersion() throws IOException { final ReleaseServiceBlockingStub stub = this.getReleaseServiceBlockingStub(); assert stub != null; final GetVersionResponse response = stub.getVersion(null); assert response != null; return response.getVersion(); }
/** * Creates a new {@link Tiller} that will use information from the * supplied {@link LocalPortForward} to establish a communications * channel with the Tiller server. * * @param portForward the {@link LocalPortForward} to use; must not * be {@code null} * * @exception NullPointerException if {@code portForward} is {@code * null} */ public Tiller(final LocalPortForward portForward) { super(); Objects.requireNonNull(portForward); this.config = null; this.portForward = null; // yes, null this.channel = this.buildChannel(portForward); }
/** * Calls {@link Tiller#close() close()} on the {@link Tiller} * instance {@linkplain #ReleaseManager(Tiller) supplied at * construction time}. * * @exception IOException if an error occurs */ @Override public void close() throws IOException { this.getTiller().close(); }
/** * Rolls back a previously installed release. * * <p>This method never returns {@code null}.</p> * * <p>Overrides of this method must not return {@code null}.</p> * * @param request the {@link RollbackReleaseRequest} describing the * release; must not be {@code null} * * @return a {@link Future} containing a {@link * RollbackReleaseResponse} that has the information requested; * never {@code null} * * @exception NullPointerException if {@code request} is {@code * null} */ public Future<RollbackReleaseResponse> rollback(final RollbackReleaseRequest request) throws IOException { Objects.requireNonNull(request); validate(request); final ReleaseServiceFutureStub stub = this.getTiller().getReleaseServiceFutureStub(); assert stub != null; return stub.rollbackRelease(request); }
/** * Returns information about tests run on a given Helm release. * * <p>This method never returns {@code null}.</p> * * <p>Overrides of this method must not return {@code null}.</p> * * @param request the {@link TestReleaseRequest} describing the * release to be tested; must not be {@code null} * * @return an {@link Iterator} of {@link TestReleaseResponse} * objects comprising the information requested; never {@code null} * * @exception NullPointerException if {@code request} is {@code * null} */ public Iterator<TestReleaseResponse> test(final TestReleaseRequest request) { Objects.requireNonNull(request); validate(request); final ReleaseServiceBlockingStub stub = this.getTiller().getReleaseServiceBlockingStub(); assert stub != null; return stub.runReleaseTest(request); }
throw new TillerException("Could not forward port to a Ready Tiller pod's port " + tillerPort + " in namespace " + namespaceHousingTiller + " with labels " + tillerLabels); this.channel = this.buildChannel(this.portForward);
@Override public void close() { ensureNotClosed(); try { tiller.close(); closed = true; } catch (IOException e) { throw new TillerClientException("Failed to close tiller instance", e); } }