---
tags: Discussion
---
# PHASE PLAN Execution Design
TODO
* There are some impacts in the Phase Plan dealing with delivering the Management/Target cluster reletaed to the i ntroducction of teh airshipctl cluster import subcommand.
* Executor or someother way will somehow need to take into account the cluster import.
```plantuml
@startuml
namespace phase {
class GenericRunFlags << (S,Aquamarine) >> {
+ DryRun bool
+ Timeout time.Duration
+ Kubeconfig string
+ Progress bool
}
class Helper << (S,Aquamarine) >> {
- phaseBundleRoot string
- inventoryRoot string
- targetPath string
- phaseRepoDir string
- phaseEntryPointBasePath string
- inventory ifc.Inventory
- metadata *config.Metadata
- config *config.Config
- getDocsByPhasePlan(planID ifc.ID, bundle document.Bundle) ([]document.Document, error)
+ Phase(phaseID ifc.ID) (*v1alpha1.Phase, error)
+ Plan(planID ifc.ID) (*v1alpha1.PhasePlan, error)
+ ListPhases(o ifc.ListPhaseOptions) ([]*v1alpha1.Phase, error)
+ ListPlans() ([]*v1alpha1.PhasePlan, error)
+ ClusterMapAPIobj() (*v1alpha1.ClusterMap, error)
+ ClusterMap() (clustermap.ClusterMap, error)
+ ExecutorDoc(phaseID ifc.ID) (document.Document, error)
+ TargetPath() string
+ PhaseRepoDir() string
+ DocEntryPointPrefix() string
+ PhaseBundleRoot() string
+ PhaseEntryPointBasePath() string
+ WorkDir() (string, error)
+ Inventory() (ifc.Inventory, error)
}
class RenderCommand << (S,Aquamarine) >> {
+ Label string
+ Annotation string
+ APIVersion string
+ Kind string
+ Source string
+ FailOnDecryptionError bool
+ PhaseID ifc.ID
+ RunE(cfgFactory config.Factory, out io.Writer) error
+ Validate() error
}
class RunCommand << (S,Aquamarine) >> {
+ Options RunFlags
+ Factory config.Factory
+ RunE() error
}
class RunFlags << (S,Aquamarine) >> {
+ PhaseID ifc.ID
}
class client << (S,Aquamarine) >> {
- registry ExecutorRegistry
- processorFunc ProcessorFunc
- kubeconfig string
+ PhaseByID(id ifc.ID) (ifc.Phase, error)
+ PlanByID(id ifc.ID) (ifc.Plan, error)
+ PhaseByAPIObj(phaseObj *v1alpha1.Phase) (ifc.Phase, error)
}
class phase << (S,Aquamarine) >> {
- helper ifc.Helper
- apiObj *v1alpha1.Phase
- registry ExecutorRegistry
- processor events.EventProcessor
- kubeconfig string
+ Executor() (ifc.Executor, error)
+ Run(ro ifc.RunOptions) error
+ Validate() error
+ Render(w io.Writer, executorRender bool, options ifc.RenderOptions) error
+ DocumentRoot() (string, error)
+ Details() (string, error)
}
class phase.ExecutorRegistry << (T, #FF7700) >> {
}
class phase.Option << (T, #FF7700) >> {
}
class phase.ProcessorFunc << (T, #FF7700) >> {
}
class "<font color=blue>func</font>() events.EventProcessor" as fontcolorbluefuncfonteventsEventProcessor {
'This class was created so that we can correctly have an alias pointing to this name. Since it contains dots that can break namespaces
}
class "<font color=blue>func</font>() <font color=blue>map</font>[schema.GroupVersionKind]ifc.ExecutorFactory" as fontcolorbluefuncfontfontcolorbluemapfontschemaGroupVersionKindifcExecutorFactory {
'This class was created so that we can correctly have an alias pointing to this name. Since it contains dots that can break namespaces
}
}
"phase.GenericRunFlags" *-- "phase.PlanRunFlags"
"phase.GenericRunFlags" *-- "phase.RunFlags"
"ifc.Helper" *-- "phase.client"
"phase.fontcolorbluefuncfontfontcolorbluemapfontschemaGroupVersionKindifcExecutorFactory" #.. "phase.ExecutorRegistry"
"phase.fontcolorbluefuncfonteventsEventProcessor" #.. "phase.ProcessorFunc"
"phase.<font color=blue>func</font>(*client) " #.. "phase.Option"
@enduml
```