mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-13 23:36:51 +00:00
Always report components health in bootstrap
This is useful in case the `Kustomization` does not reconcile successfully because for example the controller(s) are in a crash loop, which is not visible in the resource itself. Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
parent
d434575047
commit
ea451e7e49
5 changed files with 62 additions and 23 deletions
|
|
@ -47,5 +47,6 @@ type Git interface {
|
|||
Commit(message Commit) (string, error)
|
||||
Push(ctx context.Context) error
|
||||
Status() (bool, error)
|
||||
Head() (string, error)
|
||||
Path() string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,6 +212,17 @@ func (g *GoGit) Status() (bool, error) {
|
|||
return status.IsClean(), nil
|
||||
}
|
||||
|
||||
func (g *GoGit) Head() (string, error) {
|
||||
if g.repository == nil {
|
||||
return "", git.ErrNoGitRepository
|
||||
}
|
||||
head, err := g.repository.Head()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return head.Hash().String(), nil
|
||||
}
|
||||
|
||||
func (g *GoGit) Path() string {
|
||||
return g.path
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue