mirror of
https://github.com/fluxcd/flux2.git
synced 2026-04-14 15:56:52 +00:00
show cluster instance name and version in flux check and flux version
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
parent
62ac960273
commit
fd163ddcf2
5 changed files with 122 additions and 49 deletions
|
|
@ -45,6 +45,16 @@ type StatusChecker struct {
|
|||
logger log.Logger
|
||||
}
|
||||
|
||||
func NewStatusCheckerWithClient(c client.Client, pollInterval time.Duration, timeout time.Duration, log log.Logger) (*StatusChecker, error) {
|
||||
return &StatusChecker{
|
||||
pollInterval: pollInterval,
|
||||
timeout: timeout,
|
||||
client: c,
|
||||
statusPoller: polling.NewStatusPoller(c, c.RESTMapper(), polling.Options{}),
|
||||
logger: log,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func NewStatusChecker(kubeConfig *rest.Config, pollInterval time.Duration, timeout time.Duration, log log.Logger) (*StatusChecker, error) {
|
||||
restMapper, err := runtimeclient.NewDynamicRESTMapper(kubeConfig)
|
||||
if err != nil {
|
||||
|
|
@ -55,13 +65,7 @@ func NewStatusChecker(kubeConfig *rest.Config, pollInterval time.Duration, timeo
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return &StatusChecker{
|
||||
pollInterval: pollInterval,
|
||||
timeout: timeout,
|
||||
client: c,
|
||||
statusPoller: polling.NewStatusPoller(c, restMapper, polling.Options{}),
|
||||
logger: log,
|
||||
}, nil
|
||||
return NewStatusCheckerWithClient(c, pollInterval, timeout, log)
|
||||
}
|
||||
|
||||
func (sc *StatusChecker) Assess(identifiers ...object.ObjMetadata) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue