Documentation
¶
Index ¶
- Constants
- func Check(ctx context.Context, opts *ProviderCheckOpts)
- type AwsClient
- func (c *AwsClient) BucketExists(ctx context.Context, name string) (bool, error)
- func (c AwsClient) CheckAccess(ctx context.Context) ProviderCheckResult
- func (c AwsClient) CheckConfig() error
- func (c AwsClient) CreateBucket(ctx context.Context, name string, force bool) error
- func (c *AwsClient) CreateDynamodbTable(ctx context.Context, name string, force bool) error
- func (c AwsClient) CreateStateBackend(ctx context.Context) error
- func (c AwsClient) CurrentIdentity(ctx context.Context) (CloudProviderIdentity, error)
- func (c *AwsClient) DescribeEksCluster(ctx context.Context) (*eks.DescribeClusterOutput, error)
- func (c *AwsClient) DestroyBucket(ctx context.Context, name string) error
- func (c *AwsClient) DestroyDynamodbTable(ctx context.Context, name string) error
- func (c AwsClient) DestroyStateBackend(ctx context.Context) error
- func (c *AwsClient) DynamodbTableExists(ctx context.Context, name string, d time.Duration) bool
- func (c AwsClient) Ec2ServerIdentityExists(ctx context.Context, cluster string) (bool, bool, error)
- func (c *AwsClient) EksKubeconfigInfo(ctx context.Context) (KubeconfigInfo, EksToken, error)
- func (c *AwsClient) GenerateEksToken(ctx context.Context) (EksToken, error)
- func (c AwsClient) KubeconfigInfo(ctx context.Context) (KubeconfigInfo, error)
- func (c AwsClient) PrepareAccount(ctx context.Context) error
- func (c AwsClient) PrintClusterInfo(ctx context.Context) error
- func (c AwsClient) PrintConfig()
- func (c AwsClient) ProviderName() string
- func (c AwsClient) StateBackendExists(ctx context.Context) (bool, error)
- func (c AwsClient) StateBackendInfo(stage string) CloudProviderStateBackend
- type AwsProviderCheckResult
- type AwsSdkClientFactory
- type CleanupEvent
- type CleanupHookEvent
- type CleanupStatus
- type CloudProviderClient
- type CloudProviderClientOpts
- type CloudProviderIdentity
- type CloudProviderStateBackend
- type CloudflareAccessCheckResult
- type CloudflareClient
- type CloudflareZonesResponse
- type CloudflareZonesResponseResult
- type ClusterProgress
- func (p ClusterProgress) MaxReleaseTimeout() time.Duration
- func (p ClusterProgress) NotReadyDetails() []HelmReleaseStatus
- func (p ClusterProgress) NotReadySummary(limit int) string
- func (p ClusterProgress) StalledReleases() []HelmReleaseStatus
- func (p ClusterProgress) Summary() string
- func (p ClusterProgress) SummaryWithStragglers(limit int) string
- type DnsProviderClient
- type DynamodbClient
- type EksClient
- type EksToken
- type EmptyProvider
- type EmptyProviderCheckResult
- type ExternalSecretsTeardownAssessment
- type GithubCheckAccessResult
- type GithubClient
- type GithubProviderCheckResult
- type GithubTokenSource
- type HelmReleaseStatus
- type IamClient
- type IronbankCheckAccessResult
- type IronbankClient
- type KubeconfigInfo
- type KubernetesApi
- type KubernetesApiImpl
- type KubernetesApiMock
- func (api *KubernetesApiMock) AddResources(res ...*metav1.APIResourceList) *KubernetesApiMock
- func (api KubernetesApiMock) ClientSet() (kubernetes.Interface, error)
- func (api KubernetesApiMock) DiscoveryClient() (discovery.DiscoveryInterface, error)
- func (api KubernetesApiMock) DynamicClient() (dynamic.Interface, error)
- func (api KubernetesApiMock) RESTConfig() *rest.Config
- func (api *KubernetesApiMock) WithClientObjects(objects ...runtime.Object) *KubernetesApiMock
- func (api *KubernetesApiMock) WithDynamicObjects(objects ...runtime.Object) *KubernetesApiMock
- func (api *KubernetesApiMock) WithError(err error) *KubernetesApiMock
- type KubernetesAppConnectionInfo
- type KubernetesClient
- func (c KubernetesClient) AssessExternalSecretsTeardown(ctx context.Context) (ExternalSecretsTeardownAssessment, error)
- func (c KubernetesClient) CheckAccess(ctx context.Context) ProviderCheckResult
- func (c KubernetesClient) CheckPodHealth(ctx context.Context, namespace string, appLabel string) (PodHealthStatus, error)
- func (c KubernetesClient) CleanupStuckTerminatingPods(ctx context.Context, timeout time.Duration) ([]string, error)
- func (c KubernetesClient) ClusterProgressSnapshot(ctx context.Context) (ClusterProgress, error)
- func (c KubernetesClient) EnsureKubeconfig(path string) error
- func (c KubernetesClient) Export(ctx context.Context, cfg quartzSchema.ExportConfig) (map[string][]byte, error)
- func (c KubernetesClient) ForEachDynamicResources(ctx context.Context, kind schema.GroupVersionResource, ns string, ...) error
- func (c KubernetesClient) GetAppConnectionInfo(ctx context.Context, name string, opts quartzSchema.ApplicationLookupConfig) KubernetesAppConnectionInfo
- func (c KubernetesClient) GetCleanupStatus(ctx context.Context, ns string, name string) (CleanupStatus, error)
- func (c KubernetesClient) GetConfigMapValue(ctx context.Context, ns string, name string) (map[string]string, error)
- func (c KubernetesClient) GetDaemonSetStatus(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) (int64, int64, error)
- func (c KubernetesClient) GetDynamicResource(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) (map[string]interface{}, error)
- func (c KubernetesClient) GetSecret(ctx context.Context, ns string, name string) (*corev1.Secret, error)
- func (c KubernetesClient) GetSecretValue(ctx context.Context, ns string, name string) (map[string]string, error)
- func (c KubernetesClient) InterStageCleanup(ctx context.Context) error
- func (c KubernetesClient) ListVirtualServices(ctx context.Context) (result []VirtualServiceInfo, err error)
- func (c KubernetesClient) LookupKind(ctx context.Context, kind string) (schema.GroupVersionResource, error)
- func (c KubernetesClient) PrepareForDestroy(ctx context.Context) error
- func (c KubernetesClient) PrintClusterAppInfo(ctx context.Context, apps map[string]quartzSchema.ApplicationLookupConfig)
- func (c KubernetesClient) PrintClusterInfo(ctx context.Context)
- func (c KubernetesClient) PrintDiscoveredVirtualServices(ctx context.Context, excludeNames map[string]bool)
- func (c KubernetesClient) ProviderName() string
- func (c KubernetesClient) QueryPrometheus(ctx context.Context, ns string, service string, port int, query string) (PrometheusQueryResponse, error)
- func (c KubernetesClient) ReapOrphanedAdmissionWebhooks(ctx context.Context) ([]string, error)
- func (c KubernetesClient) RefreshExternalSecrets(ctx context.Context) ([]KubernetesResource, error)
- func (c KubernetesClient) Restart(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) error
- func (c KubernetesClient) ScrubStuckHelmReleaseSecrets(ctx context.Context, minAge time.Duration) ([]string, error)
- func (c KubernetesClient) Update(ctx context.Context, kind schema.GroupVersionResource, ns string, ...) (*unstructured.Unstructured, error)
- func (c KubernetesClient) WaitConditionState(ctx context.Context, kind schema.GroupVersionResource, ns string, name string, ...) error
- func (c KubernetesClient) WriteKubeconfig(w io.Writer) error
- func (c KubernetesClient) WriteKubeconfigFile(path string) error
- type KubernetesLookupCache
- type KubernetesProviderCheckResult
- type KubernetesProviderClient
- type KubernetesResource
- type LazyAwsSdkClient
- func (c *LazyAwsSdkClient) Dynamodb() DynamodbClient
- func (c *LazyAwsSdkClient) Eks() EksClient
- func (c *LazyAwsSdkClient) EksTokenGenerator() (token.Generator, error)
- func (c *LazyAwsSdkClient) Iam() IamClient
- func (c *LazyAwsSdkClient) S3() S3Client
- func (c *LazyAwsSdkClient) S3Region(region string) S3Client
- func (c *LazyAwsSdkClient) Sts() StsClient
- type LocalClient
- func (c LocalClient) CheckAccess(ctx context.Context) ProviderCheckResult
- func (c LocalClient) CheckConfig() error
- func (c LocalClient) CreateStateBackend(_ context.Context) error
- func (c LocalClient) CurrentIdentity(ctx context.Context) (CloudProviderIdentity, error)
- func (c LocalClient) DestroyStateBackend(_ context.Context) error
- func (c LocalClient) KubeconfigInfo(ctx context.Context) (KubeconfigInfo, error)
- func (c LocalClient) PrepareAccount(ctx context.Context) error
- func (c LocalClient) PrintClusterInfo(ctx context.Context) error
- func (c LocalClient) PrintConfig()
- func (c LocalClient) ProviderName() string
- func (c LocalClient) StateBackendExists(_ context.Context) (bool, error)
- func (c LocalClient) StateBackendInfo(_ string) CloudProviderStateBackend
- type PodHealthStatus
- type PrometheusQueryData
- type PrometheusQueryResponse
- type PrometheusQueryResult
- type Provider
- type ProviderCheckOpts
- type ProviderCheckResult
- type ProviderCheckResultRow
- type ProviderFactory
- func (f *ProviderFactory) Cloud(ctx context.Context) (CloudProviderClient, error)
- func (f *ProviderFactory) Dns(ctx context.Context) (DnsProviderClient, error)
- func (f *ProviderFactory) ImageRegistry(ctx context.Context) (Provider, error)
- func (f *ProviderFactory) Kubernetes(ctx context.Context) (KubernetesProviderClient, error)
- func (f *ProviderFactory) SourceControl(ctx context.Context) (Provider, error)
- type ProviderFactoryOption
- func WithCloudProvider(p CloudProviderClient) ProviderFactoryOption
- func WithConfig(c schema.QuartzConfig) ProviderFactoryOption
- func WithDnsProvider(p DnsProviderClient) ProviderFactoryOption
- func WithImageRegistryProvider(p Provider) ProviderFactoryOption
- func WithKubernetesProvider(p KubernetesProviderClient) ProviderFactoryOption
- func WithSecrets(s schema.QuartzSecrets) ProviderFactoryOption
- func WithSourceControlProvider(p Provider) ProviderFactoryOption
- type S3Client
- type StsClient
- type VirtualServiceInfo
Constants ¶
const (
AWS_PROVIDER = "AWS"
)
const HelmReleaseStuckGracePeriod = 10 * time.Minute
HelmReleaseStuckGracePeriod is how long a Helm release record may sit in a transient ("uninstalling"/"pending-*") status before ScrubStuckHelmReleaseSecrets considers it genuinely wedged rather than an operation a controller is actively driving. A healthy install/upgrade completes well within this window (especially with Flux's disableWait, which returns as soon as manifests are applied), so anything still pending past it has been abandoned by a dead or looping controller.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
func Check(ctx context.Context, opts *ProviderCheckOpts)
Check performs access checks for all providers in the given options. It logs the results and execution statistics.
Types ¶
type AwsClient ¶
type AwsClient struct {
// contains filtered or unexported fields
}
AwsClient represents an AWS client with configuration and SDK factory. It provides methods to interact with AWS services.
func NewAwsClient ¶
func NewLazyAwsClient ¶
func (*AwsClient) BucketExists ¶
BucketExists checks if an S3 bucket with the specified name exists. It returns true if the bucket exists, false otherwise, and an error if the operation fails.
func (AwsClient) CheckAccess ¶
func (c AwsClient) CheckAccess(ctx context.Context) ProviderCheckResult
func (AwsClient) CheckConfig ¶
func (AwsClient) CreateBucket ¶
CreateBucket creates an S3 bucket with the specified name. If the bucket already exists and `force` is false, the operation is skipped.
func (*AwsClient) CreateDynamodbTable ¶
CreateDynamodbTable creates a DynamoDB table with the specified name. If the table already exists and `force` is false, the operation is skipped.
func (AwsClient) CreateStateBackend ¶
func (AwsClient) CurrentIdentity ¶
func (c AwsClient) CurrentIdentity(ctx context.Context) (CloudProviderIdentity, error)
func (*AwsClient) DescribeEksCluster ¶
DescribeEksCluster describes the EKS cluster associated with the client. It returns the cluster details or an error if the operation fails.
func (*AwsClient) DestroyBucket ¶
DestroyBucket deletes an S3 bucket with the specified name. The bucket must be empty before it can be deleted.
func (*AwsClient) DestroyDynamodbTable ¶
DestroyDynamodbTable deletes a DynamoDB table with the specified name.
func (AwsClient) DestroyStateBackend ¶
func (*AwsClient) DynamodbTableExists ¶
DynamodbTableExists checks if a DynamoDB table with the specified name exists within the given duration.
func (AwsClient) Ec2ServerIdentityExists ¶ added in v1.2.0
Ec2ServerIdentityExists reports whether the standard ec2 stage IAM role and instance profile already exist for the given cluster name.
func (*AwsClient) EksKubeconfigInfo ¶
EksKubeconfigInfo retrieves the kubeconfig information for an EKS cluster. It returns the kubeconfig details, an EKS token, and an error if any occurs.
func (*AwsClient) GenerateEksToken ¶ added in v1.1.0
GenerateEksToken generates an EKS authentication token for the cluster.
Unlike EksKubeconfigInfo, this does not call DescribeCluster: the token is produced purely from a presigned STS GetCallerIdentity request, requiring only sts:GetCallerIdentity. This is the path used by the kubeconfig exec credential plugin, where the cluster endpoint and CA are already known.
func (AwsClient) KubeconfigInfo ¶
func (c AwsClient) KubeconfigInfo(ctx context.Context) (KubeconfigInfo, error)
func (AwsClient) PrintConfig ¶
func (c AwsClient) PrintConfig()
func (AwsClient) ProviderName ¶
ProviderName returns the name of the cloud provider ("AWS").
func (AwsClient) StateBackendExists ¶ added in v1.1.0
StateBackendExists reports whether the S3 state bucket backing this cluster still exists. A clean run destroys the bucket only after every stage has been torn down, so its absence is a reliable signal that there is nothing left to destroy.
func (AwsClient) StateBackendInfo ¶
func (c AwsClient) StateBackendInfo(stage string) CloudProviderStateBackend
type AwsProviderCheckResult ¶
type AwsProviderCheckResult struct {
Identity CloudProviderIdentity
Error error
}
func (AwsProviderCheckResult) ToTable ¶
func (r AwsProviderCheckResult) ToTable() ([]string, []ProviderCheckResultRow)
type AwsSdkClientFactory ¶
type AwsSdkClientFactory interface {
Sts() StsClient
Iam() IamClient
Dynamodb() DynamodbClient
S3() S3Client
S3Region(region string) S3Client
Eks() EksClient
EksTokenGenerator() (token.Generator, error)
}
AwsSdkClientFactory defines the interface for creating AWS SDK clients.
type CleanupEvent ¶ added in v1.1.0
type CleanupEvent struct {
Reason string
Type string
Message string
Count int32
LastTimestamp time.Time
}
CleanupEvent is a compact, stable view of a Kubernetes Event emitted by the Quartz cleanup hook.
type CleanupHookEvent ¶ added in v1.1.0
type CleanupHookEvent struct {
At time.Time `json:"at"`
Kind string `json:"kind"`
Phase string `json:"phase"`
Status string `json:"status"`
Detail string `json:"detail"`
}
CleanupHookEvent is one cumulative lifecycle breadcrumb appended by the Quartz pre-delete hook into the cleanup status ConfigMap.
type CleanupStatus ¶ added in v1.1.0
type CleanupStatus struct {
Data map[string]string
Events []CleanupEvent
HookEvents []CleanupHookEvent
}
CleanupStatus contains the best-effort status breadcrumbs emitted by the Quartz chart pre-delete hook. It is intentionally limited to non-secret metadata so teardown reports can be persisted safely.
type CloudProviderClient ¶
type CloudProviderClient interface {
Provider
// CheckConfig validates the cloud provider configuration.
CheckConfig() error
// CurrentIdentity retrieves the current identity of the cloud provider account.
CurrentIdentity(ctx context.Context) (CloudProviderIdentity, error)
// StateBackendInfo retrieves information about the state backend for the specified stage.
StateBackendInfo(stage string) CloudProviderStateBackend
// CreateStateBackend creates the state backend for the cloud provider.
CreateStateBackend(ctx context.Context) error
// DestroyStateBackend destroys the state backend for the cloud provider.
DestroyStateBackend(ctx context.Context) error
// StateBackendExists reports whether the state backend currently exists. It
// is used to short-circuit a teardown when the backend is already gone (the
// terminal state of a successful clean), so there is nothing left to refresh
// or destroy.
StateBackendExists(ctx context.Context) (bool, error)
// KubeconfigInfo retrieves the kubeconfig information for the cloud provider.
KubeconfigInfo(ctx context.Context) (KubeconfigInfo, error)
// PrintConfig prints the cloud provider configuration.
PrintConfig()
// PrintClusterInfo prints information about the cloud provider's cluster.
PrintClusterInfo(ctx context.Context) error
// PrepareAccount prepares the cloud provider account for use.
PrepareAccount(ctx context.Context) error
}
CloudProviderClient defines the interface for cloud provider clients.
func NewCloudProviderClient ¶
func NewCloudProviderClient(ctx context.Context, cfg schema.QuartzConfig) (CloudProviderClient, error)
NewCloudProviderClient creates a new cloud provider client using the provided Quartz configuration.
func NewCloudProviderClientWithOpts ¶
func NewCloudProviderClientWithOpts(ctx context.Context, o CloudProviderClientOpts) (CloudProviderClient, error)
NewCloudProviderClientWithOpts creates a new cloud provider client using the specified options.
type CloudProviderClientOpts ¶
type CloudProviderClientOpts struct {
Provider string // The name of the cloud provider (e.g., "aws", "local").
Name string // The name of the cloud provider client.
Region string // The region for the cloud provider.
// contains filtered or unexported fields
}
CloudProviderClientOpts contains options for creating a cloud provider client.
type CloudProviderIdentity ¶
type CloudProviderIdentity struct {
AccountId string // The account ID of the cloud provider.
AccountName string // The account name of the cloud provider.
UserId string // The user ID of the cloud provider account.
UserName string // The user name of the cloud provider account.
}
CloudProviderIdentity represents the identity of a cloud provider account.
type CloudProviderStateBackend ¶
type CloudProviderStateBackend struct {
Name string // The name of the state backend.
InitBackendConfig []string // The initialization configuration for the state backend.
}
CloudProviderStateBackend represents the state backend configuration for a cloud provider.
type CloudflareAccessCheckResult ¶
type CloudflareAccessCheckResult struct {
Status bool // Indicates whether the access check was successful.
Error error // Contains any error encountered during the check.
Response CloudflareZonesResponse // The response from the Cloudflare API.
}
CloudflareAccessCheckResult represents the result of a Cloudflare access check.
func (CloudflareAccessCheckResult) ToTable ¶
func (r CloudflareAccessCheckResult) ToTable() ([]string, []ProviderCheckResultRow)
ToTable converts the CloudflareAccessCheckResult into table headers and rows for display.
type CloudflareClient ¶
type CloudflareClient struct {
// contains filtered or unexported fields
}
CloudflareClient represents a client for interacting with the Cloudflare API.
func NewCloudflareClient ¶
func NewCloudflareClient(httpClient util.HttpClientFactory, providerName string, accountId string, apiToken string, domain string) (CloudflareClient, error)
NewCloudflareClient creates a new CloudflareClient instance. Returns an error if required parameters (accountId, apiToken, or domain) are missing.
func (CloudflareClient) CheckAccess ¶
func (c CloudflareClient) CheckAccess(ctx context.Context) ProviderCheckResult
CheckAccess checks access to the Cloudflare API for the specified domain and account. It verifies the required permissions and returns the result as a CloudflareAccessCheckResult.
func (CloudflareClient) ProviderName ¶
func (c CloudflareClient) ProviderName() string
ProviderName returns the name of the Cloudflare provider.
type CloudflareZonesResponse ¶
type CloudflareZonesResponse struct {
Success bool // Indicates whether the API call was successful.
Errors []string // Contains any errors returned by the API.
Messages []string // Contains any messages returned by the API.
Result []CloudflareZonesResponseResult // The list of zones returned by the API.
}
CloudflareZonesResponse represents the response from the Cloudflare API for zones.
type CloudflareZonesResponseResult ¶
type CloudflareZonesResponseResult struct {
Id string // The ID of the zone.
Name string // The name of the zone.
Permissions []string // The permissions associated with the zone.
}
CloudflareZonesResponseResult represents a single zone in the Cloudflare API response.
type ClusterProgress ¶ added in v1.1.0
type ClusterProgress struct {
HelmReleasesReady int
HelmReleasesTotal int
NotReadyReleases []string
Releases []HelmReleaseStatus
TerminatingNamespaces []string
UnhealthyPods []string
}
ClusterProgress is a point-in-time snapshot of cluster health used to give users visibility into a deploying Quartz cluster. It surfaces the signals that otherwise only become apparent minutes into a stalled install.
func (ClusterProgress) MaxReleaseTimeout ¶ added in v1.1.0
func (p ClusterProgress) MaxReleaseTimeout() time.Duration
MaxReleaseTimeout returns the largest per-release spec.timeout in the snapshot (zero if none declare one). The convergence gate uses this to size its overall wait: a release legitimately allowed, say, 90m must not be declared a failure by a gate that only waits 30m.
func (ClusterProgress) NotReadyDetails ¶ added in v1.1.0
func (p ClusterProgress) NotReadyDetails() []HelmReleaseStatus
NotReadyDetails returns the per-release detail for every release that is not currently Ready, in the order collected.
func (ClusterProgress) NotReadySummary ¶ added in v1.1.0
func (p ClusterProgress) NotReadySummary(limit int) string
NotReadySummary returns a compact, human-oriented summary of the top non-ready HelmReleases and their current state.
func (ClusterProgress) StalledReleases ¶ added in v1.1.0
func (p ClusterProgress) StalledReleases() []HelmReleaseStatus
StalledReleases returns the per-release detail for every release Flux has marked Stalled (retries/remediation exhausted), i.e. genuinely stuck.
func (ClusterProgress) Summary ¶ added in v1.1.0
func (p ClusterProgress) Summary() string
Summary renders a concise one-line health summary suitable for periodic logging during an install.
func (ClusterProgress) SummaryWithStragglers ¶ added in v1.1.0
func (p ClusterProgress) SummaryWithStragglers(limit int) string
SummaryWithStragglers renders the standard summary plus a short "waiting on" tail naming the top not-ready HelmReleases. This keeps long installs readable without forcing operators to jump straight to raw controller logs.
type DnsProviderClient ¶
type DnsProviderClient interface {
Provider
}
DnsProviderClient defines the interface for DNS provider clients.
func NewDnsProviderClient ¶
func NewDnsProviderClient(ctx context.Context, cfg schema.QuartzConfig, secrets schema.QuartzSecrets) (DnsProviderClient, error)
NewDnsProviderClient creates a new DNS provider client based on the provided configuration and secrets. If the test mode is enabled, it returns a TestDnsProviderClient. Otherwise, it initializes the appropriate DNS provider client.
type DynamodbClient ¶
type DynamodbClient interface {
dynamodb.DescribeTableAPIClient
CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.CreateTableOutput, error)
DeleteTable(ctx context.Context, params *dynamodb.DeleteTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteTableOutput, error)
}
DynamodbClient defines the interface for interacting with AWS DynamoDB.
type EksClient ¶
type EksClient interface {
DescribeCluster(ctx context.Context, params *eks.DescribeClusterInput, optFns ...func(*eks.Options)) (*eks.DescribeClusterOutput, error)
}
EksClient defines the interface for interacting with AWS EKS.
type EksToken ¶
type EksToken struct {
Token token.Token // The EKS authentication token.
JsonString string // The JSON representation of the token.
}
EksToken represents an EKS authentication token and its JSON representation.
type EmptyProvider ¶
type EmptyProvider struct {
Name string // The name of the provider.
Error error // The error associated with the provider, if any.
}
EmptyProvider represents a placeholder provider with no functionality.
func NewEmptyProvider ¶
func NewEmptyProvider(name string, err error) EmptyProvider
NewEmptyProvider creates a new instance of EmptyProvider with the specified name and error.
func (EmptyProvider) CheckAccess ¶
func (c EmptyProvider) CheckAccess(ctx context.Context) ProviderCheckResult
CheckAccess performs an access check for the EmptyProvider. It always returns an EmptyProviderCheckResult with the associated error.
func (EmptyProvider) ProviderName ¶
func (c EmptyProvider) ProviderName() string
ProviderName returns the name of the EmptyProvider.
type EmptyProviderCheckResult ¶
type EmptyProviderCheckResult struct {
Error error // The error associated with the check result, if any.
}
EmptyProviderCheckResult represents the result of a check for an EmptyProvider.
func (EmptyProviderCheckResult) ToTable ¶
func (r EmptyProviderCheckResult) ToTable() ([]string, []ProviderCheckResultRow)
ToTable converts the EmptyProviderCheckResult into table headers and rows for display.
type ExternalSecretsTeardownAssessment ¶ added in v1.1.0
type ExternalSecretsTeardownAssessment struct {
Recoverable bool
HelmReleaseSecrets []string
RemainingResources []string
Summary string
}
ExternalSecretsTeardownAssessment summarizes whether the external-secrets release has effectively been torn down even if Helm timed out deleting its own bookkeeping.
type GithubCheckAccessResult ¶
type GithubCheckAccessResult struct {
Organization string // The organization name.
Repository string // The repository name.
Error error // Any error encountered during the access check.
Name string // The full name of the repository.
Pull bool // Indicates if the user has pull access.
Push bool // Indicates if the user has push access.
Triage bool // Indicates if the user has triage access.
Maintain bool // Indicates if the user has maintain access.
Admin bool // Indicates if the user has admin access.
Packages bool // Indicates if the user has access to packages.
}
GithubCheckAccessResult represents the result of a GitHub repository access check.
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
GithubClient represents a client for interacting with the GitHub API.
func NewGithubClient ¶
func NewGithubClient(httpClient util.HttpClientFactory, providerName string, cfg schema.QuartzConfig, creds schema.GithubCredentials) (GithubClient, error)
NewGithubClient creates a new GitHub client with the specified configuration and credentials. Returns an error if the credentials are missing.
func (GithubClient) CheckAccess ¶
func (c GithubClient) CheckAccess(ctx context.Context) ProviderCheckResult
CheckAccess performs an access check for the GitHub provider. It returns a GithubProviderCheckResult containing the results of the check.
func (GithubClient) CheckGithubRepoAccess ¶
func (c GithubClient) CheckGithubRepoAccess(ctx context.Context) ([]GithubCheckAccessResult, error)
CheckGithubRepoAccess checks access to the configured GitHub repositories. It returns a list of GithubCheckAccessResult and an error if any issues are encountered.
func (GithubClient) ProviderName ¶
func (c GithubClient) ProviderName() string
ProviderName returns the name of the GitHub provider.
func (GithubClient) Repositories ¶
func (c GithubClient) Repositories() []schema.RepositoryConfig
Repositories retrieves the list of repositories configured in the Quartz configuration.
type GithubProviderCheckResult ¶
type GithubProviderCheckResult struct {
Status bool // Indicates if the check was successful.
Results []GithubCheckAccessResult // The results of the access checks.
Error error // Any error encountered during the check.
}
GithubProviderCheckResult represents the result of a GitHub provider check.
func (GithubProviderCheckResult) ToTable ¶
func (r GithubProviderCheckResult) ToTable() ([]string, []ProviderCheckResultRow)
ToTable converts the GithubProviderCheckResult into table headers and rows for display.
type GithubTokenSource ¶
type GithubTokenSource struct {
AccessToken string // The GitHub access token.
}
GithubTokenSource represents a source for GitHub access tokens.
type HelmReleaseStatus ¶ added in v1.1.0
type HelmReleaseStatus struct {
Namespace string
Name string
Ready bool
ReadyMsg string
Stalled bool
StalledMsg string
// Timeout is the release's own spec.timeout (the budget Flux gives a single
// install/upgrade attempt before it fails and remediates). Zero when unset.
// The convergence gate uses the largest of these to size its overall wait so
// it never gives up on a release that is still inside its own allotted time.
Timeout time.Duration
}
HelmReleaseStatus is a per-release readiness detail captured during a ClusterProgressSnapshot. It carries enough signal for a convergence gate to distinguish a release that is still progressing (keep waiting) from one Flux has given up on (Stalled — fail fast and surface the reason).
func (HelmReleaseStatus) ID ¶ added in v1.1.0
func (h HelmReleaseStatus) ID() string
ID returns the "namespace/name" identifier for the release.
type IamClient ¶
type IamClient interface {
ListAccountAliases(ctx context.Context, params *iam.ListAccountAliasesInput, optFns ...func(*iam.Options)) (*iam.ListAccountAliasesOutput, error)
CreateServiceLinkedRole(ctx context.Context, params *iam.CreateServiceLinkedRoleInput, optFns ...func(*iam.Options)) (*iam.CreateServiceLinkedRoleOutput, error)
GetRole(ctx context.Context, params *iam.GetRoleInput, optFns ...func(*iam.Options)) (*iam.GetRoleOutput, error)
GetInstanceProfile(ctx context.Context, params *iam.GetInstanceProfileInput, optFns ...func(*iam.Options)) (*iam.GetInstanceProfileOutput, error)
}
IamClient defines the interface for interacting with AWS IAM.
type IronbankCheckAccessResult ¶
type IronbankCheckAccessResult struct {
StatusCode int // The HTTP status code returned by the Ironbank API.
Username string // The username used for the access check.
Error error // Any error encountered during the access check.
}
IronbankCheckAccessResult represents the result of an Ironbank access check.
func (IronbankCheckAccessResult) ToTable ¶
func (r IronbankCheckAccessResult) ToTable() ([]string, []ProviderCheckResultRow)
ToTable converts the IronbankCheckAccessResult into table headers and rows for display.
type IronbankClient ¶
type IronbankClient struct {
// contains filtered or unexported fields
}
IronbankClient represents a client for interacting with the Ironbank API.
func NewIronbankClient ¶
func NewIronbankClient(httpClient util.HttpClientFactory, providerName string, username string, password string) (*IronbankClient, error)
NewIronbankClient creates a new IronbankClient instance with the specified credentials. Returns an error if the username or password is missing.
func (*IronbankClient) CheckAccess ¶
func (c *IronbankClient) CheckAccess(ctx context.Context) ProviderCheckResult
CheckAccess performs an access check against the Ironbank API. It returns an IronbankCheckAccessResult containing the result of the check.
func (*IronbankClient) ProviderName ¶
func (c *IronbankClient) ProviderName() string
ProviderName returns the name of the Ironbank provider.
type KubeconfigInfo ¶
type KubeconfigInfo struct {
Cluster string
Context string
User string
Endpoint string
CertificateAuthority string
Token string
Expiration time.Time
}
KubeconfigInfo contains information about the Kubernetes configuration.
func (KubeconfigInfo) Kubeconfig ¶
func (kc KubeconfigInfo) Kubeconfig(cfg quartzSchema.QuartzConfig) quartzSchema.Kubeconfig
Kubeconfig converts the KubeconfigInfo to a Kubeconfig structure.
func (KubeconfigInfo) ToKubeconfigYamlBytes ¶
func (kc KubeconfigInfo) ToKubeconfigYamlBytes(cfg quartzSchema.QuartzConfig) []byte
ToKubeconfigYamlBytes converts the KubeconfigInfo to YAML bytes.
type KubernetesApi ¶
type KubernetesApi interface {
// ClientSet returns a Kubernetes clientset for interacting with core Kubernetes resources.
ClientSet() (kubernetes.Interface, error)
// DynamicClient returns a dynamic Kubernetes client for interacting with unstructured resources.
DynamicClient() (dynamic.Interface, error)
// DiscoveryClient returns a discovery client for querying API server metadata.
DiscoveryClient() (discovery.DiscoveryInterface, error)
// RESTConfig returns the Kubernetes REST config backing this API client.
RESTConfig() *rest.Config
}
KubernetesApi defines the interface for interacting with Kubernetes APIs.
func NewKubernetesApi ¶
func NewKubernetesApi(ctx context.Context, cfg quartzSchema.QuartzConfig, i *KubeconfigInfo) (KubernetesApi, error)
NewKubernetesApi creates a new KubernetesApi instance using the provided configuration and kubeconfig information. If test mode is enabled, it returns a mock implementation.
type KubernetesApiImpl ¶
type KubernetesApiImpl struct {
// contains filtered or unexported fields
}
KubernetesApiImpl is an implementation of KubernetesApi using a REST configuration.
func (KubernetesApiImpl) ClientSet ¶
func (api KubernetesApiImpl) ClientSet() (kubernetes.Interface, error)
ClientSet returns a Kubernetes clientset for interacting with core Kubernetes resources.
func (KubernetesApiImpl) DiscoveryClient ¶
func (api KubernetesApiImpl) DiscoveryClient() (discovery.DiscoveryInterface, error)
DiscoveryClient returns a discovery client for querying API server metadata.
func (KubernetesApiImpl) DynamicClient ¶
func (api KubernetesApiImpl) DynamicClient() (dynamic.Interface, error)
DynamicClient returns a dynamic Kubernetes client for interacting with unstructured resources.
func (KubernetesApiImpl) RESTConfig ¶ added in v1.1.0
func (api KubernetesApiImpl) RESTConfig() *rest.Config
RESTConfig returns the REST config backing this Kubernetes API client.
type KubernetesApiMock ¶
type KubernetesApiMock struct {
// contains filtered or unexported fields
}
KubernetesApiMock is a mock implementation of the IKubernetesApi interface for testing purposes.
func NewKubernetesApiMock ¶
func NewKubernetesApiMock() *KubernetesApiMock
NewKubernetesApiMock creates a new instance of KubernetesApiMock with default API resources.
func (*KubernetesApiMock) AddResources ¶
func (api *KubernetesApiMock) AddResources(res ...*metav1.APIResourceList) *KubernetesApiMock
AddResources adds API resources to the mock discovery client.
func (KubernetesApiMock) ClientSet ¶
func (api KubernetesApiMock) ClientSet() (kubernetes.Interface, error)
ClientSet returns a fake Kubernetes clientset populated with the mock client objects.
func (KubernetesApiMock) DiscoveryClient ¶
func (api KubernetesApiMock) DiscoveryClient() (discovery.DiscoveryInterface, error)
DiscoveryClient returns a fake discovery client populated with the mock API resources.
func (KubernetesApiMock) DynamicClient ¶
func (api KubernetesApiMock) DynamicClient() (dynamic.Interface, error)
DynamicClient returns a fake dynamic client populated with the mock dynamic objects.
func (KubernetesApiMock) RESTConfig ¶ added in v1.1.0
func (api KubernetesApiMock) RESTConfig() *rest.Config
RESTConfig returns nil for the fake API; tests can stub higher-level helpers.
func (*KubernetesApiMock) WithClientObjects ¶
func (api *KubernetesApiMock) WithClientObjects(objects ...runtime.Object) *KubernetesApiMock
WithClientObjects adds client objects to the mock clientset.
func (*KubernetesApiMock) WithDynamicObjects ¶
func (api *KubernetesApiMock) WithDynamicObjects(objects ...runtime.Object) *KubernetesApiMock
WithDynamicObjects adds dynamic objects to the mock dynamic client.
func (*KubernetesApiMock) WithError ¶
func (api *KubernetesApiMock) WithError(err error) *KubernetesApiMock
WithError sets the error to be returned by the mock API.
type KubernetesAppConnectionInfo ¶
type KubernetesAppConnectionInfo struct {
Name string
PublicEndpoint string
AdminUsername string
AdminPassword string
Error error
}
KubernetesAppConnectionInfo contains information about an application's connection in Kubernetes.
type KubernetesClient ¶
type KubernetesClient struct {
// contains filtered or unexported fields
}
KubernetesClient is the implementation of the Kubernetes provider client.
func NewKubernetesClient ¶
func NewKubernetesClient(api KubernetesApi, kubeconfig KubeconfigInfo, cfg quartzSchema.QuartzConfig) (KubernetesClient, error)
NewKubernetesClient creates a new KubernetesClient instance.
func (KubernetesClient) AssessExternalSecretsTeardown ¶ added in v1.1.0
func (c KubernetesClient) AssessExternalSecretsTeardown(ctx context.Context) (ExternalSecretsTeardownAssessment, error)
AssessExternalSecretsTeardown determines whether a timed-out external-secrets Helm uninstall is only a stale bookkeeping problem or whether real release resources still remain. Missing CRDs are treated as already-cleaned-up, which is the expected steady state late in teardown.
func (KubernetesClient) CheckAccess ¶
func (c KubernetesClient) CheckAccess(ctx context.Context) ProviderCheckResult
CheckAccess checks access to the Kubernetes cluster.
func (KubernetesClient) CheckPodHealth ¶ added in v1.1.0
func (c KubernetesClient) CheckPodHealth(ctx context.Context, namespace string, appLabel string) (PodHealthStatus, error)
CheckPodHealth checks the health of pods matching the given app label in a namespace. If namespace is empty, checks all namespaces. Returns a PodHealthStatus summary.
func (KubernetesClient) CleanupStuckTerminatingPods ¶ added in v1.0.7
func (c KubernetesClient) CleanupStuckTerminatingPods(ctx context.Context, timeout time.Duration) ([]string, error)
CleanupStuckTerminatingPods force-deletes pods that have been stuck in Terminating state for longer than the specified timeout. This handles scenarios where pods cannot terminate gracefully due to CNI issues or other infrastructure problems.
func (KubernetesClient) ClusterProgressSnapshot ¶ added in v1.1.0
func (c KubernetesClient) ClusterProgressSnapshot(ctx context.Context) (ClusterProgress, error)
ClusterProgressSnapshot collects a lightweight health snapshot of the cluster: HelmRelease readiness, namespaces stuck Terminating, and unhealthy pods. It is read-only and best-effort — individual collection failures degrade gracefully rather than returning an error, so it is safe to call repeatedly from a background reporter while a cluster is still coming up.
func (KubernetesClient) EnsureKubeconfig ¶
func (c KubernetesClient) EnsureKubeconfig(path string) error
EnsureKubeconfig ensures that the kubeconfig file exists at the specified path.
func (KubernetesClient) Export ¶
func (c KubernetesClient) Export(ctx context.Context, cfg quartzSchema.ExportConfig) (map[string][]byte, error)
Export exports Kubernetes resources based on the provided configuration.
func (KubernetesClient) ForEachDynamicResources ¶
func (c KubernetesClient) ForEachDynamicResources(ctx context.Context, kind schema.GroupVersionResource, ns string, onEachItem func(unstructured.Unstructured)) error
ForEachDynamicResources iterates over all dynamic resources of a specific kind and namespace.
func (KubernetesClient) GetAppConnectionInfo ¶
func (c KubernetesClient) GetAppConnectionInfo(ctx context.Context, name string, opts quartzSchema.ApplicationLookupConfig) KubernetesAppConnectionInfo
GetAppConnectionInfo retrieves connection information for an application.
func (KubernetesClient) GetCleanupStatus ¶ added in v1.1.0
func (c KubernetesClient) GetCleanupStatus(ctx context.Context, ns string, name string) (CleanupStatus, error)
GetCleanupStatus retrieves non-secret cleanup breadcrumbs emitted by the Quartz chart pre-delete hook.
func (KubernetesClient) GetConfigMapValue ¶
func (c KubernetesClient) GetConfigMapValue(ctx context.Context, ns string, name string) (map[string]string, error)
GetConfigMapValue retrieves the key-value pairs from a ConfigMap.
func (KubernetesClient) GetDaemonSetStatus ¶ added in v1.0.7
func (c KubernetesClient) GetDaemonSetStatus(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) (int64, int64, error)
GetDaemonSetStatus retrieves the ready and desired replica counts for a DaemonSet. This is used to verify that all DaemonSet pods are running on all applicable nodes, which is critical for CNI plugins like istio-cni that must be fully deployed before other pods can be scheduled.
func (KubernetesClient) GetDynamicResource ¶
func (c KubernetesClient) GetDynamicResource(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) (map[string]interface{}, error)
GetDynamicResource retrieves a dynamic resource from the cluster.
func (KubernetesClient) GetSecret ¶
func (c KubernetesClient) GetSecret(ctx context.Context, ns string, name string) (*corev1.Secret, error)
GetSecret retrieves a Secret from the cluster.
func (KubernetesClient) GetSecretValue ¶
func (c KubernetesClient) GetSecretValue(ctx context.Context, ns string, name string) (map[string]string, error)
GetSecretValue retrieves the key-value pairs from a Secret.
func (KubernetesClient) InterStageCleanup ¶ added in v1.1.0
func (c KubernetesClient) InterStageCleanup(ctx context.Context) error
InterStageCleanup performs lightweight K8s cleanup between stage destroys. It catches issues that emerge after a stage is destroyed (e.g., orphaned webhooks, stuck finalizers on services whose controller was just destroyed).
func (KubernetesClient) ListVirtualServices ¶ added in v1.0.7
func (c KubernetesClient) ListVirtualServices(ctx context.Context) (result []VirtualServiceInfo, err error)
ListVirtualServices returns all VirtualServices in the cluster with their hosts and gateways.
func (KubernetesClient) LookupKind ¶
func (c KubernetesClient) LookupKind(ctx context.Context, kind string) (schema.GroupVersionResource, error)
LookupKind looks up the GroupVersionResource for a given kind.
func (KubernetesClient) PrepareForDestroy ¶ added in v1.1.0
func (c KubernetesClient) PrepareForDestroy(ctx context.Context) error
PrepareForDestroy monitors the cluster before infrastructure destruction. The actual cleanup is handled by Helm pre-delete hooks in the base and karpenter_resources charts. This function verifies that the cluster is in a state ready for destruction and logs any cleanup that appears incomplete.
The cleanup phases (defined in Helm hooks):
- Delete LoadBalancer Services → LB controller removes NLBs and their SGs
- Scale Flux controllers to 0 → prevents re-reconciliation during cleanup
- Strip finalizers from Flux CRs → unblocks CR deletion
- Delete all Flux CRs → removes objects that would block CRD/namespace deletion
- Drain Karpenter nodes → terminates Karpenter-managed EC2 instances
- Evict all pods from managed nodes → triggers CNI DEL for each pod → ENI release
- Delete aws-node DaemonSet → graceful CNI shutdown releases trunk/branch ENIs
- Patch stuck namespaces → removes finalizers on Terminating namespaces
If cleanup via hooks is incomplete, this function will explicitly handle the cleanup to ensure infrastructure destruction can proceed.
func (KubernetesClient) PrintClusterAppInfo ¶
func (c KubernetesClient) PrintClusterAppInfo(ctx context.Context, apps map[string]quartzSchema.ApplicationLookupConfig)
PrintClusterAppInfo prints detailed information about the specified applications in the cluster.
func (KubernetesClient) PrintClusterInfo ¶
func (c KubernetesClient) PrintClusterInfo(ctx context.Context)
PrintClusterInfo prints information about the cluster and its applications.
func (KubernetesClient) PrintDiscoveredVirtualServices ¶ added in v1.0.7
func (c KubernetesClient) PrintDiscoveredVirtualServices(ctx context.Context, excludeNames map[string]bool)
PrintDiscoveredVirtualServices prints VirtualServices that are not in the configured applications.
func (KubernetesClient) ProviderName ¶
func (c KubernetesClient) ProviderName() string
ProviderName returns the name of the provider.
func (KubernetesClient) QueryPrometheus ¶ added in v1.1.0
func (c KubernetesClient) QueryPrometheus(ctx context.Context, ns string, service string, port int, query string) (PrometheusQueryResponse, error)
func (KubernetesClient) ReapOrphanedAdmissionWebhooks ¶ added in v1.1.0
func (c KubernetesClient) ReapOrphanedAdmissionWebhooks(ctx context.Context) ([]string, error)
ReapOrphanedAdmissionWebhooks deletes Validating/MutatingWebhookConfigurations whose backing Service no longer exists. Such "dangling" webhooks are a common failure mode for admission controllers (e.g. Kyverno, cert-manager) that create their webhook configurations dynamically at runtime: when the controller's Helm release is uninstalled, the Deployment/Service/namespace are removed but the cluster-scoped webhook configurations are left behind. With failurePolicy: Fail, every admission call then targets a dead service and fails, deadlocking ALL resource creation cluster-wide (no new pods, no Helm reconciles, even the controller cannot be reinstalled).
A webhook is only reaped when its backing Service returns NotFound — i.e. the operator is already gone, so there is no live policy enforcement to preserve. Transient API errors are ignored so a brief apiserver hiccup never removes a healthy webhook. Returns the names of the webhook configurations that were removed.
func (KubernetesClient) RefreshExternalSecrets ¶
func (c KubernetesClient) RefreshExternalSecrets(ctx context.Context) ([]KubernetesResource, error)
RefreshExternalSecrets triggers a refresh of external secrets in the cluster.
func (KubernetesClient) Restart ¶
func (c KubernetesClient) Restart(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) error
Restart restarts resources of a specific kind in the cluster.
func (KubernetesClient) ScrubStuckHelmReleaseSecrets ¶ added in v1.1.0
func (c KubernetesClient) ScrubStuckHelmReleaseSecrets(ctx context.Context, minAge time.Duration) ([]string, error)
ScrubStuckHelmReleaseSecrets deletes Helm v3 release-record Secrets that are stuck in a non-terminal status (uninstalling, pending-install, pending-upgrade, pending-rollback). Helm stores one Secret per release revision (type "helm.sh/release.v1") and refuses to start a new operation while the latest revision is in one of these transient states, failing with "another operation (install/upgrade/rollback) is in progress". This happens when a destroy is interrupted or a controller dies mid-uninstall, and it deadlocks any subsequent re-install of that release.
Only transient-status records are removed; "deployed", "failed", and "superseded" revisions are left intact so release history and rollback targets are preserved. Returns the namespace/name of each scrubbed secret.
minAge guards against orphaning a release that a controller is *actively* reconciling: a transient record younger than minAge is left alone, because helm-controller creates the pending revision secret at the start of an operation and expects to find it when finishing. Deleting that secret out from under an in-flight upgrade leaves the controller looping forever on "secrets sh.helm.release.v1.<name>.v<N> not found". Pass 0 to scrub unconditionally (safe during teardown, when Flux is already suspended and no reconciliation is in progress).
func (KubernetesClient) Update ¶
func (c KubernetesClient) Update(ctx context.Context, kind schema.GroupVersionResource, ns string, obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
Update updates a dynamic resource in the cluster.
func (KubernetesClient) WaitConditionState ¶
func (c KubernetesClient) WaitConditionState(ctx context.Context, kind schema.GroupVersionResource, ns string, name string, state string, timeoutSeconds int) error
WaitConditionState waits for a resource to reach a specific condition state.
func (KubernetesClient) WriteKubeconfig ¶
func (c KubernetesClient) WriteKubeconfig(w io.Writer) error
WriteKubeconfig writes the kubeconfig to the provided writer.
func (KubernetesClient) WriteKubeconfigFile ¶
func (c KubernetesClient) WriteKubeconfigFile(path string) error
WriteKubeconfigFile writes the kubeconfig to the specified file path.
type KubernetesLookupCache ¶
type KubernetesLookupCache struct {
// contains filtered or unexported fields
}
KubernetesLookupCache is a cache for Kubernetes resource kinds.
type KubernetesProviderCheckResult ¶
type KubernetesProviderCheckResult struct {
Status bool
Error error
// contains filtered or unexported fields
}
func (KubernetesProviderCheckResult) ToTable ¶
func (r KubernetesProviderCheckResult) ToTable() ([]string, []ProviderCheckResultRow)
ToTable converts the KubernetesProviderCheckResult into table headers and rows for display.
type KubernetesProviderClient ¶
type KubernetesProviderClient interface {
Provider
LookupKind(ctx context.Context, kind string) (schema.GroupVersionResource, error)
WaitConditionState(ctx context.Context, kind schema.GroupVersionResource, ns string, name string, state string, timeoutSeconds int) error
PrintClusterInfo(ctx context.Context)
WriteKubeconfigFile(path string) error
RefreshExternalSecrets(ctx context.Context) ([]KubernetesResource, error)
Export(ctx context.Context, cfg quartzSchema.ExportConfig) (map[string][]byte, error)
GetConfigMapValue(ctx context.Context, ns string, name string) (map[string]string, error)
QueryPrometheus(ctx context.Context, ns string, service string, port int, query string) (PrometheusQueryResponse, error)
GetCleanupStatus(ctx context.Context, ns string, name string) (CleanupStatus, error)
GetSecretValue(ctx context.Context, ns string, name string) (map[string]string, error)
Restart(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) error
GetDaemonSetStatus(ctx context.Context, kind schema.GroupVersionResource, ns string, name string) (int64, int64, error)
CleanupStuckTerminatingPods(ctx context.Context, timeout time.Duration) ([]string, error)
ReapOrphanedAdmissionWebhooks(ctx context.Context) ([]string, error)
ScrubStuckHelmReleaseSecrets(ctx context.Context, minAge time.Duration) ([]string, error)
AssessExternalSecretsTeardown(ctx context.Context) (ExternalSecretsTeardownAssessment, error)
ClusterProgressSnapshot(ctx context.Context) (ClusterProgress, error)
ListVirtualServices(ctx context.Context) ([]VirtualServiceInfo, error)
PrepareForDestroy(ctx context.Context) error
InterStageCleanup(ctx context.Context) error
}
KubernetesProviderClient defines the interface for Kubernetes provider clients.
type KubernetesResource ¶
type KubernetesResource struct {
Name string
Namespace string
Kind schema.GroupVersionResource
Item unstructured.Unstructured
}
KubernetesResource represents a Kubernetes resource.
type LazyAwsSdkClient ¶
type LazyAwsSdkClient struct {
// contains filtered or unexported fields
}
LazyAwsSdkClient is a lazy-loading implementation of AWS SDK clients. It initializes clients only when they are accessed.
func (*LazyAwsSdkClient) Dynamodb ¶
func (c *LazyAwsSdkClient) Dynamodb() DynamodbClient
Dynamodb returns a lazily initialized DynamoDB client.
func (*LazyAwsSdkClient) Eks ¶
func (c *LazyAwsSdkClient) Eks() EksClient
Eks returns a lazily initialized EKS client.
func (*LazyAwsSdkClient) EksTokenGenerator ¶
func (c *LazyAwsSdkClient) EksTokenGenerator() (token.Generator, error)
EksTokenGenerator returns a new EKS token generator.
func (*LazyAwsSdkClient) Iam ¶
func (c *LazyAwsSdkClient) Iam() IamClient
Iam returns a lazily initialized IAM client.
func (*LazyAwsSdkClient) S3 ¶
func (c *LazyAwsSdkClient) S3() S3Client
S3 returns a lazily initialized S3 client.
func (*LazyAwsSdkClient) S3Region ¶
func (c *LazyAwsSdkClient) S3Region(region string) S3Client
S3Region returns an S3 client configured for the specified region.
func (*LazyAwsSdkClient) Sts ¶
func (c *LazyAwsSdkClient) Sts() StsClient
Sts returns a lazily initialized STS client.
type LocalClient ¶
type LocalClient struct {
Name string // The name of the local cluster.
}
LocalClient represents a local provider client.
func (LocalClient) CheckAccess ¶
func (c LocalClient) CheckAccess(ctx context.Context) ProviderCheckResult
CheckAccess performs an access check for the local provider. Always returns an EmptyProviderCheckResult as no access check is required.
func (LocalClient) CheckConfig ¶
func (c LocalClient) CheckConfig() error
CheckConfig validates the configuration for the local provider. Always returns nil as no validation is required for the local provider.
func (LocalClient) CreateStateBackend ¶
func (c LocalClient) CreateStateBackend(_ context.Context) error
CreateStateBackend skips the creation of a state backend for the local provider. Logs a message indicating that the operation is skipped.
func (LocalClient) CurrentIdentity ¶
func (c LocalClient) CurrentIdentity(ctx context.Context) (CloudProviderIdentity, error)
CurrentIdentity returns the identity of the local provider. Always returns a static identity for the local provider.
func (LocalClient) DestroyStateBackend ¶
func (c LocalClient) DestroyStateBackend(_ context.Context) error
DestroyStateBackend skips the destruction of a state backend for the local provider. Logs a message indicating that the operation is skipped.
func (LocalClient) KubeconfigInfo ¶
func (c LocalClient) KubeconfigInfo(ctx context.Context) (KubeconfigInfo, error)
KubeconfigInfo returns an error as kubeconfig information is not supported for the local provider.
func (LocalClient) PrepareAccount ¶
func (c LocalClient) PrepareAccount(ctx context.Context) error
PrepareAccount performs no operation for the local provider. Always returns nil as no account preparation is required.
func (LocalClient) PrintClusterInfo ¶
func (c LocalClient) PrintClusterInfo(ctx context.Context) error
PrintClusterInfo performs no operation for the local provider. Always returns nil as no cluster information is available.
func (LocalClient) PrintConfig ¶
func (c LocalClient) PrintConfig()
PrintConfig prints the configuration of the local provider. Displays the name of the local cluster in a table format.
func (LocalClient) ProviderName ¶
func (c LocalClient) ProviderName() string
ProviderName returns the name of the provider.
func (LocalClient) StateBackendExists ¶ added in v1.1.0
func (c LocalClient) StateBackendExists(_ context.Context) (bool, error)
StateBackendExists always reports true for the local provider: there is no remote backend to probe, so the teardown should always run its normal path rather than short-circuiting.
func (LocalClient) StateBackendInfo ¶
func (c LocalClient) StateBackendInfo(_ string) CloudProviderStateBackend
StateBackendInfo returns the state backend information for the local provider. Always returns a static state backend configuration.
type PodHealthStatus ¶ added in v1.1.0
type PodHealthStatus struct {
TotalPods int
ReadyPods int
CrashLooping []string // Pod names in CrashLoopBackOff
ImagePullErr []string // Pod names with ImagePullBackOff/ErrImagePull
InitErrors []string // Pod names stuck in Init
PendingPods []string // Pod names in Pending state
}
func (PodHealthStatus) IsHealthy ¶ added in v1.1.0
func (s PodHealthStatus) IsHealthy() bool
IsHealthy returns true if no pods are in a terminal error state.
type PrometheusQueryData ¶ added in v1.1.0
type PrometheusQueryData struct {
ResultType string `json:"resultType"`
Result []PrometheusQueryResult `json:"result"`
}
type PrometheusQueryResponse ¶ added in v1.1.0
type PrometheusQueryResponse struct {
Status string `json:"status"`
Data PrometheusQueryData `json:"data"`
ErrorType string `json:"errorType,omitempty"`
Error string `json:"error,omitempty"`
}
func (PrometheusQueryResponse) ScalarValue ¶ added in v1.1.0
func (r PrometheusQueryResponse) ScalarValue() (float64, bool)
type PrometheusQueryResult ¶ added in v1.1.0
type Provider ¶
type Provider interface {
// ProviderName returns the name of the provider.
ProviderName() string
// CheckAccess performs an access check for the provider.
CheckAccess(context.Context) ProviderCheckResult
}
Provider defines the interface for all providers.
func NewImageRegistryProviderClient ¶
func NewImageRegistryProviderClient(ctx context.Context, cfg schema.QuartzConfig, secrets schema.QuartzSecrets) (Provider, error)
NewImageRegistryProviderClient creates a new image registry provider client based on the configuration and secrets. If image repository mirroring is disabled, it initializes an Ironbank client. Otherwise, it initializes a GitHub client.
func NewSourceControlProviderClient ¶
func NewSourceControlProviderClient(ctx context.Context, cfg schema.QuartzConfig, secrets schema.QuartzSecrets) (Provider, error)
NewSourceControlProviderClient creates a new source control provider client.
type ProviderCheckOpts ¶
type ProviderCheckOpts struct {
// contains filtered or unexported fields
}
ProviderCheckOpts contains options for performing provider checks.
func NewProviderCheckOpts ¶
func NewProviderCheckOpts(ctx context.Context, f ProviderFactory) ProviderCheckOpts
NewProviderCheckOpts creates a new ProviderCheckOpts instance. It initializes the list of providers to check by iterating over the provided factory.
type ProviderCheckResult ¶
type ProviderCheckResult interface {
// ToTable converts the check result into table headers and rows.
ToTable() ([]string, []ProviderCheckResultRow)
}
IProviderCheckResult defines the interface for provider check results.
type ProviderCheckResultRow ¶
type ProviderCheckResultRow struct {
Status bool // Status indicates whether the check was successful.
Data []string // Data contains the row's data fields.
Error error // Error contains any error associated with the row.
}
ProviderCheckResultRow represents a single row in the provider check result table.
type ProviderFactory ¶
type ProviderFactory struct {
// contains filtered or unexported fields
}
ProviderFactory is responsible for creating and managing provider clients.
func NewProviderFactory ¶
func NewProviderFactory(cfg schema.QuartzConfig, secrets schema.QuartzSecrets, opts ...ProviderFactoryOption) *ProviderFactory
NewProviderFactory creates a new ProviderFactory with the given configuration and secrets.
func (*ProviderFactory) Cloud ¶
func (f *ProviderFactory) Cloud(ctx context.Context) (CloudProviderClient, error)
Cloud returns the cloud provider client, initializing it if necessary.
func (*ProviderFactory) Dns ¶
func (f *ProviderFactory) Dns(ctx context.Context) (DnsProviderClient, error)
Dns returns the DNS provider client, initializing it if necessary.
func (*ProviderFactory) ImageRegistry ¶
func (f *ProviderFactory) ImageRegistry(ctx context.Context) (Provider, error)
ImageRegistry returns the image registry provider client, initializing it if necessary.
func (*ProviderFactory) Kubernetes ¶
func (f *ProviderFactory) Kubernetes(ctx context.Context) (KubernetesProviderClient, error)
Kubernetes returns the Kubernetes provider client, initializing it if necessary.
func (*ProviderFactory) SourceControl ¶
func (f *ProviderFactory) SourceControl(ctx context.Context) (Provider, error)
SourceControl returns the source control provider client, initializing it if necessary.
type ProviderFactoryOption ¶
type ProviderFactoryOption func(*ProviderFactory)
func WithCloudProvider ¶
func WithCloudProvider(p CloudProviderClient) ProviderFactoryOption
WithCloudProvider sets the cloud provider client and returns the updated factory.
func WithConfig ¶
func WithConfig(c schema.QuartzConfig) ProviderFactoryOption
WithConfig sets the Quartz configuration and returns the updated factory.
func WithDnsProvider ¶
func WithDnsProvider(p DnsProviderClient) ProviderFactoryOption
WithDnsProvider sets the DNS provider client and returns the updated factory.
func WithImageRegistryProvider ¶
func WithImageRegistryProvider(p Provider) ProviderFactoryOption
WithImageRegistryProvider sets the image registry provider client and returns the updated factory.
func WithKubernetesProvider ¶
func WithKubernetesProvider(p KubernetesProviderClient) ProviderFactoryOption
WithKubernetesProvider sets the Kubernetes provider client and returns the updated factory.
func WithSecrets ¶
func WithSecrets(s schema.QuartzSecrets) ProviderFactoryOption
WithSecrets sets the Quartz secrets and returns the updated factory.
func WithSourceControlProvider ¶
func WithSourceControlProvider(p Provider) ProviderFactoryOption
WithSourceControlProvider sets the source control provider client and returns the updated factory.
type S3Client ¶
type S3Client interface {
HeadBucket(ctx context.Context, params *s3.HeadBucketInput, optFns ...func(*s3.Options)) (*s3.HeadBucketOutput, error)
CreateBucket(ctx context.Context, params *s3.CreateBucketInput, optFns ...func(*s3.Options)) (*s3.CreateBucketOutput, error)
DeleteBucket(ctx context.Context, params *s3.DeleteBucketInput, optFns ...func(*s3.Options)) (*s3.DeleteBucketOutput, error)
ListObjectVersions(ctx context.Context, params *s3.ListObjectVersionsInput, optFns ...func(*s3.Options)) (*s3.ListObjectVersionsOutput, error)
DeleteObjects(ctx context.Context, params *s3.DeleteObjectsInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectsOutput, error)
}
S3Client defines the interface for interacting with AWS S3.