Documentation
¶
Index ¶
- Variables
- func GetAllRequiredAzureClients(ctx context.Context, subscriptionIDs []string) (map[string]string, error)
- func Inspect(p *types.Pipeline, ctx context.Context, options *InspectOptions) error
- func KubeConfig(ctx context.Context, subscriptionID, resourceGroup, aksClusterName string) (string, error)
- func NewStepInspectScopes(subscriptions map[string]string) map[string]StepInspectScope
- func ResolvePipelineSubscriptions(ctx context.Context, lookup SubscriptionLookup, pipelines ...*types.Pipeline) ([]string, error)
- func RunStep(id graph.Identifier, s types.Step, ctx context.Context, ...) (Output, DetailsProducer, error)
- type ARMExecutionDetails
- type ArmOutput
- type BaseRunOptions
- type DetailsProducer
- type ExecutionDetails
- type ExecutionInfo
- type ExecutionState
- func NewExecutionState() *ExecutionState
- func RunEntrypoint(topo *topology.CombinedTopology, entrypoint *topology.Entrypoint, ...) (*ExecutionState, error)
- func RunPipeline(service *topology.Service, pipeline *types.Pipeline, ctx context.Context, ...) (*ExecutionState, error)
- func RunStampedPipeline(service *topology.Service, pipeline *types.Pipeline, ctx context.Context, ...) (*ExecutionState, error)
- type ExecutionTarget
- type Executor
- type Identifier
- type InspectOptions
- type NodeInfo
- type Operation
- type OperationsClientGetter
- type OutPutValue
- type Output
- type Outputs
- type PipelineRunOptions
- type Resource
- type ShellOutput
- type StepInspectScope
- type StepRunOptions
- type SubscriptionLookup
- type TopoDirLookup
Constants ¶
This section is empty.
Variables ¶
var DefaultDeploymentTimeoutSeconds = 30 * 6
var TEST_SUBSCRIPTION_ID = "test"
Functions ¶
func KubeConfig ¶
func NewStepInspectScopes ¶
func NewStepInspectScopes(subscriptions map[string]string) map[string]StepInspectScope
func RunStep ¶
func RunStep(id graph.Identifier, s types.Step, ctx context.Context, executionTarget ExecutionTarget, options *StepRunOptions, state *ExecutionState) (Output, DetailsProducer, error)
Types ¶
type ARMExecutionDetails ¶
type ARMExecutionDetails struct {
Operations []Operation `json:"operations,omitempty"`
}
type BaseRunOptions ¶
type DetailsProducer ¶
type DetailsProducer func(ctx context.Context) (*ExecutionDetails, error)
func DetermineOperationsForResourceGroupDeployment ¶
func DetermineOperationsForResourceGroupDeployment(getClient OperationsClientGetter, subscriptionID, resourceGroup, deploymentName string) DetailsProducer
func DetermineOperationsForSubscriptionDeployment ¶
func DetermineOperationsForSubscriptionDeployment(getClient OperationsClientGetter, subscriptionID, deploymentName string) DetailsProducer
type ExecutionDetails ¶
type ExecutionDetails struct {
ARM *ARMExecutionDetails `json:"arm,omitempty"`
}
type ExecutionInfo ¶
type ExecutionState ¶
type ExecutionState struct {
*sync.RWMutex
Executed sets.Set[graph.Identifier]
Queued sets.Set[graph.Identifier]
Timing map[graph.Identifier]*ExecutionInfo
Details map[graph.Identifier]*ExecutionDetails
Logging map[graph.Identifier][]byte
// contains filtered or unexported fields
}
func NewExecutionState ¶
func NewExecutionState() *ExecutionState
func RunEntrypoint ¶
func RunEntrypoint(topo *topology.CombinedTopology, entrypoint *topology.Entrypoint, pipelines map[string]*types.Pipeline, ctx context.Context, options *PipelineRunOptions, executor Executor) (*ExecutionState, error)
func RunPipeline ¶
func RunPipeline(service *topology.Service, pipeline *types.Pipeline, ctx context.Context, options *PipelineRunOptions, executor Executor) (*ExecutionState, error)
func RunStampedPipeline ¶
func RunStampedPipeline(service *topology.Service, pipeline *types.Pipeline, ctx context.Context, options *PipelineRunOptions, executor Executor) (*ExecutionState, error)
func (*ExecutionState) GetOutputs ¶
func (s *ExecutionState) GetOutputs(stamp graph.Stamp) Outputs
GetOutputs returns a snapshot of outputs for the given stamp. For stamped nodes, the stamp layer is merged over the base layer (stamp wins on conflict). During concurrent execution, caller must hold state.RLock() or state.Lock().
func (*ExecutionState) RecordOutput ¶
func (s *ExecutionState) RecordOutput(node graph.Identifier, output Output)
RecordOutput stores step output in the correct layer. Stamped nodes write to stampOutputs[stamp], unstamped to outputs. Caller must hold state.Lock() (write lock).
type ExecutionTarget ¶
type Executor ¶
type Executor func(id graph.Identifier, s types.Step, ctx context.Context, executionTarget ExecutionTarget, options *StepRunOptions, state *ExecutionState) (Output, DetailsProducer, error)
type Identifier ¶
type Identifier struct {
ServiceGroup string `json:"serviceGroup"`
ResourceGroup string `json:"resourceGroup"`
Step string `json:"step"`
}
func (Identifier) String ¶
func (i Identifier) String() string
type InspectOptions ¶
type InspectOptions struct {
Scope string
Format string
Step string
Region string
Configuration configtypes.Configuration
ScopeFunctions map[string]StepInspectScope
OutputFile io.Writer
Concurrency int
Service *topology.Service
TopoDirLookupFunc TopoDirLookup
}
InspectOptions contains the options for the Inspect method
type NodeInfo ¶
type NodeInfo struct {
Identifier Identifier `json:"identifier"`
Info ExecutionInfo `json:"info"`
Details *ExecutionDetails `json:"details,omitempty"`
}
type Operation ¶
type Operation struct {
// OperationType is what the operation did - known values: "Create", "Read", "EvaluateDeploymentOutput"
OperationType string `json:"operationType"`
// StartTimestamp is the time at which the operation started, formatted as RFC3339 date+time: 2025-11-05T13:16:20.624264+00:00
StartTimestamp string `json:"startTimestamp"`
// Duration is the time taken to run the operation, formatted as RFC3339 duration: PT3M12.9884364S
Duration string `json:"duration"`
// Resource defines the object of this operation.
Resource *Resource `json:"resource,omitempty"`
// Children holds the child operations when the resource is another deployment.
Children []Operation `json:"children,omitempty"`
}
Operation describes an ARM deployment rollout operation taken to realize a template.
type OperationsClientGetter ¶
type OperationsClientGetter func(subscriptionID string) (*armresources.DeploymentOperationsClient, error)
OperationsClientGetter returns a DeploymentOperationsClient for the given subscription ID. Implementations should cache clients to avoid redundant authentication.
func NewCachedOperationsClientGetter ¶
func NewCachedOperationsClientGetter(subscriptionID string, defaultClient *armresources.DeploymentOperationsClient, cred azcore.TokenCredential, opts *azcorearm.ClientOptions) OperationsClientGetter
NewCachedOperationsClientGetter creates an OperationsClientGetter that caches clients per subscription. The provided defaultClient is used for the given subscriptionID; clients for other subscriptions are created lazily using the provided credential.
type OutPutValue ¶
type Output ¶
type Output interface {
GetValue(key string) (*OutPutValue, error)
}
type PipelineRunOptions ¶
type PipelineRunOptions struct {
BaseRunOptions
Step string
Region string
Environment string
Stamp string
SubsciptionLookupFunc SubscriptionLookup
TopoDirLookupFunc TopoDirLookup
Concurrency int
TimingOutputFile string
JUnitOutputFile string
AbortIfRegionalExist bool
RegionRGNames []string // Specific RG names to check for concurrent execution prevention
StampConfigs map[graph.Stamp]configtypes.Configuration
StampPipelines map[graph.Stamp]map[string]*types.Pipeline
}
type Resource ¶
type Resource struct {
// ResourceType is the resource provider and resource name, like "Microsoft.KeyVault/vaults".
ResourceType string `json:"resourceType"`
// SubscriptionID is the Azure subscription in which the resource exists.
// Not serialized to avoid leaking sensitive identifiers into published artifacts.
SubscriptionID string `json:"-"`
// ResourceGroup is the Azure resource group in which the resource exists.
ResourceGroup string `json:"resourceGroup"`
// Name is the name of the resource.
Name string `json:"name"`
}
type ShellOutput ¶
type ShellOutput string
func (ShellOutput) GetValue ¶
func (o ShellOutput) GetValue(_ string) (*OutPutValue, error)
type StepInspectScope ¶
type StepRunOptions ¶
type StepRunOptions struct {
BaseRunOptions
PipelineDirectory string
RetryAttempt int // 0 for first attempt, >0 for retries
Environment string
Stamp string
}
type SubscriptionLookup ¶
func LookupSubscriptionID ¶
func LookupSubscriptionID(subscriptions map[string]string) SubscriptionLookup