mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-18 11:37:08 +02:00
zero/healthchecks: add checks for ability to save bootstrap parameter and bundle status reporting (#5064)
This commit is contained in:
parent
25aceea626
commit
dc7820ea3e
5 changed files with 33 additions and 69 deletions
|
@ -127,43 +127,3 @@ func (api *API) GetClusterResourceBundles(ctx context.Context) (*cluster_api.Get
|
|||
api.cluster.GetClusterResourceBundlesWithResponse(ctx),
|
||||
)
|
||||
}
|
||||
|
||||
// ReportBundleAppliedSuccess reports a successful bundle application
|
||||
func (api *API) ReportBundleAppliedSuccess(ctx context.Context, bundleID string, metadata map[string]string) error {
|
||||
status := cluster_api.BundleStatus{
|
||||
Success: &cluster_api.BundleStatusSuccess{
|
||||
Metadata: metadata,
|
||||
},
|
||||
}
|
||||
|
||||
_, err := apierror.CheckResponse[cluster_api.EmptyResponse](
|
||||
api.cluster.ReportClusterResourceBundleStatusWithResponse(ctx, bundleID, status),
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error reporting bundle status: %w", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// ReportBundleAppliedFailure reports a failed bundle application
|
||||
func (api *API) ReportBundleAppliedFailure(
|
||||
ctx context.Context,
|
||||
bundleID string,
|
||||
source cluster_api.BundleStatusFailureSource,
|
||||
err error,
|
||||
) error {
|
||||
status := cluster_api.BundleStatus{
|
||||
Failure: &cluster_api.BundleStatusFailure{
|
||||
Message: err.Error(),
|
||||
Source: source,
|
||||
},
|
||||
}
|
||||
|
||||
_, err = apierror.CheckResponse[cluster_api.EmptyResponse](
|
||||
api.cluster.ReportClusterResourceBundleStatusWithResponse(ctx, bundleID, status),
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error reporting bundle status: %w", err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue