Documentation
¶
Overview ¶
Package setup checks and readies a researcher's laptop for Nautilus: kubectl, the kubelogin plugin, the NRP kubeconfig and sign-in. Checks are read-only. Fixes download the official release binaries into a user folder (no admin rights), verify their published SHA256, and never overwrite anything without a backup.
Index ¶
Constants ¶
const ( OK = "ok" Missing = "missing" Old = "update" Problem = "problem" Manual = "manual" Note = "note" // advisory; does not block "ready" )
Status of one check.
const ( NRPServerHint = "nrp-nautilus.io" NRPConfigURL = "https://nrp.ai/config" KubectlBase = "https://dl.k8s.io/release" KubeloginBase = "https://github.com/int128/kubelogin/releases/download" KubeloginTag = "v1.36.4" )
Defaults for the NRP.
Variables ¶
var KubeloginSHA256 = map[string]string{
"darwin/amd64": "7927b10c122b55dd4d9632f75d56752bfdc5f7b6ad3104615115c02f5f55e4f0",
"darwin/arm64": "5aa470d059a9672d732439474678ac05a0de5623ad3af54966b8fe1ac7df4254",
"linux/amd64": "9e8baeb4905d35a301304af2548324997add512fe94ab20e65993d167212bf85",
"linux/arm64": "669c2d3bcc6766351ad5a7b03971792b4e7a55117b335a12d9858d43a525d9dc",
"linux/arm": "ef21aa5d6697f830459fe1fbea3bfbca7aa3ae82f5b0e8751e788d2321d2e504",
"linux/ppc64le": "def4768b5b0fb184a727b7c5f42e6cf235f564819fa3474f3f8e314fec0bc0e1",
"windows/amd64": "a68be8ff153a7d3df1de19f272a9879164f55b8bb39298859d0e20c9e2c414ad",
"windows/arm64": "6a8f92078f974e3229c26249ef26f2b761aa01c664e3e664c3496a1d96b8545e",
}
KubeloginSHA256 embeds the SHA-256 digests of the official int128/kubelogin release archives for KubeloginTag, verified at build time against the upstream release.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
ID string `json:"id"`
Title string `json:"title"`
Status string `json:"status"`
Detail string `json:"detail"`
Fix string `json:"fix,omitempty"`
Auto bool `json:"can_fix_automatically"`
}
Check is one line of the readiness report.
type Env ¶
type Env struct {
GOOS, GOARCH string
Home string
Kubeconfig string // empty: $KUBECONFIG or ~/.kube/config
Context string // kubeconfig context to check (default nautilus)
BinDir string // where fixes install binaries
Kubectl string // configured kubectl (name or path)
PathEnv string
HTTP func(ctx context.Context, url string) ([]byte, error)
Run func(ctx context.Context, name string, args ...string) ([]byte, error)
LookPath func(string) (string, error)
Now func() time.Time
Downloads []string // folders to look for a downloaded NRP config
Redirect func(ctx context.Context, url string) (string, error) // nil: real HEAD request
// contains filtered or unexported fields
}
Env holds everything Setup touches, so tests can fake it.
func DefaultEnv ¶
DefaultEnv builds an Env for this machine.
type Report ¶
type Report struct {
Summary string `json:"summary"`
Ready bool `json:"ready"`
OS string `json:"os"`
BinDir string `json:"bin_dir"`
Checks []Check `json:"checks"`
Actions []string `json:"actions,omitempty"`
Next string `json:"next"`
PathHint string `json:"path_hint,omitempty"`
}
Report is the result of Check or Fix.