Documentation ¶
Index ¶
- Constants
- type Common
- type RunningZone
- func (rz *RunningZone) Run(args []string) error
- func (rz *RunningZone) RunAnsiblePlaybook(args []string) error
- func (rz *RunningZone) RunHelm(args []string) error
- func (rz *RunningZone) WithAnsiblePlaybookTags(ansiblePlaybookTags []string)
- func (rz *RunningZone) WithPodComponents(podComponents map[string]string)
- func (rz *RunningZone) WithServerComponents(serverComponents map[string]string)
- func (rz *RunningZone) WithStartAtPlay(startAtPlay string)
- type Target
- type TargetVars
- type Zone
- func (zone *Zone) BuildInventory(hostsMap map[string][]string) error
- func (zone *Zone) Compute() error
- func (zone *Zone) Dump() error
- func (zone *Zone) GetK8SForComponent(componentName string) *cmdb.K8S
- func (zone *Zone) GetK8SForProduct() *cmdb.K8S
- func (zone *Zone) HandleCompatibity()
- func (zone *Zone) HelmDirOfComponent(componentName string) string
- func (zone *Zone) HelmDirOfProduct() string
- func (zone *Zone) Load() error
- func (zone *Zone) LoadHosts() error
- func (zone *Zone) LoadNew() error
- func (zone *Zone) LoadPlatforms() error
- func (zone *Zone) LoadTarget() error
- func (zone *Zone) ParseZoneMeta() (*ZoneMeta, error)
- func (zone *Zone) PatchActionHosts(groupName string, hostsPatch *ansible.ActionHosts)
- func (zone *Zone) PatchActionHostsMap(m map[string][]ansible.ActionHosts) error
- func (zone *Zone) PlaybookFile(playbookName string) string
- func (zone *Zone) PrepareHelm() error
- func (zone *Zone) PrepareHelmChart() error
- func (zone *Zone) PrepareHelmCharts() error
- func (zone *Zone) RenderComputed() error
- func (zone *Zone) RenderHosts() error
- func (zone *Zone) RenderPlatforms() error
- func (zone *Zone) RenderSailPlaybook() error
- func (zone *Zone) RenderVars() error
- func (zone *Zone) SetComponentVersion(componentName string, componentVersion string) error
- type ZoneMeta
Constants ¶
const ( SailMetaVarProduct = "_sail_product" SailMetaVarHelmMode = "_sail_helm_mode" SailHelmModeComponent = "component" SailHelmModeProduct = "product" SailPlaybookFile = ".sail.yaml" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RunningZone ¶
type RunningZone struct {
// contains filtered or unexported fields
}
func NewRunningZone ¶
func NewRunningZone(zone *Zone, playbookName string) *RunningZone
func (*RunningZone) Run ¶
func (rz *RunningZone) Run(args []string) error
func (*RunningZone) RunAnsiblePlaybook ¶
func (rz *RunningZone) RunAnsiblePlaybook(args []string) error
func (*RunningZone) RunHelm ¶
func (rz *RunningZone) RunHelm(args []string) error
func (*RunningZone) WithAnsiblePlaybookTags ¶
func (rz *RunningZone) WithAnsiblePlaybookTags(ansiblePlaybookTags []string)
func (*RunningZone) WithPodComponents ¶
func (rz *RunningZone) WithPodComponents(podComponents map[string]string)
func (*RunningZone) WithServerComponents ¶
func (rz *RunningZone) WithServerComponents(serverComponents map[string]string)
func (*RunningZone) WithStartAtPlay ¶
func (rz *RunningZone) WithStartAtPlay(startAtPlay string)
type Target ¶
type Target struct { Name string // contains filtered or unexported fields }
func (*Target) LoadAllZones ¶
type TargetVars ¶
type TargetVars struct {
Zones map[string]interface{}
}
func NewTargetVars ¶
func NewTargetVars() *TargetVars
type Zone ¶
type Zone struct { *ZoneMeta TargetName string ZoneName string TargetDir string ZoneDir string VarsFile string HostsFile string PlatformsFile string ComputedFile string ResourcesDir string HelmDir string Product *product.Product CMDB *cmdb.CMDB TargetVars *TargetVars // contains filtered or unexported fields }
func NewZone ¶
func NewZone(sailOption *models.SailOption, targetName string, zoneName string) *Zone
func (*Zone) GetK8SForComponent ¶
func (*Zone) GetK8SForProduct ¶
func (*Zone) HandleCompatibity ¶
func (zone *Zone) HandleCompatibity()
func (*Zone) HelmDirOfComponent ¶
HelmDirOfComponent returns the helm chart directory for specified component. It is used when the '_sail_helm_mode' is 'component'.
func (*Zone) HelmDirOfProduct ¶
HelmDirOfProduct returns the helm chart directory for the product of the zone. It is used when the '_sail_helm_mode' is 'product'.
func (*Zone) Load ¶
Load initialize the zone. The zone is supposed to be already exists. It will try to determine the product name from zone vars file.
func (*Zone) LoadNew ¶
LoadNew fill vars to zone. The zone is treated as a newly created zone. So it will ONLY load default varibles from product. This method is ONLY called when `conf-create`.
func (*Zone) LoadPlatforms ¶
func (*Zone) LoadTarget ¶
func (*Zone) ParseZoneMeta ¶
func (*Zone) PatchActionHosts ¶
func (zone *Zone) PatchActionHosts(groupName string, hostsPatch *ansible.ActionHosts)
func (*Zone) PatchActionHostsMap ¶
func (zone *Zone) PatchActionHostsMap(m map[string][]ansible.ActionHosts) error
func (*Zone) PlaybookFile ¶
func (*Zone) PrepareHelm ¶
PrepareHelm prepares helm chart(s) for zone.
func (*Zone) PrepareHelmChart ¶
PrepareHelmChart prepares helm chart for the product. There will be only one chart for the product. <target>/<zone>/helm/<productName>/{Chart.yaml,templates,values.yaml,...}
func (*Zone) PrepareHelmCharts ¶
PrepareHelmCharts prepares helm charts for each component of the product. Each component has its own helm chart. <target>/<zone>/helm/<componetName>/{Chart.yaml,templates,values.yaml,...}
func (*Zone) RenderComputed ¶
func (*Zone) RenderHosts ¶
func (*Zone) RenderPlatforms ¶
func (*Zone) RenderSailPlaybook ¶ added in v0.1.4
RenderSailPlaybook renders the default temporary ansible playbook file for the product of the zone.