Skip to content

reset deploy state#2945

Merged
tejal29 merged 2 commits intoGoogleContainerTools:masterfrom
tejal29:reset-on-deploy
Oct 3, 2019
Merged

reset deploy state#2945
tejal29 merged 2 commits intoGoogleContainerTools:masterfrom
tejal29:reset-on-deploy

Conversation

@tejal29
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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