Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a resourceCounter to track pods #3016

Merged
merged 9 commits into from
Dec 18, 2019

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Oct 8, 2019

Relates to #176

Description
In this PR add a resourceCounter which tracks pods and deployments

  • The pods counter is initialized to 0 and used anywhere.

User facing changes

n/a

Next PRs.

  • Change getDeployStatus and printResourceStatus to use the resourceCounter.pod
  • Fetch pods and add them in the check

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • [ X ] Includes unit tests
  • n/a Mentions any output changes.
  • n/a Adds documentation as needed: user docs, YAML reference, CLI reference.
  • n/a Adds integration tests if needed.

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

  • The code flow looks good.
  • Unit test added.
  • User facing changes look good.

Release Notes

@codecov
Copy link

codecov bot commented Oct 8, 2019

Codecov Report

Merging #3016 into master will increase coverage by 0.16%.
The diff coverage is 84.61%.

Impacted Files Coverage Δ
pkg/skaffold/deploy/status_check.go 67.44% <84.61%> (+11.68%) ⬆️
pkg/skaffold/runner/timings.go 91.83% <0%> (-0.33%) ⬇️
pkg/skaffold/build/custom/custom.go 62.5% <0%> (ø) ⬆️
pkg/skaffold/schema/v1beta16/upgrade.go 77.77% <0%> (ø) ⬆️
pkg/skaffold/runner/build_deploy.go 67.18% <0%> (ø) ⬆️
pkg/skaffold/runner/dev.go 68.22% <0%> (+0.26%) ⬆️
pkg/skaffold/jib/jib_init.go 89.55% <0%> (+0.66%) ⬆️
pkg/skaffold/build/cluster/sources/sources.go 91.58% <0%> (+0.67%) ⬆️
pkg/skaffold/initializer/init.go 57.19% <0%> (+1.16%) ⬆️

Co-Authored-By: Balint Pato <balopat@users.noreply.github.com>
@@ -220,9 +225,34 @@ func newCounter(i int) *counter {
}
}

func (c *counter) markProcessed(err error) int {
func (c *counter) markProcessed(err error) counter {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you think about moving all these instance methods instead into functions, like the style of append?
func markProcessed(c *counter, err error) counter? that will emphasize it even more that these are not state mutations.

@balopat balopat merged commit f408bce into GoogleContainerTools:master Dec 18, 2019
@tejal29 tejal29 deleted the add_pod_counter branch April 15, 2021 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants