Documentation ¶
Index ¶
- Variables
- func ConfigureAuth(p Provisioner) error
- func Register(name string, p *RegisteredProvisioner)
- func SetDetector(newDetector Detector)
- func WaitForPodman(p Provisioner) error
- type Boot2PodmanProvisioner
- func (provisioner *Boot2PodmanProvisioner) CompatibleWithHost() bool
- func (provisioner *Boot2PodmanProvisioner) GenerateEngineOptions() (*EngineOptions, error)
- func (provisioner *Boot2PodmanProvisioner) GetAuthOptions() auth.Options
- func (provisioner *Boot2PodmanProvisioner) GetDriver() drivers.Driver
- func (provisioner *Boot2PodmanProvisioner) GetEngineOptionsDir() string
- func (provisioner *Boot2PodmanProvisioner) GetOsReleaseInfo() (*OsRelease, error)
- func (provisioner *Boot2PodmanProvisioner) Hostname() (string, error)
- func (provisioner *Boot2PodmanProvisioner) Package(name string, action pkgaction.PackageAction) error
- func (provisioner *Boot2PodmanProvisioner) Provision(authOptions auth.Options, engineOptions engine.Options) error
- func (provisioner *Boot2PodmanProvisioner) SSHCommand(args string) (string, error)
- func (provisioner *Boot2PodmanProvisioner) Service(name string, action serviceaction.ServiceAction) error
- func (provisioner *Boot2PodmanProvisioner) SetHostname(hostname string) error
- func (provisioner *Boot2PodmanProvisioner) SetOsReleaseInfo(info *OsRelease)
- func (provisioner *Boot2PodmanProvisioner) String() string
- type CentosProvisioner
- type Detector
- type EngineConfigContext
- type EngineOptions
- type ErrDaemonAvailable
- type FakeDetector
- type FakeProvisioner
- func (fp *FakeProvisioner) CompatibleWithHost() bool
- func (fp *FakeProvisioner) GenerateEngineOptions() (*EngineOptions, error)
- func (fp *FakeProvisioner) GetAuthOptions() auth.Options
- func (fp *FakeProvisioner) GetDriver() drivers.Driver
- func (fp *FakeProvisioner) GetEngineOptionsDir() string
- func (fp *FakeProvisioner) GetOsReleaseInfo() (*OsRelease, error)
- func (fp *FakeProvisioner) Hostname() (string, error)
- func (fp *FakeProvisioner) Package(name string, action pkgaction.PackageAction) error
- func (fp *FakeProvisioner) Provision(authOptions auth.Options, engineOptions engine.Options) error
- func (fp *FakeProvisioner) SSHCommand(args string) (string, error)
- func (fp *FakeProvisioner) Service(name string, action serviceaction.ServiceAction) error
- func (fp *FakeProvisioner) SetHostname(hostname string) error
- func (fp *FakeProvisioner) SetOsReleaseInfo(info *OsRelease)
- func (fp *FakeProvisioner) String() string
- type FedoraProvisioner
- type GenericProvisioner
- func (provisioner *GenericProvisioner) CompatibleWithHost() bool
- func (provisioner *GenericProvisioner) GenerateEngineOptions() (*EngineOptions, error)
- func (provisioner *GenericProvisioner) GetAuthOptions() auth.Options
- func (provisioner *GenericProvisioner) GetDriver() drivers.Driver
- func (provisioner *GenericProvisioner) GetEngineOptionsDir() string
- func (provisioner *GenericProvisioner) GetOsReleaseInfo() (*OsRelease, error)
- func (provisioner *GenericProvisioner) Hostname() (string, error)
- func (provisioner *GenericProvisioner) SetHostname(hostname string) error
- func (provisioner *GenericProvisioner) SetOsReleaseInfo(info *OsRelease)
- type GenericSSHCommander
- type NetstatProvisioner
- type OsRelease
- type PackageListInfo
- type Provisioner
- func DetectProvisioner(d drivers.Driver) (Provisioner, error)
- func NewBoot2PodmanProvisioner(d drivers.Driver) Provisioner
- func NewCentosProvisioner(d drivers.Driver) Provisioner
- func NewFakeProvisioner(d drivers.Driver) Provisioner
- func NewFedoraProvisioner(d drivers.Driver) Provisioner
- func NewNetstatProvisioner() Provisioner
- type RedHatProvisioner
- func (provisioner *RedHatProvisioner) GenerateEngineOptions() (*EngineOptions, error)
- func (provisioner *RedHatProvisioner) Package(name string, action pkgaction.PackageAction) error
- func (provisioner *RedHatProvisioner) Provision(authOptions auth.Options, engineOptions engine.Options) error
- func (provisioner *RedHatProvisioner) SetHostname(hostname string) error
- func (provisioner *RedHatProvisioner) String() string
- type RedHatSSHCommander
- type RegisteredProvisioner
- type SSHCommander
- type StandardDetector
- type SystemdProvisioner
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDetectionFailed = errors.New("OS type not recognized")
)
View Source
var (
ErrUnknownYumOsRelease = errors.New("unknown OS for Yum repository")
)
Functions ¶
func ConfigureAuth ¶
func ConfigureAuth(p Provisioner) error
func Register ¶
func Register(name string, p *RegisteredProvisioner)
func SetDetector ¶
func SetDetector(newDetector Detector)
func WaitForPodman ¶
func WaitForPodman(p Provisioner) error
Types ¶
type Boot2PodmanProvisioner ¶
type Boot2PodmanProvisioner struct { OsReleaseInfo *OsRelease Driver drivers.Driver AuthOptions auth.Options EngineOptions engine.Options }
func (*Boot2PodmanProvisioner) CompatibleWithHost ¶
func (provisioner *Boot2PodmanProvisioner) CompatibleWithHost() bool
func (*Boot2PodmanProvisioner) GenerateEngineOptions ¶
func (provisioner *Boot2PodmanProvisioner) GenerateEngineOptions() (*EngineOptions, error)
func (*Boot2PodmanProvisioner) GetAuthOptions ¶
func (provisioner *Boot2PodmanProvisioner) GetAuthOptions() auth.Options
func (*Boot2PodmanProvisioner) GetDriver ¶
func (provisioner *Boot2PodmanProvisioner) GetDriver() drivers.Driver
func (*Boot2PodmanProvisioner) GetEngineOptionsDir ¶
func (provisioner *Boot2PodmanProvisioner) GetEngineOptionsDir() string
func (*Boot2PodmanProvisioner) GetOsReleaseInfo ¶
func (provisioner *Boot2PodmanProvisioner) GetOsReleaseInfo() (*OsRelease, error)
func (*Boot2PodmanProvisioner) Hostname ¶
func (provisioner *Boot2PodmanProvisioner) Hostname() (string, error)
func (*Boot2PodmanProvisioner) Package ¶
func (provisioner *Boot2PodmanProvisioner) Package(name string, action pkgaction.PackageAction) error
func (*Boot2PodmanProvisioner) SSHCommand ¶
func (provisioner *Boot2PodmanProvisioner) SSHCommand(args string) (string, error)
func (*Boot2PodmanProvisioner) Service ¶
func (provisioner *Boot2PodmanProvisioner) Service(name string, action serviceaction.ServiceAction) error
func (*Boot2PodmanProvisioner) SetHostname ¶
func (provisioner *Boot2PodmanProvisioner) SetHostname(hostname string) error
func (*Boot2PodmanProvisioner) SetOsReleaseInfo ¶
func (provisioner *Boot2PodmanProvisioner) SetOsReleaseInfo(info *OsRelease)
func (*Boot2PodmanProvisioner) String ¶
func (provisioner *Boot2PodmanProvisioner) String() string
type CentosProvisioner ¶
type CentosProvisioner struct {
*RedHatProvisioner
}
func (*CentosProvisioner) String ¶
func (provisioner *CentosProvisioner) String() string
type Detector ¶
type Detector interface {
DetectProvisioner(d drivers.Driver) (Provisioner, error)
}
type EngineConfigContext ¶
type EngineOptions ¶
type ErrDaemonAvailable ¶
type ErrDaemonAvailable struct {
// contains filtered or unexported fields
}
func NewErrDaemonAvailable ¶
func NewErrDaemonAvailable(err error) ErrDaemonAvailable
func (ErrDaemonAvailable) Error ¶
func (e ErrDaemonAvailable) Error() string
type FakeDetector ¶
type FakeDetector struct {
Provisioner
}
func (*FakeDetector) DetectProvisioner ¶
func (fd *FakeDetector) DetectProvisioner(d drivers.Driver) (Provisioner, error)
type FakeProvisioner ¶
type FakeProvisioner struct{}
func (*FakeProvisioner) CompatibleWithHost ¶
func (fp *FakeProvisioner) CompatibleWithHost() bool
func (*FakeProvisioner) GenerateEngineOptions ¶
func (fp *FakeProvisioner) GenerateEngineOptions() (*EngineOptions, error)
func (*FakeProvisioner) GetAuthOptions ¶
func (fp *FakeProvisioner) GetAuthOptions() auth.Options
func (*FakeProvisioner) GetDriver ¶
func (fp *FakeProvisioner) GetDriver() drivers.Driver
func (*FakeProvisioner) GetEngineOptionsDir ¶
func (fp *FakeProvisioner) GetEngineOptionsDir() string
func (*FakeProvisioner) GetOsReleaseInfo ¶
func (fp *FakeProvisioner) GetOsReleaseInfo() (*OsRelease, error)
func (*FakeProvisioner) Hostname ¶
func (fp *FakeProvisioner) Hostname() (string, error)
func (*FakeProvisioner) Package ¶
func (fp *FakeProvisioner) Package(name string, action pkgaction.PackageAction) error
func (*FakeProvisioner) SSHCommand ¶
func (fp *FakeProvisioner) SSHCommand(args string) (string, error)
func (*FakeProvisioner) Service ¶
func (fp *FakeProvisioner) Service(name string, action serviceaction.ServiceAction) error
func (*FakeProvisioner) SetHostname ¶
func (fp *FakeProvisioner) SetHostname(hostname string) error
func (*FakeProvisioner) SetOsReleaseInfo ¶
func (fp *FakeProvisioner) SetOsReleaseInfo(info *OsRelease)
func (*FakeProvisioner) String ¶
func (fp *FakeProvisioner) String() string
type FedoraProvisioner ¶
type FedoraProvisioner struct {
*RedHatProvisioner
}
func (*FedoraProvisioner) String ¶
func (provisioner *FedoraProvisioner) String() string
type GenericProvisioner ¶
type GenericProvisioner struct { SSHCommander OsReleaseID string EngineOptionsDir string DaemonOptionsFile string Packages []string OsReleaseInfo *OsRelease Driver drivers.Driver AuthOptions auth.Options EngineOptions engine.Options }
func (*GenericProvisioner) CompatibleWithHost ¶
func (provisioner *GenericProvisioner) CompatibleWithHost() bool
func (*GenericProvisioner) GenerateEngineOptions ¶
func (provisioner *GenericProvisioner) GenerateEngineOptions() (*EngineOptions, error)
func (*GenericProvisioner) GetAuthOptions ¶
func (provisioner *GenericProvisioner) GetAuthOptions() auth.Options
func (*GenericProvisioner) GetDriver ¶
func (provisioner *GenericProvisioner) GetDriver() drivers.Driver
func (*GenericProvisioner) GetEngineOptionsDir ¶
func (provisioner *GenericProvisioner) GetEngineOptionsDir() string
func (*GenericProvisioner) GetOsReleaseInfo ¶
func (provisioner *GenericProvisioner) GetOsReleaseInfo() (*OsRelease, error)
func (*GenericProvisioner) Hostname ¶
func (provisioner *GenericProvisioner) Hostname() (string, error)
func (*GenericProvisioner) SetHostname ¶
func (provisioner *GenericProvisioner) SetHostname(hostname string) error
func (*GenericProvisioner) SetOsReleaseInfo ¶
func (provisioner *GenericProvisioner) SetOsReleaseInfo(info *OsRelease)
type GenericSSHCommander ¶
func (GenericSSHCommander) SSHCommand ¶
func (sshCmder GenericSSHCommander) SSHCommand(args string) (string, error)
type NetstatProvisioner ¶
type NetstatProvisioner struct {
*FakeProvisioner
}
func (*NetstatProvisioner) SSHCommand ¶
func (p *NetstatProvisioner) SSHCommand(args string) (string, error)
type OsRelease ¶
type OsRelease struct { AnsiColor string `osr:"ANSI_COLOR"` Name string `osr:"NAME"` Version string `osr:"VERSION"` Variant string `osr:"VARIANT"` VariantID string `osr:"VARIANT_ID"` ID string `osr:"ID"` IDLike string `osr:"ID_LIKE"` PrettyName string `osr:"PRETTY_NAME"` VersionID string `osr:"VERSION_ID"` HomeURL string `osr:"HOME_URL"` SupportURL string `osr:"SUPPORT_URL"` BugReportURL string `osr:"BUG_REPORT_URL"` }
OsRelease reflects values in /etc/os-release Values in this struct must always be string or the reflection will not work properly.
func NewOsRelease ¶
func (*OsRelease) ParseOsRelease ¶
type PackageListInfo ¶
type Provisioner ¶
type Provisioner interface { fmt.Stringer SSHCommander // Create the files for the daemon to consume configuration settings (return struct of content and path) GenerateEngineOptions() (*EngineOptions, error) // Get the directory where the settings files for engine are to be found GetEngineOptionsDir() string // Return the auth options used to configure remote connection for the daemon. GetAuthOptions() auth.Options // Run a package action e.g. install Package(name string, action pkgaction.PackageAction) error // Get Hostname Hostname() (string, error) // Set hostname SetHostname(hostname string) error // Figure out if this is the right provisioner to use based on /etc/os-release info CompatibleWithHost() bool // Do the actual provisioning piece: // 1. Set the hostname on the instance. // 2. Install engine if it is not present. // 3. Configure the daemon to accept connections over TLS. // 4. Copy the needed certificates to the server and local config dir. Provision(authOptions auth.Options, engineOptions engine.Options) error // Perform action on a named service e.g. stop Service(name string, action serviceaction.ServiceAction) error // Get the driver which is contained in the provisioner. GetDriver() drivers.Driver // Set the OS Release info depending on how it's represented // internally SetOsReleaseInfo(info *OsRelease) // Get the OS Release info for the current provisioner GetOsReleaseInfo() (*OsRelease, error) }
Provisioner defines distribution specific actions
func DetectProvisioner ¶
func DetectProvisioner(d drivers.Driver) (Provisioner, error)
func NewBoot2PodmanProvisioner ¶
func NewBoot2PodmanProvisioner(d drivers.Driver) Provisioner
func NewCentosProvisioner ¶
func NewCentosProvisioner(d drivers.Driver) Provisioner
func NewFakeProvisioner ¶
func NewFakeProvisioner(d drivers.Driver) Provisioner
func NewFedoraProvisioner ¶
func NewFedoraProvisioner(d drivers.Driver) Provisioner
func NewNetstatProvisioner ¶
func NewNetstatProvisioner() Provisioner
type RedHatProvisioner ¶
type RedHatProvisioner struct {
SystemdProvisioner
}
func NewRedHatProvisioner ¶
func NewRedHatProvisioner(osReleaseID string, d drivers.Driver) *RedHatProvisioner
func (*RedHatProvisioner) GenerateEngineOptions ¶
func (provisioner *RedHatProvisioner) GenerateEngineOptions() (*EngineOptions, error)
func (*RedHatProvisioner) Package ¶
func (provisioner *RedHatProvisioner) Package(name string, action pkgaction.PackageAction) error
func (*RedHatProvisioner) SetHostname ¶
func (provisioner *RedHatProvisioner) SetHostname(hostname string) error
func (*RedHatProvisioner) String ¶
func (provisioner *RedHatProvisioner) String() string
type RedHatSSHCommander ¶
func (RedHatSSHCommander) SSHCommand ¶
func (sshCmder RedHatSSHCommander) SSHCommand(args string) (string, error)
type RegisteredProvisioner ¶
type RegisteredProvisioner struct {
New func(d drivers.Driver) Provisioner
}
RegisteredProvisioner creates a new provisioner
type SSHCommander ¶
type StandardDetector ¶
type StandardDetector struct{}
func (StandardDetector) DetectProvisioner ¶
func (detector StandardDetector) DetectProvisioner(d drivers.Driver) (Provisioner, error)
type SystemdProvisioner ¶
type SystemdProvisioner struct {
GenericProvisioner
}
func NewSystemdProvisioner ¶
func NewSystemdProvisioner(osReleaseID string, d drivers.Driver) SystemdProvisioner
func (*SystemdProvisioner) GenerateEngineOptions ¶
func (p *SystemdProvisioner) GenerateEngineOptions() (*EngineOptions, error)
func (*SystemdProvisioner) Service ¶
func (p *SystemdProvisioner) Service(name string, action serviceaction.ServiceAction) error
func (*SystemdProvisioner) String ¶
func (p *SystemdProvisioner) String() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package provisiontest provides utilities for testing provisioners
|
Package provisiontest provides utilities for testing provisioners |
Click to show internal directories.
Click to hide internal directories.