Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions aks-node-controller/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,18 @@ type App struct {
eventLogger *helpers.EventLogger

// hotfixVersionPath overrides the default hotfix version file location for testing.
// It is also the path check-hotfix writes the resolved pointer to.
hotfixVersionPath string
// aptSourcesDir overrides the default APT sources directory for testing.
aptSourcesDir string
// nodeCustomDataPath overrides the default nodecustomdata path for testing.
nodeCustomDataPath string
// nodeConfigPath overrides the default AKSNodeConfig path for testing. It is the
// source for check-hotfix's apiserver credentials and cold-start fallback pointer.
nodeConfigPath string
// checkHotfixConfigMapFetcher overrides the real apiserver ConfigMap GET for testing,
// letting unit tests inject canned ConfigMap JSON or errors without real networking.
checkHotfixConfigMapFetcher func(ctx context.Context) ([]byte, error)
}

// provision.json values are emitted as strings by the shell jq invocation.
Expand Down Expand Up @@ -137,6 +144,16 @@ func (a *App) Run(ctx context.Context, args []string) int {
return a.runDownloadHotfixCommand(ctx)
},
},
{
Name: "check-hotfix",
Usage: "Read the anc-hotfix-version ConfigMap and stage the hotfix pointer (fail-open)",
Action: func(ctx context.Context, cmd *cli.Command) error {
if len(cmd.Args().Slice()) > 0 {
return fmt.Errorf("unexpected check-hotfix arguments: %s", strings.Join(cmd.Args().Slice(), " "))
}
return a.runCheckHotfixCommand(ctx)
},
},
},
}

Expand Down
Loading
Loading