non-reconciliable & readiness of static objects
Remove reconcile subcommand for static object APIs Alerts and Providers. Add a isStatic() method on all the object adapters to determine if they are static and don't have reconciler. The objects that don't have reconcilers are skipped from reconciliation and readiness checks like HelmRepository of type OCI. Add default ready message for `get` subcommand output for static objects, Alerts, Providers and HelmRepositories of type OCI, as ready message can't be derived for them from their status. Signed-off-by: Sunny <darkowlzz@protonmail.com>
This commit is contained in:
@@ -60,6 +60,7 @@ type reconcilable interface {
|
||||
GetAnnotations() map[string]string
|
||||
SetAnnotations(map[string]string)
|
||||
|
||||
isStatic() bool // is it a static object that does not have a reconciler?
|
||||
lastHandledReconcileRequest() string // what was the last handled reconcile request?
|
||||
successMessage() string // what do you want to tell people when successfully reconciled?
|
||||
}
|
||||
@@ -100,6 +101,11 @@ func (reconcile reconcileCommand) run(cmd *cobra.Command, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if reconcile.object.isStatic() {
|
||||
logger.Successf("reconciliation not supported by the object")
|
||||
return nil
|
||||
}
|
||||
|
||||
if reconcile.object.isSuspended() {
|
||||
return fmt.Errorf("resource is suspended")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user