Documentation ¶
Overview ¶
Package runtime contains code of all infrastructure runtimes supported by Kusion.
Index ¶
Constants ¶
View Source
const ( Kubernetes intent.Type = "Kubernetes" Terraform intent.Type = "Terraform" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyRequest ¶ added in v0.5.1
type ApplyRequest struct { // PriorResource is the last applied resource saved in state storage PriorResource *intent.Resource // PlanResource is the resource we want to apply in this request PlanResource *intent.Resource // Stack contains info about where this command is invoked Stack *stack.Stack // DryRun means this a dry-run request and will not make any changes in actual infra DryRun bool }
type ApplyResponse ¶ added in v0.5.1
type DeleteRequest ¶ added in v0.5.1
type DeleteResponse ¶ added in v0.5.1
type ImportRequest ¶ added in v0.7.4
type ImportResponse ¶ added in v0.7.4
type ReadRequest ¶ added in v0.5.1
type ReadRequest struct { // PriorResource is the last applied resource saved in state storage PriorResource *intent.Resource // PlanResource is the resource we want to apply in this request PlanResource *intent.Resource // Stack contains info about where this command is invoked Stack *stack.Stack }
type ReadResponse ¶ added in v0.5.1
type Runtime ¶
type Runtime interface { // Apply means modify this Resource to the desired state described in the request, // and it will turn into creating or updating a Resource in most scenarios. // If the infrastructure runtime already provides an Apply method that conform to this method's semantics meaning, // like the Kubernetes Runtime, you can directly invoke this method without any conversion. // PlanResource and priorState are given in this method for the runtime which would make a // three-way-merge (planState,priorState and live state) when implementing this interface Apply(ctx context.Context, request *ApplyRequest) *ApplyResponse // Read the latest state of this Resource Read(ctx context.Context, request *ReadRequest) *ReadResponse // Import Resource that already existed in the actual infrastructure Import(ctx context.Context, request *ImportRequest) *ImportResponse // Delete this Resource in the actual infrastructure and return success if this Resource is not exist Delete(ctx context.Context, request *DeleteRequest) *DeleteResponse // Watch the latest state or event of this Resource. // This is an optional method for the Runtime to implement, // but it will be very helpful for us to know what is happening when applying this Resource Watch(ctx context.Context, request *WatchRequest) *WatchResponse }
Runtime represents an actual infrastructure runtime managed by Kusion and every runtime implements this interface can be orchestrated by Kusion like normal K8s resources. All methods in this interface are designed for manipulating one Resource at a time and will be invoked in operations like Apply, Preview, Destroy, etc.
type SequentialWatchers ¶ added in v0.7.4
func NewWatchers ¶ added in v0.7.4
func NewWatchers() *SequentialWatchers
type WatchRequest ¶ added in v0.5.1
type WatchResponse ¶ added in v0.5.1
type WatchResponse struct { Watchers *SequentialWatchers // Status contains messages will show to users Status status.Status }
Click to show internal directories.
Click to hide internal directories.