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

Filter deployments by create index #5702

Merged
merged 8 commits into from
May 16, 2019
Merged

Conversation

preetapan
Copy link
Contributor

@preetapan preetapan commented May 14, 2019

This PR adds the ability to only view deployments for the most recent version of the job, similar to how job status --all-allocs work. By default, only deployments associated with the most recently created version of the job are returned.

Prior to this change, if a job was purged and recreated with the same id, nomad job deployments <jobid> would show all deployments. With this PR, adding --all will show all deployments, otherwise only deployments associated with the recreated job are shown.

TODO

  • Docs

@preetapan preetapan force-pushed the f-filter-by-create-index branch from 71a1c70 to fa79336 Compare May 14, 2019 21:14
Copy link
Contributor

@endocrimes endocrimes left a comment

Choose a reason for hiding this comment

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

LGTM - Make sure to call it out as a backwards incompatibility in the changelog though

nomad/state/state_store_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@langmartin langmartin left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -270,8 +270,10 @@ func (s *HTTPServer) jobDeployments(resp http.ResponseWriter, req *http.Request,
if req.Method != "GET" {
return nil, CodedError(405, ErrInvalidMethod)
}
all, _ := strconv.ParseBool(req.URL.Query().Get("all"))
Copy link
Contributor

Choose a reason for hiding this comment

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

is the behavior of ParseBool for an empty string the only thing that makes all default to false? If so, maybe that needs a comment? It's builtin to go, maybe it doesn't

@preetapan preetapan merged commit abaf5dc into master May 16, 2019
@preetapan preetapan deleted the f-filter-by-create-index branch May 16, 2019 02:50
schmichael added a commit that referenced this pull request May 20, 2019
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants