Class HelmCommand<C extends HelmCommand>
- java.lang.Object
-
- com.oracle.bedrock.runtime.k8s.helm.HelmCommand<C>
-
- Type Parameters:
C- the type of the command
- All Implemented Interfaces:
CLI<C>,MetaClass<Application>
- Direct Known Subclasses:
HelmCommand.Template,HelmCreate,HelmDelete,HelmDependencyBuild,HelmDependencyList,HelmDependencyUpdate,HelmFetch,HelmGet,HelmGetHooks,HelmGetManifest,HelmGetValues,HelmHistory,HelmInit,HelmInspect,HelmInstall,HelmLint,HelmList,HelmRollback,HelmStatus,HelmTest,HelmUpgrade
public abstract class HelmCommand<C extends HelmCommand> extends Object implements CLI<C>
An immutable representation of a Helm command that can be executed by a BedrockPlatform.Copyright (c) 2018. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.- Author:
- Jonathan Knight
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHelmCommand.TemplateA generic Helm command.-
Nested classes/interfaces inherited from interface com.oracle.bedrock.runtime.k8s.helm.CLI
CLI.WithCerts<C extends CLI.WithCerts>, CLI.WithRepo<C extends CLI.WithRepo>, CLI.WithTLS<C extends CLI.WithTLS>
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_HELMThe default location of the Helm executable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Applicationexecute(com.oracle.bedrock.Option... options)Execute this Helm command on theLocalPlatform.intexecuteAndWait(com.oracle.bedrock.Option... options)Execute this Helm command on theLocalPlatformand wait for the command to complete.ArgumentsgetArguments()Obtain the arguments to this command.String[]getCommands()Obtain the Helm command that will be executed.EnvironmentVariablesgetEnvironment()Obtain the environment variables for this command.ArgumentsgetFlags()Obtain the flags to this command.StringgetHelmLocation()Obtain the Helm executable to run.Class<? extends Application>getImplementationClass(Platform platform, com.oracle.bedrock.OptionsByType options)booleanhelmExists()Determine whether the Helm executable that this command would use exists.booleanisFlagsFirst()Determine whether the flags appear at the start or end of the command line.voidonLaunch(Platform platform, com.oracle.bedrock.OptionsByType optionsByType)voidonLaunched(Platform platform, Application application, com.oracle.bedrock.OptionsByType optionsByType)voidonLaunching(Platform platform, com.oracle.bedrock.OptionsByType optionsByType)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.oracle.bedrock.runtime.k8s.helm.CLI
debug, home, host, kubeConfig, kubeContext, newInstance, tillerNamespace, withArguments, withArguments, withArguments, withEnvironment, withEnvironment, withEnvironment, withEnvironment, withFlags, withFlags, withFlags, withHelmAt
-
-
-
-
Field Detail
-
DEFAULT_HELM
public static final String DEFAULT_HELM
The default location of the Helm executable.
-
-
Method Detail
-
getHelmLocation
public String getHelmLocation()
Obtain the Helm executable to run.- Specified by:
getHelmLocationin interfaceCLI<C extends HelmCommand>- Returns:
- the Helm executable to run
-
helmExists
public boolean helmExists()
Determine whether the Helm executable that this command would use exists.- Returns:
trueif the Helm executable exists
-
getCommands
public String[] getCommands()
Obtain the Helm command that will be executed.- Specified by:
getCommandsin interfaceCLI<C extends HelmCommand>- Returns:
- the Helm command that will be executed
-
getArguments
public Arguments getArguments()
Obtain the arguments to this command.- Specified by:
getArgumentsin interfaceCLI<C extends HelmCommand>- Returns:
- the arguments to this command
-
getEnvironment
public EnvironmentVariables getEnvironment()
Obtain the environment variables for this command.- Specified by:
getEnvironmentin interfaceCLI<C extends HelmCommand>- Returns:
- the environment variables for this command
-
getFlags
public Arguments getFlags()
Obtain the flags to this command.- Specified by:
getFlagsin interfaceCLI<C extends HelmCommand>- Returns:
- the flags to this command
-
isFlagsFirst
public boolean isFlagsFirst()
Determine whether the flags appear at the start or end of the command line.- Specified by:
isFlagsFirstin interfaceCLI<C extends HelmCommand>- Returns:
trueif the flags appear at the start or end of the command line
-
execute
public Application execute(com.oracle.bedrock.Option... options)
Execute this Helm command on theLocalPlatform.- Parameters:
options- any options to apply to the process- Returns:
- the
Applicationrepresenting the Helm command execution
-
executeAndWait
public int executeAndWait(com.oracle.bedrock.Option... options)
Execute this Helm command on theLocalPlatformand wait for the command to complete.- Parameters:
options- any options to apply to the process- Returns:
- the return code from the completed command.
-
getImplementationClass
public Class<? extends Application> getImplementationClass(Platform platform, com.oracle.bedrock.OptionsByType options)
- Specified by:
getImplementationClassin interfaceMetaClass<C extends HelmCommand>
-
onLaunching
public void onLaunching(Platform platform, com.oracle.bedrock.OptionsByType optionsByType)
- Specified by:
onLaunchingin interfaceMetaClass<C extends HelmCommand>
-
onLaunch
public void onLaunch(Platform platform, com.oracle.bedrock.OptionsByType optionsByType)
- Specified by:
onLaunchin interfaceMetaClass<C extends HelmCommand>
-
onLaunched
public void onLaunched(Platform platform, Application application, com.oracle.bedrock.OptionsByType optionsByType)
- Specified by:
onLaunchedin interfaceMetaClass<C extends HelmCommand>
-
-