Documentation ¶
Index ¶
- Constants
- Variables
- func NeedRegistration(host *host.Host) (bool, error)
- func Register(name string, r *RegisteredRegistrator)
- func RegisterHostVM(host *host.Host, param *RegistrationParameters) (bool, error)
- func SetDetector(newDetector Detector)
- func UnregisterHostVM(host *host.Host, param *RegistrationParameters) (bool, error)
- type Detector
- type RedHatRegistrator
- func (registrator *RedHatRegistrator) CompatibleWithDistribution(osReleaseInfo *provision.OsRelease) bool
- func (registrator *RedHatRegistrator) IsRegistered() (bool, error)
- func (registrator *RedHatRegistrator) Register(param *RegistrationParameters) error
- func (registrator *RedHatRegistrator) Unregister(param *RegistrationParameters) error
- type RegisteredRegistrator
- type RegistrationHostActionFunc
- type RegistrationParameters
- type Registrator
- type StandardRegistrator
Constants ¶
View Source
const ( RHSMName = " Red Hat Developers or Red Hat Subscription Management (RHSM)" RedHatRegistry = "registry.redhat.io" )
Variables ¶
View Source
var (
ErrDetectionFailed = errors.New("Distribution type not recognized to Registration")
)
Functions ¶
func NeedRegistration ¶ added in v1.2.0
Detect supported Registrator
func Register ¶
func Register(name string, r *RegisteredRegistrator)
func RegisterHostVM ¶
func RegisterHostVM(host *host.Host, param *RegistrationParameters) (bool, error)
Register host VM
func SetDetector ¶
func SetDetector(newDetector Detector)
func UnregisterHostVM ¶
func UnregisterHostVM(host *host.Host, param *RegistrationParameters) (bool, error)
Unregister host VM
Types ¶
type Detector ¶
type Detector interface {
DetectRegistrator(c provision.SSHCommander) (Registrator, bool, error)
}
type RedHatRegistrator ¶
type RedHatRegistrator struct {
provision.SSHCommander
}
func (*RedHatRegistrator) CompatibleWithDistribution ¶
func (registrator *RedHatRegistrator) CompatibleWithDistribution(osReleaseInfo *provision.OsRelease) bool
CompatibleWithDistribution returns true if system supports registration with RHSM
func (*RedHatRegistrator) IsRegistered ¶ added in v1.21.0
func (registrator *RedHatRegistrator) IsRegistered() (bool, error)
isRegistered returns registration state of RHSM or errors when undetermined
func (*RedHatRegistrator) Register ¶
func (registrator *RedHatRegistrator) Register(param *RegistrationParameters) error
Register attempts to register the system with RHSM and registry.redhat.io
func (*RedHatRegistrator) Unregister ¶
func (registrator *RedHatRegistrator) Unregister(param *RegistrationParameters) error
Unregister attempts to unregister the system from RHSM
type RegisteredRegistrator ¶
type RegisteredRegistrator struct {
New func(c provision.SSHCommander) Registrator
}
RegisteredRegistrator creates a new registrator
type RegistrationHostActionFunc ¶ added in v1.4.0
type RegistrationHostActionFunc func(param *RegistrationParameters) error
type RegistrationParameters ¶
type RegistrationParameters struct { Username string Password string IsTtySupported bool GetUsernameInteractive func(message string) string GetPasswordInteractive func(message string) string GetPasswordKeyring func(username string) (string, error) SetPasswordKeyring func(username, password string) error }
type Registrator ¶
type Registrator interface { provision.SSHCommander // Register Register(param *RegistrationParameters) error // Return the auth options used to configure remote connection for the daemon. Unregister(param *RegistrationParameters) error // Figure out whether this is a matching registrar CompatibleWithDistribution(osReleaseInfo *provision.OsRelease) bool // Check if registered IsRegistered() (bool, error) }
Registration defines distribution specific actions
func DetectRegistrator ¶
func DetectRegistrator(c provision.SSHCommander) (Registrator, bool, error)
func NewRedHatRegistrator ¶
func NewRedHatRegistrator(c provision.SSHCommander) Registrator
type StandardRegistrator ¶
type StandardRegistrator struct{}
func (StandardRegistrator) DetectRegistrator ¶
func (detector StandardRegistrator) DetectRegistrator(c provision.SSHCommander) (Registrator, bool, error)
Click to show internal directories.
Click to hide internal directories.