Documentation
¶
Index ¶
Constants ¶
const ( KnownHostsConfigMap = "known-hosts" // XXX: is this the name we want? KnownHostsEnvVar = "FLEET_KNOWN_HOSTS" )
Variables ¶
This section is empty.
Functions ¶
func CreateKnownHostsCallBack ¶
func CreateKnownHostsCallBack(knownHosts []byte) (ssh.HostKeyCallback, error)
CreateKnownHostsCallBack creates a callback function for host key checks based on the provided knownHosts.
Types ¶
type KnownHosts ¶
type KnownHosts struct {
EnforceHostKeyChecks bool
}
func (KnownHosts) Get ¶
func (s KnownHosts) Get(ctx context.Context, c client.Client, ns string, secretName string) (string, error)
Get looks for SSH known hosts information in the following locations, in decreasing order of precedence: * secret referenced by secretName, in namespace ns * `gitcredential` secret, in namespace ns, if secretName is empty * config map in Fleet controller namespace It returns found known_hosts data, if any, and any error that may have happened in the process (eg. missing fallback, Fleet-wide known hosts config map) Possible returned errors include a failure to enforce strict host key checks, if those are enabled but no known_hosts data is found.
func (KnownHosts) GetWithSecret ¶
func (s KnownHosts) GetWithSecret(ctx context.Context, c client.Client, secret *corev1.Secret) (string, error)
GetWithSecret looks for SSH known hosts information in the injected secret, then in a config map in the Fleet controller namespace, returning data from the first source it finds. It returns found known_hosts data, if any, and any error that may have happened in the process (eg. missing fallback, Fleet-wide known hosts config map) Possible returned errors include a failure to enforce strict host key checks, if those are enabled but no known_hosts data is found.
func (KnownHosts) IsStrict ¶
func (s KnownHosts) IsStrict() bool