Skip to content

Commit

Permalink
add wait and healthchecks
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Aug 8, 2024
1 parent 50bc505 commit 3fbc013
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/api/v1beta1/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ type ZarfComponent struct {

// Custom commands to run at various stages of a package lifecycle.
Actions ZarfComponentActions `json:"actions,omitempty"`

// Whether or not to wait for every resource to be ready after deployment. (Defaults to true)
Wait *bool `json:"wait,omitempty"`

// Health checks to run after deployment.
HealthChecks []ZarfHealthCheck `json:"healthChecks,omitempty"`
}

// RequiresCluster returns if the component requires a cluster connection to deploy.
Expand All @@ -76,6 +82,17 @@ func (c ZarfComponent) IsRequired() bool {
return !*c.Optional
}

type ZarfHealthCheck struct {
// The APIVersion of the resource to wait for.
APIVersion string `json:"apiVersion" jsonschema:"example=v1"`
// The kind of resource to wait for.
Kind string `json:"kind" jsonschema:"example=Pod,example=Deployment"`
// The name of the resource or selector to wait for.
Name string `json:"name" jsonschema:"example=podinfo,example=app=podinfo"`
// The namespace of the resource to wait for.
Namespace string `json:"namespace,omitempty"`
}

// ZarfComponentOnlyTarget filters a component to only show it for a given local OS and cluster.
type ZarfComponentOnlyTarget struct {
// Only deploy component to specified OS.
Expand Down

0 comments on commit 3fbc013

Please sign in to comment.