Skip to content

reset deploy state #2945

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

Merged
merged 2 commits into from
Oct 3, 2019
Merged

Conversation

tejal29
Copy link
Contributor

@tejal29 tejal29 commented Sep 25, 2019

Relates to #2940, #176

Description
Reset Deploy state when a Deploy Trigger is received or via Control API, a deploy request is sent.

Before
skaffold Build from master, run with RPC.

  1. cd examples/microservices
skaffold dev --default-repo=gcr.io/tejal-test --auto-deploy=false --enable-rpc -v=debug --port-forward
  1. Change a file (only build shd happen)
  2. Sent a deploy intent and get the state
$ curl localhost:50052/v1/execute -d '{"deploy": true}' &&  localhost:50052/v1/state | jq
{}  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   453  100   453    0     0   221k      0 --:--:-- --:--:-- --:--:--  221k
{
  "buildState": {
    "artifacts": {
      "gcr.io/tejal-test/gcr.io/k8s-skaffold/leeroy-app": "Complete",
      "gcr.io/tejal-test/gcr.io/k8s-skaffold/leeroy-web": "Complete"
    }
  },
  "deployState": {
    "status": "Complete"
  },
  "forwardedPorts": {
    "9000": {
      "localPort": 9000,
      "remotePort": 8080,
      "namespace": "default",
      "resourceType": "deployment",
      "resourceName": "leeroy-web"
    },
    "50053": {
      "localPort": 50053,
      "remotePort": 50051,
      "namespace": "default",
      "resourceType": "service",
      "resourceName": "leeroy-app"
    }
  }
}

Note: Deploy state is complete.
After

  1. skaffold Build from master, run with RPC.
cd examples/microservices
../../out/skaffold dev --default-repo=gcr.io/tejal-test  --auto-deploy=false --enable-rpc -v=debug --port-forward
  1. Change a file ( Only Build shd happen)

  2. Send a deploy intent and curl the state

tejaldesai@@skaffold (reset-on-deploy)$ curl localhost:50052/v1/execute -d '{"deploy": true}' && curl localhost:50052/v1/state | jq
{}  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   237  100   237    0     0   231k      0 --:--:-- --:--:-- --:--:--  231k
{
  "buildState": {
    "artifacts": {
      "gcr.io/tejal-test/gcr.io/k8s-skaffold/leeroy-app": "Complete",
      "gcr.io/tejal-test/gcr.io/k8s-skaffold/leeroy-web": "Complete"
    }
  },
  "deployState": {
    "status": "Not Started"
  },
  "statusCheckState": {
    "status": "Not Started"
  }
}

Next PRs.
None

Submitter Checklist

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

  • Includes unit tests
  • Mentions any output changes.
  • Adds documentation as needed: user docs, YAML reference, CLI reference.
  • 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

Describe any user facing changes here so maintainer can include it in the release notes, or delete this block.

@codecov
Copy link

codecov bot commented Sep 25, 2019

Codecov Report

Merging #2945 into master will increase coverage by 0.01%.
The diff coverage is 87.5%.

Impacted Files Coverage Δ
pkg/skaffold/server/endpoints.go 0% <0%> (ø) ⬆️
pkg/skaffold/runner/dev.go 67.96% <100%> (+0.31%) ⬆️
pkg/skaffold/event/event.go 92.21% <100%> (+0.19%) ⬆️

Copy link
Contributor

@priyawadhwa priyawadhwa left a comment

Choose a reason for hiding this comment

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

LGTM

@tejal29 tejal29 merged commit b9d0f0c into GoogleContainerTools:master Oct 3, 2019
@tejal29 tejal29 deleted the reset-on-deploy branch April 15, 2021 07:35
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