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

Expose latestCreatedRevisionName as output #555

Open
kosta opened this issue Dec 23, 2024 · 4 comments · May be fixed by #556
Open

Expose latestCreatedRevisionName as output #555

kosta opened this issue Dec 23, 2024 · 4 comments · May be fixed by #556
Labels
enhancement New feature or request

Comments

@kosta
Copy link

kosta commented Dec 23, 2024

TL;DR

When I deploy a service, I want to know which revision was deployed so that I can run downstream checks about it (e.g. is it ready?)

Detailed design

When invoking the cloud run command-line with format json (as this action does), the status output looks somewhat like this:

{
  "@type": "type.googleapis.com/google.cloud.run.v1.Service",
  "apiVersion": "serving.knative.dev/v1",
  "kind": "Service",
...
  "status": {
    "address": {
      "url": "https://foo.a.run.app"
    },
    "conditions": [...],
    "latestCreatedRevisionName": "foo-00005-vdk",
    "latestReadyRevisionName": "foo-00005-vdk",
    "observedGeneration": 5,
    "traffic": [
      {
        "latestRevision": true,
        "percent": 100,
        "revisionName": "foo-00005-vdk"
      }
    ],
    "url": "https://foo.run.app"
  }
}

Currently, according to the README, only the url is exposed as output. If the latestCreatedRevisionName was exposed as well, it could be used to do downstream checks for that specific revision.

Additional information

Would you accept a PR?

@kosta kosta added the enhancement New feature or request label Dec 23, 2024
@preritdas
Copy link

+1 this would be extremely useful, especially when updating traffic in a subsequent step. Having an output for the created revision name would allow one to then have a step allocating all traffic to the newly deployed revision using the --to-revisions flag of gcloud run services update-traffic.

https://cloud.google.com/sdk/gcloud/reference/run/services/update-traffic

@preritdas
Copy link

+1 this would be extremely useful, especially when updating traffic in a subsequent step. Having an output for the created revision name would allow one to then have a step allocating all traffic to the newly deployed revision using the --to-revisions flag of gcloud run services update-traffic.

https://cloud.google.com/sdk/gcloud/reference/run/services/update-traffic

Any thoughts on this @sethvargo?

@sethvargo
Copy link
Member

Sure! PRs welcome. We'd need to pull it from the gcloud output

@preritdas
Copy link

Sure! PRs welcome. We'd need to pull it from the gcloud output

Thanks @sethvargo, will open a PR.

@preritdas preritdas linked a pull request Jan 14, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants