Skip to content

API Reference

Install infctl command line tool:

Terminal window
curl -L https://codeberg.org/headshed/infctl-cli/raw/branch/main/install.sh | bash

Or download from Releases and place in your PATH.

infctl uses JSON files for configuration and is designed around pipelines that perform a series of steps.

Ensures a Kubernetes namespace exists.

Parameters:

  • namespace (string) - Name of the namespace

Example:

{
"name": "ensure inf namespace exists",
"function": "k8sNamespaceExists",
"params": ["infctl"],
"retryCount": 0,
"shouldAbort": true
}

Executes a shell command, script, or executable.

Parameters:

  • command (string) - Command, script path, or executable to run

Examples:

{
"name": "run setup script",
"function": "RunCommand",
"params": ["./scripts/create_php_configmap_ctl.sh"],
"retryCount": 0,
"shouldAbort": true
}
{
"name": "say hello",
"function": "RunCommand",
"params": ["echo 'hello world'"],
"retryCount": 0,
"shouldAbort": true
}
  • name - Human-readable description displayed in logs
  • function - Name of function registered within infctl
  • params - Array of string parameters passed to the function
  • retryCount - Number of times to retry if task fails (default: 0)
  • shouldAbort - Whether to stop pipeline if task fails (default: true)
  • Tasks execute in sequence
  • Task fails if script/command returns non-zero exit code
  • Failed tasks retry up to retryCount times
  • If shouldAbort is true and task fails, pipeline stops
  • If shouldAbort is false, pipeline continues to next task
  • Unlimited flexibility through RunCommand for any automation