mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 01:28:52 +00:00
Add kstatus to install and check commands
Signed-off-by: jonathan-innis <jonathan.innis.ji@gmail.com>
This commit is contained in:
parent
b3d7730e79
commit
b528428d02
6 changed files with 178 additions and 68 deletions
|
|
@ -162,24 +162,14 @@ func applyInstallManifests(ctx context.Context, manifestPath string, components
|
|||
return fmt.Errorf("install failed")
|
||||
}
|
||||
|
||||
kubeConfig, err := utils.KubeConfig(rootArgs.kubeconfig, rootArgs.kubecontext)
|
||||
if err != nil {
|
||||
return fmt.Errorf("install failed")
|
||||
}
|
||||
timeout, err := time.ParseDuration(rootArgs.timeout.String())
|
||||
if err != nil {
|
||||
return fmt.Errorf("install failed")
|
||||
}
|
||||
|
||||
statusChecker := StatusChecker{}
|
||||
if err = statusChecker.New(kubeConfig, timeout); err != nil {
|
||||
return fmt.Errorf("install failed")
|
||||
err := statusChecker.New(time.Second, rootArgs.timeout)
|
||||
if err != nil {
|
||||
return fmt.Errorf("install failed with: %v", err)
|
||||
}
|
||||
if err = statusChecker.AddChecks(components); err != nil {
|
||||
return fmt.Errorf("install failed")
|
||||
}
|
||||
if err = statusChecker.Assess(time.Second); err != nil {
|
||||
return fmt.Errorf("install failed")
|
||||
err = statusChecker.Assess(components...)
|
||||
if err != nil {
|
||||
return fmt.Errorf("install failed with: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue