Documentation
¶
Index ¶
- Constants
- func Execute()
- func GenerateFilename(pattern string, info FileInfo) (string, error)
- func ShowFullPreview(result RenderResult)
- func WriteResults(results []RenderResult, config OutputConfig) error
- func WriteSingleResult(templateName, resourceName, content string, config OutputConfig) error
- type ChangeConfig
- type DeleteConfig
- type DeleteResult
- type DeleteXRConfig
- type EncryptConfig
- type EncryptResult
- type FileInfo
- type GitConfig
- type MergeConfig
- type OutputConfig
- type PRConfig
- type RenderConfig
- type RenderResult
- type RenderResults
- type ReviewAction
- type SecretRenderResult
- type TemplateParams
Constants ¶
const EnvLab = "CLAIMS_LAB"
EnvLab is the default lab of claims secret (like --lab).
const EnvOrdersURL = "CLAIM_ORDERS_URL"
EnvOrdersURL names the order service like --orders-url.
const EnvRecoveryRecipient = "CLAIMS_SOPS_RECOVERY_RECIPIENT"
EnvRecoveryRecipient names the offline recovery recipient every rule must carry.
const LayoutSourcePath = "source-path"
LayoutSourcePath places every rendered document by the path the order names (stuttgart-things/claims#92). See internal/layout.
Variables ¶
This section is empty.
Functions ¶
func GenerateFilename ¶ added in v0.2.0
GenerateFilename creates a filename from pattern and file info
func ShowFullPreview ¶ added in v0.2.0
func ShowFullPreview(result RenderResult)
ShowFullPreview displays complete YAML for a single result
func WriteResults ¶ added in v0.2.0
func WriteResults(results []RenderResult, config OutputConfig) error
WriteResults writes render results to files based on the output configuration
func WriteSingleResult ¶ added in v0.2.0
func WriteSingleResult(templateName, resourceName, content string, config OutputConfig) error
WriteSingleResult writes a single render result using the output configuration This is a convenience function for backward compatibility with single-template rendering
Types ¶
type ChangeConfig ¶ added in v0.19.0
type ChangeConfig struct {
Kind string
Name string
Namespace string
SourcePath string
Size string
Reboot string // now, evening, at, none -- or a time, which means at
RebootAt string
RequestedBy string
Reason string
RunID string // new spec.ansible.runID (re-runs the AnsibleRun)
Retry bool // count spec.ansible.runID up: unset -> 2, a number -> +1
Repo string // owner/name of the fleet repository ("" = the checkout's)
Ref string // branch the workflow runs on
DryRun bool
NoWait bool
Merge bool // wait for the PR's checks, then squash-merge it (claims#113)
// contains filtered or unexported fields
}
ChangeConfig holds the inputs of a claim change.
type DeleteConfig ¶ added in v0.6.0
type DeleteConfig struct {
ResourceName string
Category string
RepoURL string
RegistryPath string
Interactive bool
DryRun bool
GitConfig *GitConfig
PRConfig *PRConfig
// XR selects an XR deletion in an *-xrs directory (claims#93).
XR *DeleteXRConfig
// PickXR forces the interactive XR selection.
PickXR bool
}
DeleteConfig holds configuration for the delete command
type DeleteResult ¶ added in v0.6.0
DeleteResult holds the result of deleting a single claim
type DeleteXRConfig ¶ added in v0.18.0
type DeleteXRConfig struct {
Kind string
Name string
Namespace string
SourcePath string
Reason string
RequestedBy string
}
DeleteXRConfig holds the XR-mode settings of `claims delete`.
type EncryptConfig ¶ added in v0.6.0
type EncryptConfig struct {
// API configuration
APIUrl string
// Auth is the optional bearer-token authenticator (nil = no auth header).
Auth *apiauth.Authenticator
// Template selection
Template string
// Secret metadata
SecretName string
SecretNamespace string
// Parameter input
ParamsFile string
InlineParamsRaw []string
// Output configuration
OutputDir string
FilenamePattern string
DryRun bool
// Mode control
Interactive bool
// Git configuration
GitConfig *GitConfig
// PR configuration
PRConfig *PRConfig
}
EncryptConfig holds configuration for the encrypt command
type EncryptResult ¶ added in v0.6.0
type EncryptResult struct {
TemplateName string
SecretName string
SecretNamespace string
OutputPath string
Content string
Error error
}
EncryptResult holds the result of encrypting a single secret
type GitConfig ¶ added in v0.2.0
type GitConfig struct {
Commit bool
Push bool
CreateBranch bool
Message string
Branch string
Remote string
RepoURL string
User string
Token string
}
GitConfig holds git-related configuration
type MergeConfig ¶ added in v0.25.0
type MergeConfig struct {
Arg string // a claim/VM name, a branch, a PR number or URL
Repo string // owner/name ("" = the checkout's, else the fleet default)
Wait bool // wait for the checks
Timeout time.Duration // how long --wait waits
Yes bool // do not ask
DryRun bool // show the PR, do not merge
Token string // "" = ghclient.Token's order
// contains filtered or unexported fields
}
MergeConfig holds the inputs of a merge.
type OutputConfig ¶ added in v0.2.0
type OutputConfig struct {
Directory string
FilenamePattern string
SingleFile bool
DryRun bool
FileMode string // "overwrite" (default) or "append"
}
OutputConfig holds configuration for file output
type PRConfig ¶ added in v0.2.0
type PRConfig struct {
Create bool
Title string
Description string
Labels []string
BaseBranch string
Merge bool // --merge: wait for the checks, then squash-merge (claims#113)
}
PRConfig holds pull request configuration
type RenderConfig ¶ added in v0.2.0
type RenderConfig struct {
// API configuration
APIUrl string
APIUrls []string // multiple endpoints parsed from CLAIM_API_URL
// Auth is the optional bearer-token authenticator (nil = no auth header).
// The same token is used for every endpoint in APIUrls.
Auth *apiauth.Authenticator
// Template selection
Templates []string
// Parameter input
ParamsFile string
InlineParams map[string]string
InlineParamsRaw []string
// Secret input
InlineSecretsRaw []string
SkipSecrets bool
CombineSecrets bool
// Output configuration
OutputDir string
FilenamePattern string
SingleFile bool
DryRun bool
FullPreview bool // review shows the complete YAML (--full)
Stdout bool // print the rendered YAML to stdout, write nothing (--stdout)
FileMode string // "overwrite" (default) or "append"
Layout string // "" (output-dir + filename-pattern + registry) or "source-path"
// Mode control
Interactive bool
// Git configuration
GitConfig *GitConfig
// PR configuration
PRConfig *PRConfig
}
RenderConfig holds configuration for the render command
type RenderResult ¶ added in v0.2.0
type RenderResult struct {
TemplateName string
ResourceName string
OutputPath string
Content string
Params map[string]interface{}
Error error
}
RenderResult holds the result of rendering a single template
type RenderResults ¶ added in v0.2.0
type RenderResults struct {
Results []RenderResult
OutputDir string
GitCommit string
PRUrl string
}
RenderResults is a collection of render results
func (*RenderResults) FailedCount ¶ added in v0.2.0
func (r *RenderResults) FailedCount() int
FailedCount returns the number of failed renders
func (*RenderResults) HasErrors ¶ added in v0.2.0
func (r *RenderResults) HasErrors() bool
HasErrors returns true if any render result has an error
func (*RenderResults) SuccessCount ¶ added in v0.2.0
func (r *RenderResults) SuccessCount() int
SuccessCount returns the number of successful renders
type ReviewAction ¶ added in v0.2.0
type ReviewAction string
ReviewAction represents the user's choice in the review step
const ( ReviewActionContinue ReviewAction = "continue" ReviewActionEdit ReviewAction = "edit" ReviewActionCancel ReviewAction = "cancel" ReviewActionFull ReviewAction = "full" )
func ReviewResults ¶ added in v0.2.0
func ReviewResults(results []RenderResult, full bool) (ReviewAction, int, error)
ReviewResults displays rendered results and allows user to continue, edit, view the full YAML, or cancel. full shows every resource untruncated. Returns the chosen action, the index of the template to edit (if action is edit), and any error
Source Files
¶
- apiauth.go
- change.go
- delete.go
- delete_git.go
- delete_interactive.go
- delete_noninteractive.go
- delete_types.go
- delete_xr.go
- doctor.go
- encrypt.go
- encrypt_git.go
- encrypt_interactive.go
- encrypt_noninteractive.go
- encrypt_types.go
- endpoint.go
- fleet.go
- list.go
- login.go
- merge.go
- order.go
- preflight.go
- push_failure.go
- render.go
- render_form.go
- render_git.go
- render_interactive.go
- render_layout.go
- render_layout_interactive.go
- render_noninteractive.go
- render_output.go
- render_pr.go
- render_review.go
- render_secrets.go
- render_suggest.go
- render_types.go
- root.go
- secret.go
- secret_diff.go
- secret_doctor.go
- secret_generate.go
- secret_git.go
- secret_path.go
- secret_sops.go
- secret_sync.go
- secret_vault.go
- ui.go
- version.go