Skip to content

Commit

Permalink
Merge pull request #1637 from replicatedhq/divolgin/preflight-status
Browse files Browse the repository at this point in the history
Add progress percentage to preflight collectors
  • Loading branch information
divolgin committed Mar 19, 2021
2 parents 76c62db + ea0f5af commit d65eb6d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ require (
github.com/pierrec/lz4 v2.2.6+incompatible // indirect
github.com/pkg/errors v0.9.1
github.com/replicatedhq/kurl/kurlkinds v0.0.0-20210227025942-3b373149acb7
github.com/replicatedhq/troubleshoot v0.10.11
github.com/replicatedhq/troubleshoot v0.10.12
github.com/replicatedhq/yaml/v3 v3.0.0-beta5-replicatedhq
github.com/robfig/cron v1.1.0
github.com/robfig/cron/v3 v3.0.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1169,8 +1169,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uY
github.com/replicatedhq/kurl/kurlkinds v0.0.0-20210227025942-3b373149acb7 h1:AeeWDSNVtms4pqKwNS65BoZvjP5l2GvSTzbtUrHeDwI=
github.com/replicatedhq/kurl/kurlkinds v0.0.0-20210227025942-3b373149acb7/go.mod h1:LNkb/bMcnPPv8KLuTAKWkBzWFTo19ncFf+UzxGNwhNM=
github.com/replicatedhq/termui/v3 v3.1.1-0.20200811145416-f40076d26851/go.mod h1:JDxG6+uubnk9/BZ2yUsyAJJwlptjrnmB2MPF5d2Xe/8=
github.com/replicatedhq/troubleshoot v0.10.11 h1:6HdQAoxSqSgmjZmB/HZBFdEaYk0Bv66ahw012ach/sk=
github.com/replicatedhq/troubleshoot v0.10.11/go.mod h1:szF/UQfsZWjshzJz3XylS1uEpkRDyGcNY2BZHcI+9DU=
github.com/replicatedhq/troubleshoot v0.10.12 h1:2cjD7W/zwohYMVfaMf8jwT5+vViSn3g/yVZAzSmpd3g=
github.com/replicatedhq/troubleshoot v0.10.12/go.mod h1:szF/UQfsZWjshzJz3XylS1uEpkRDyGcNY2BZHcI+9DU=
github.com/replicatedhq/yaml/v3 v3.0.0-beta5-replicatedhq h1:PwPggruelq2336c1Ayg5STFqgbn/QB1tWLQwrVlU7ZQ=
github.com/replicatedhq/yaml/v3 v3.0.0-beta5-replicatedhq/go.mod h1:Txa7LopbYCU8aRgmNe0n+y/EPMz50NbCPcVVJBquwag=
github.com/robfig/cron v1.1.0 h1:jk4/Hud3TTdcrJgUOBgsqrZBarcxl6ADIjSC2iniwLY=
Expand Down
2 changes: 1 addition & 1 deletion kotsadm/operator/Dockerfile.skaffold
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN /install-krew.sh
ENV PATH="/root/.krew/bin:$PATH"

# Install our plugins
ENV TROUBLESHOOT_VERSION=0.10.10
ENV TROUBLESHOOT_VERSION=0.10.12

## This is used when we aren't on a release of preflight
RUN curl -L "https://github.com/replicatedhq/troubleshoot/releases/download/v${TROUBLESHOOT_VERSION}/preflight_linux_amd64.tar.gz" > /tmp/preflight.tar.gz && \
Expand Down
2 changes: 1 addition & 1 deletion kotsadm/operator/deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ COPY --chown=kotsadm-operator:kotsadm-operator ./bin/kotsadm-operator /kotsadm-o

# Install our plugins
USER root
ENV TROUBLESHOOT_VERSION=0.10.10
ENV TROUBLESHOOT_VERSION=0.10.12
RUN curl -L "https://github.com/replicatedhq/troubleshoot/releases/download/v${TROUBLESHOOT_VERSION}/preflight_linux_amd64.tar.gz" > /tmp/preflight.tar.gz && \
cd /tmp && tar xzvf preflight.tar.gz && \
mv /tmp/preflight /usr/local/bin/kubectl-preflight
Expand Down
2 changes: 1 addition & 1 deletion kotsadm/operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/mitchellh/hashstructure v1.1.0
github.com/pact-foundation/pact-go v1.5.1
github.com/pkg/errors v0.9.1
github.com/replicatedhq/troubleshoot v0.10.11
github.com/replicatedhq/troubleshoot v0.10.12
github.com/spf13/cobra v0.0.7
github.com/spf13/viper v1.4.0
gopkg.in/yaml.v2 v2.3.0
Expand Down
4 changes: 2 additions & 2 deletions kotsadm/operator/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQl
github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
github.com/replicatedhq/termui/v3 v3.1.1-0.20200811145416-f40076d26851/go.mod h1:JDxG6+uubnk9/BZ2yUsyAJJwlptjrnmB2MPF5d2Xe/8=
github.com/replicatedhq/troubleshoot v0.10.11 h1:6HdQAoxSqSgmjZmB/HZBFdEaYk0Bv66ahw012ach/sk=
github.com/replicatedhq/troubleshoot v0.10.11/go.mod h1:szF/UQfsZWjshzJz3XylS1uEpkRDyGcNY2BZHcI+9DU=
github.com/replicatedhq/troubleshoot v0.10.12 h1:2cjD7W/zwohYMVfaMf8jwT5+vViSn3g/yVZAzSmpd3g=
github.com/replicatedhq/troubleshoot v0.10.12/go.mod h1:szF/UQfsZWjshzJz3XylS1uEpkRDyGcNY2BZHcI+9DU=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
Expand Down
13 changes: 5 additions & 8 deletions pkg/preflight/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,13 @@ func execute(appID string, sequence int64, preflightSpec *troubleshootv1beta2.Pr
continue
}

type CollectProgress struct {
Name string
Status string
}

// TODO: We need a nice title to display
progresBytes, err := json.Marshal(map[string]interface{}{
"name": progress.Name,
"status": progress.Status,
"updatedAt": time.Now().Format(time.RFC3339),
"completedCount": progress.CompletedCount,
"totalCount": progress.TotalCount,
"currentName": progress.CurrentName,
"currentStatus": progress.CurrentStatus,
"updatedAt": time.Now().Format(time.RFC3339),
})
if err != nil {
continue
Expand Down

0 comments on commit d65eb6d

Please sign in to comment.