feat: add host actions, lifecycle hooks and operational tools
Test / test (push) Successful in 4m4s
Release / release (push) Successful in 7m39s

This commit is contained in:
Sebastian Unterschütz committed 2026-11-18 10:41:36 +01:00
1 parent 8d4915543e
commit e5bde9c61f
32 files changed
+2083 -64

No files matched your search

+12
View File
@@ -165,6 +165,15 @@ func BuildAliasEntries(entries []cache.Entry, cfg config.Config) []AliasEntry {
// Build from the final SSH aliases, preserving per-instance prefix and
// collision handling. Never replace an existing SSH or command alias.
hostAliases := append([]AliasEntry(nil), out...)
hostMetadata := map[string]config.SSHHost{}
for _, e := range entries {
instance, hostname, ok := strings.Cut(e.Name, "/")
if !ok {
hostname = instance
instance = ""
}
hostMetadata[e.Name] = config.SSHHost{Instance: instance, Name: hostname, Kind: e.Kind, Tags: e.Tags}
}
var commands []string
for name := range cfg.Commands {
commands = append(commands, name)
@@ -181,6 +190,9 @@ func BuildAliasEntries(entries []cache.Entry, cfg config.Config) []AliasEntry {
if host.Host == "" {
continue
}
if !cfg.Commands[name].Allowed(hostMetadata[host.Host]) {
continue
}
alias := prefix + host.Name
commandCounts[alias]++
candidatesForCommands = append(candidatesForCommands, AliasEntry{Name: alias, Host: host.Host, Command: name})