1
0
mirror of synced 2026-02-06 19:05:55 +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:
Somtochi Onyekwere
2023-11-22 21:01:13 +01:00
parent 62ac960273
commit fd163ddcf2
5 changed files with 122 additions and 49 deletions

View File

@@ -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 {