Documentation
¶
Index ¶
- type AddonRepository
- type JoinClusterCall
- type RunCommandCall
- type Snap
- func (s *Snap) AddAddonsRepository(ctx context.Context, name, url, reference string, force bool) error
- func (s *Snap) AddCallbackToken(clusterAgentEndpoint string, token string) error
- func (s *Snap) AddCertificateRequestToken(token string) error
- func (s *Snap) AddPersistentClusterToken(token string) error
- func (s *Snap) ApplyCNI(_ context.Context) error
- func (s *Snap) ConsumeCertificateRequestToken(token string) bool
- func (s *Snap) ConsumeClusterToken(token string) bool
- func (s *Snap) ConsumeSelfCallbackToken(token string) bool
- func (s *Snap) CreateNoCertsReissueLock() error
- func (s *Snap) DisableAddon(_ context.Context, addon string, args ...string) error
- func (s *Snap) EnableAddon(_ context.Context, addon string, args ...string) error
- func (s *Snap) GetCAPIPath(parts ...string) string
- func (s *Snap) GetGroupName() string
- func (s *Snap) GetKnownToken(username string) (string, error)
- func (s *Snap) GetKubeconfigFile() string
- func (s *Snap) GetOrCreateKubeletToken(hostname string) (string, error)
- func (s *Snap) GetOrCreateSelfCallbackToken() (string, error)
- func (s *Snap) GetSnapCommonPath(parts ...string) string
- func (s *Snap) GetSnapDataPath(parts ...string) string
- func (s *Snap) GetSnapPath(parts ...string) string
- func (s *Snap) HasDqliteLock() bool
- func (s *Snap) HasKubeliteLock() bool
- func (s *Snap) HasNoCertsReissueLock() bool
- func (s *Snap) ImportImage(ctx context.Context, reader io.Reader) error
- func (s *Snap) IsCAPIAuthTokenValid(token string) (bool, error)
- func (s *Snap) JoinCluster(ctx context.Context, url string, worker bool) error
- func (s *Snap) ReadCA() (string, error)
- func (s *Snap) ReadCAKey() (string, error)
- func (s *Snap) ReadCNIYaml() (string, error)
- func (s *Snap) ReadDqliteCert() (string, error)
- func (s *Snap) ReadDqliteClusterYaml() (string, error)
- func (s *Snap) ReadDqliteInfoYaml() (string, error)
- func (s *Snap) ReadDqliteKey() (string, error)
- func (s *Snap) ReadEtcdCertificates() (string, string, string, error)
- func (s *Snap) ReadServiceAccountKey() (string, error)
- func (s *Snap) ReadServiceArguments(service string) (string, error)
- func (s *Snap) RestartService(_ context.Context, service string) error
- func (s *Snap) RunCommand(_ context.Context, commands ...string) error
- func (s *Snap) RunUpgrade(ctx context.Context, upgrade string, phase string) error
- func (s *Snap) SignCertificate(ctx context.Context, csrPEM []byte) ([]byte, error)
- func (s *Snap) UpdateContainerdRegistryConfigs(cfgs map[string][]byte) error
- func (s *Snap) WriteCNIYaml(b []byte) error
- func (s *Snap) WriteCSRConfig(b []byte) error
- func (s *Snap) WriteDqliteUpdateYaml(b []byte) error
- func (s *Snap) WriteServiceArguments(service string, b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddonRepository ¶
AddonRepository is a mock for the current state of an addon repository.
type JoinClusterCall ¶
JoinClusterCall is a mock for the join cluster call.
type RunCommandCall ¶
type RunCommandCall struct {
Commands []string
}
RunCommandCall contains the arguments passed to a specific call of the RunCommand method.
type Snap ¶
type Snap struct {
SnapDir string
SnapDataDir string
SnapCommonDir string
CAPIDir string
RunCommandCalledWith []RunCommandCall
RunCommandErr error
GroupName string
EnableAddonCalledWith []string
DisableAddonCalledWith []string
RestartServiceCalledWith []string
RunUpgradeCalledWith []string // "{upgrade} {phase}"
CA string
CAKey string
ServiceAccountKey string
CNIYaml string
WriteCNIYamlCalledWith [][]byte
ApplyCNICalled []struct{}
DqliteCert string
DqliteKey string
DqliteClusterYaml string
DqliteInfoYaml string
WriteDqliteUpdateYamlCalledWith []string
KubeconfigFile string
KubeliteLock bool
DqliteLock bool
NoCertsReissueLock bool
CreateNoCertsReissueLockCalledWith []struct{}
ServiceArguments map[string]string
WriteServiceArgumentsCalled bool
ClusterTokens []string
CertificateRequestTokens []string
SelfCallbackTokens []string
AddPersistentClusterTokenCalledWith []string
AddCertificateRequestTokenCalledWith []string
AddCallbackTokenCalledWith []string // "{clusterAgentEndpoint} {token}"
ConsumeClusterTokenCalledWith []string
ConsumeCertificateRequestTokenCalledWith []string
SelfCallbackToken string
KubeletTokens map[string]string // map hostname to token
KnownTokens map[string]string // map username to token
CAPIAuthTokenValid bool
CAPIAuthTokenError error
SignCertificateCalledWith []string // string(csrPEM)
SignedCertificate string
ImportImageCalledWith []string // string(io.ReadAll(reader))
CSRConfig string
ContainerdRegistryConfigs map[string]string // map registry name to hosts.toml contents
AddonRepositories map[string]AddonRepository
JoinClusterCalledWith []JoinClusterCall
EtcdCA, EtcdCert, EtcdKey string
}
Snap is a generic mock for the snap.Snap interface.
func (*Snap) AddAddonsRepository ¶
func (s *Snap) AddAddonsRepository(ctx context.Context, name, url, reference string, force bool) error
AddAddonsRepository is a mock implementation for the snap.Snap interface.
func (*Snap) AddCallbackToken ¶
AddCallbackToken is a mock implementation for the snap.Snap interface.
func (*Snap) AddCertificateRequestToken ¶
AddCertificateRequestToken is a mock implementation for the snap.Snap interface.
func (*Snap) AddPersistentClusterToken ¶
AddPersistentClusterToken is a mock implementation for the snap.Snap interface.
func (*Snap) ConsumeCertificateRequestToken ¶
ConsumeCertificateRequestToken is a mock implementation for the snap.Snap interface.
func (*Snap) ConsumeClusterToken ¶
ConsumeClusterToken is a mock implementation for the snap.Snap interface.
func (*Snap) ConsumeSelfCallbackToken ¶
ConsumeSelfCallbackToken is a mock implementation for the snap.Snap interface.
func (*Snap) CreateNoCertsReissueLock ¶
CreateNoCertsReissueLock is a mock implementation for the snap.Snap interface.
func (*Snap) DisableAddon ¶
DisableAddon is a mock implementation for the snap.Snap interface.
func (*Snap) EnableAddon ¶
EnableAddon is a mock implementation for the snap.Snap interface.
func (*Snap) GetCAPIPath ¶
GetCAPIPath is a mock implementation for the snap.Snap interface.
func (*Snap) GetGroupName ¶
GetGroupName is a mock implementation for the snap.Snap interface.
func (*Snap) GetKnownToken ¶
GetKnownToken is a mock implementation for the snap.Snap interface.
func (*Snap) GetKubeconfigFile ¶
GetKubeconfigFile is a mock implementation for the snap.Snap interface.
func (*Snap) GetOrCreateKubeletToken ¶
GetOrCreateKubeletToken is a mock implementation for the snap.Snap interface.
func (*Snap) GetOrCreateSelfCallbackToken ¶
GetOrCreateSelfCallbackToken is a mock implementation for the snap.Snap interface.
func (*Snap) GetSnapCommonPath ¶
GetSnapCommonPath is a mock implementation for the snap.Snap interface.
func (*Snap) GetSnapDataPath ¶
GetSnapDataPath is a mock implementation for the snap.Snap interface.
func (*Snap) GetSnapPath ¶
GetSnapPath is a mock implementation for the snap.Snap interface.
func (*Snap) HasDqliteLock ¶
HasDqliteLock is a mock implementation for the snap.Snap interface.
func (*Snap) HasKubeliteLock ¶
HasKubeliteLock is a mock implementation for the snap.Snap interface.
func (*Snap) HasNoCertsReissueLock ¶
HasNoCertsReissueLock is a mock implementation for the snap.Snap interface.
func (*Snap) ImportImage ¶
ImportImage is a mock implementation for the snap.Snap interface.
func (*Snap) IsCAPIAuthTokenValid ¶
IsCAPIAuthTokenValid is a mock implementation for the snap.Snap interface.
func (*Snap) JoinCluster ¶
JoinCluster is a mock implementation for the snap.Snap interface.
func (*Snap) ReadCNIYaml ¶
ReadCNIYaml is a mock implementation for the snap.Snap interface.
func (*Snap) ReadDqliteCert ¶
ReadDqliteCert is a mock implementation for the snap.Snap interface.
func (*Snap) ReadDqliteClusterYaml ¶
ReadDqliteClusterYaml is a mock implementation for the snap.Snap interface.
func (*Snap) ReadDqliteInfoYaml ¶
ReadDqliteInfoYaml is a mock implementation for the snap.Snap interface.
func (*Snap) ReadDqliteKey ¶
ReadDqliteKey is a mock implementation for the snap.Snap interface.
func (*Snap) ReadEtcdCertificates ¶
ReadEtcdCertificates is a mock implementation for the snap.Snap interface.
func (*Snap) ReadServiceAccountKey ¶
ReadServiceAccountKey is a mock implementation for the snap.Snap interface.
func (*Snap) ReadServiceArguments ¶
ReadServiceArguments is a mock implementation for the snap.Snap interface.
func (*Snap) RestartService ¶
RestartService is a mock implementation for the snap.Snap interface.
func (*Snap) RunCommand ¶
RunCommand is a mock implementation for the snap.Snap interface.
func (*Snap) RunUpgrade ¶
RunUpgrade is a mock implementation for the snap.Snap interface.
func (*Snap) SignCertificate ¶
SignCertificate is a mock implementation for the snap.Snap interface.
func (*Snap) UpdateContainerdRegistryConfigs ¶
UpdateContainerdRegistryConfigs is a mock implementation for the snap.Snap interface.
func (*Snap) WriteCNIYaml ¶
WriteCNIYaml is a mock implementation for the snap.Snap interface.
func (*Snap) WriteCSRConfig ¶
WriteCSRConfig is a mock implementation for the snap.Snap interface.
func (*Snap) WriteDqliteUpdateYaml ¶
WriteDqliteUpdateYaml is a mock implementation for the snap.Snap interface.