Documentation
¶
Index ¶
- Constants
- func ToState(v interface{}) plan.State
- func WithoutProxy(script string) string
- type Base
- type Deb
- func (d *Deb) Apply(ctx context.Context, runner plan.Runner, diff plan.Diff) (propagate bool, err error)
- func (d *Deb) QueryState(ctx context.Context, runner plan.Runner) (plan.State, error)
- func (d *Deb) State() plan.State
- func (d *Deb) Undo(ctx context.Context, runner plan.Runner, current plan.State) error
- func (d *Deb) WouldChangeState(ctx context.Context, r plan.Runner) (bool, error)
- type Dir
- type File
- type GatherFactFunc
- type KubeSecret
- func (ks *KubeSecret) Apply(ctx context.Context, runner plan.Runner, diff plan.Diff) (bool, error)
- func (ks *KubeSecret) QueryState(ctx context.Context, runner plan.Runner) (plan.State, error)
- func (ks *KubeSecret) State() plan.State
- func (ks *KubeSecret) Undo(ctx context.Context, runner plan.Runner, current plan.State) error
- type KubeadmJoin
- type OS
- func (p *OS) Apply(ctx context.Context, r plan.Runner, _ plan.Diff) (bool, error)
- func (p *OS) GetSELinuxStatus(ctx context.Context) (SELinuxStatus, SELinuxMode, error)
- func (p *OS) HasCommand(ctx context.Context, cmd string) (bool, error)
- func (p *OS) IsOSInContainerVM(ctx context.Context) (bool, error)
- func (p *OS) IsSELinuxMode(ctx context.Context, mode string) (bool, error)
- func (p *OS) QueryState(ctx context.Context, r plan.Runner) (plan.State, error)
- func (p *OS) State() plan.State
- func (p *OS) Undo(ctx context.Context, r plan.Runner, current plan.State) error
- type PkgType
- type RPM
- func (p *RPM) Apply(ctx context.Context, r plan.Runner, diff plan.Diff) (bool, error)
- func (p *RPM) QueryState(ctx context.Context, r plan.Runner) (plan.State, error)
- func (p *RPM) State() plan.State
- func (p *RPM) Undo(ctx context.Context, r plan.Runner, current plan.State) error
- func (p *RPM) WouldChangeState(ctx context.Context, r plan.Runner) (bool, error)
- type Run
- type SELinuxMode
- type SELinuxStatus
- type SecretData
- type Service
Constants ¶
const ( // ServiceInactive is a non-started service. ServiceInactive = "inactive" // ServiceActivating is a starting service. ServiceActivating = "activating" // ServiceActive is a started service. ServiceActive = "active" // ServiceFailed is a service that failed to start ServiceFailed = "failed" )
Variables ¶
This section is empty.
Functions ¶
func WithoutProxy ¶
Types ¶
type Base ¶
type Base struct{}
Base can be embedded into a struct to provide a default implementation of plan.Resource.
func (*Base) QueryState ¶
QueryState implements plan.Resource.
type Deb ¶
type Deb struct { Name string `structs:"name"` // Suffix is either "=" followed by the version, or "/" followed by the release stream (stable|testing|unstable). // Examples: // Name: "busybox" // Name: "busybox", Suffix: "/stable" // Name: "busybox", Suffix: "=1:1.27.2-2ubuntu3.2" Suffix string `structs:"suffix"` }
Deb represents a .deb package.
func DebResourceFromPackage ¶
func DebResourceFromPackage(p debPkgInfo) *Deb
func (*Deb) QueryState ¶
type Dir ¶
type Dir struct { // Path at which to create directory Path fmt.Stringer `structs:"path,omitempty"` // RecursiveDelete makes the undo operation recursive RecursiveDelete bool }
Dir represents a directory on the file system.
func (*Dir) QueryState ¶
QueryState implements plan.Resource.
type File ¶
type File struct { // Source is a path to a local file. Only of of (Source, Content) can be // specified at once. Source string `structs:"source,omitempty"` // Content is the file content. Only of of (Source, Content) can be specified // at once. Content string `structs:"content,omitempty"` // Destination is the file destination path (required). Destination string `structs:"destination"` // File MD5 checksum. We use md5sum as it's part of coreutils and even part of // the default alpine image. Checksum string `structs:"checksum" plan:"hide"` }
File represents a file on the file system.
func (*File) QueryState ¶
QueryState implements plan.Resource.
type KubeSecret ¶
type KubeSecret struct { Base // SecretName is the name of the secret to read SecretName string `structs:"secretName"` // Checksum contains the sha256 checksum of the secret data Checksum [sha256.Size]byte `structs:"checksum"` // DestinationDirectory is the location in which to write stored file data DestinationDirectory string `structs:"destinationDirectory"` // SecretData holds the actual secret contents -- not serialized SecretData SecretData `structs:"-" plan:"hide"` // FileNameTransform transforms a secret key into the file name for its contents FileNameTransform func(string) string }
KubeSecret writes secrets to the filesystem where they can be picked up by daemons
func NewKubeSecretResource ¶
func NewKubeSecretResource(secretName string, secretData SecretData, destinationDirectory string, fileNameTransform func(string) string) (*KubeSecret, error)
NewKubeSecretResource creates a new object from secret data
func (*KubeSecret) QueryState ¶
type KubeadmJoin ¶
type KubeadmJoin struct { Base // IsMaster should be true if this node should join as a master, or false otherwise. IsMaster bool `structs:"isMaster"` // NodeIP is the IP of the node trying to join the cluster. NodeIP string `structs:"nodeIP"` // NodeName, if non-empty, will override the default node name guessed by kubeadm. NodeName string // MasterIP is the IP of the master node to connect to in order to join the cluster -- // hidden because the value can change in multi-master configurations but should not make the node plan // appear to have changed. MasterIP string `structs:"masterIP" plan:"hide"` // MasterPort is the port of the master node to connect to in order to join the cluster. MasterPort int `structs:"masterPort"` // Token is used to authenticate with the Kubernetes API server. Token string `structs:"token" plan:"hide"` // DiscoveryTokenCaCertHash is used to validate that the root CA public key of the cluster we are trying to join matches. DiscoveryTokenCaCertHash string `structs:"discoveryTokenCaCertHash" plan:"hide"` // CertificateKey is used to add master nodes to the cluster. CertificateKey string `structs:"certificateKey" plan:"hide"` // IgnorePreflightErrors is optionally used to skip kubeadm's preflight checks. IgnorePreflightErrors []string `structs:"ignorePreflightErrors"` // External Load Balancer name or IP address to be used instead of the master's IP ControlPlaneEndpoint string `structs:"controlPlaneEndpoint"` // Kubernetes Version is used to prepare different parameters KubernetesVersion string `structs:"version"` }
KubeadmJoin represents an attempt to join a Kubernetes node via kubeadm.
func (*KubeadmJoin) Apply ¶
Apply implements plan.Resource. TODO: find a way to make this idempotent. TODO: should such a resource be splitted in smaller resources?
func (*KubeadmJoin) State ¶
func (kj *KubeadmJoin) State() plan.State
State implements plan.Resource.
type OS ¶
type OS struct { MachineID string `structs:"MachineID"` SystemUUID string `structs:"SystemUUID"` // contains filtered or unexported fields }
OS is a set of OS properties.
func (*OS) GetSELinuxStatus ¶
func (p *OS) GetSELinuxStatus(ctx context.Context) (SELinuxStatus, SELinuxMode, error)
func (*OS) IsSELinuxMode ¶
func (*OS) QueryState ¶
QueryState implements plan.Resource.
type RPM ¶
type RPM struct { Name string `structs:"name"` // Version is optional Version string `structs:"version,omitempty"` Release string `structs:"release,omitempty"` IgnoreOtherVersions bool `structs:"ignoreOtherVersions,omitempty"` DisableExcludes string `structs:"disableExcludes,omitempty"` }
RPM represents an RPM package.
It isn't legal to provide a Release if no Version is specified. TODO: What about epoch?
func (*RPM) QueryState ¶
QueryState implements plan.Resource.
type Run ¶
type Run struct { Base Script fmt.Stringer `structs:"script"` UndoScript fmt.Stringer `structs:"undoScript,omitempty"` UndoResource plan.Resource `structs:"undoResource,omitempty"` Output *string // for later resources to use }
Run is a resource running a script (which can be just a single command). Run doesn't realise any state, Apply will always run the given script.
type SELinuxMode ¶
type SELinuxMode int
const ( SELinuxModeUnknown SELinuxMode = iota SELinuxEnforcing SELinuxPermissive SELinuxDisabled )
func (SELinuxMode) IsDisabled ¶
func (m SELinuxMode) IsDisabled() bool
func (SELinuxMode) IsEnforcing ¶
func (m SELinuxMode) IsEnforcing() bool
func (SELinuxMode) IsPermissive ¶
func (m SELinuxMode) IsPermissive() bool
func (SELinuxMode) IsUnknown ¶
func (m SELinuxMode) IsUnknown() bool
type SELinuxStatus ¶
type SELinuxStatus int
const ( SELinuxUnknown SELinuxStatus = iota SELinuxNotInstalled SELinuxInstalled )
func (SELinuxStatus) IsInstalled ¶
func (s SELinuxStatus) IsInstalled() bool
func (SELinuxStatus) IsNotInstalled ¶
func (s SELinuxStatus) IsNotInstalled() bool
func (SELinuxStatus) IsUnknown ¶
func (s SELinuxStatus) IsUnknown() bool
type SecretData ¶
SecretData maps names to values as in Kubernetes v1.Secret
type Service ¶
type Service struct { // Name of the systemd unit. Name string `structs:"name"` // Status is the desired service status. Only "active" or "inactive" are valid // input. Status string `structs:"status"` // Whether the service is enabled (systemctl enable) or not. Enabled bool `structs:"enabled"` }
Service represents a systemd service.
func (*Service) QueryState ¶
QueryState implements plan.Resource.