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

Remove experimental from service logs #32462

Merged
merged 1 commit into from
Apr 11, 2017

Conversation

dperny
Copy link
Contributor

@dperny dperny commented Apr 10, 2017

Signed-off-by: Drew Erny [email protected]

- What I did
Remove experimental flag from service logs. API is now stable. Service logs now support all features, except retrieving details provided to the log driver.

- How I did it
Removed the experimental-specific code, updated the tests

- How to verify it
Tests pass

- Description for the changelog

Added ability to get logs from services and tasks, which was previously experimental.

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🦁

@@ -49,13 +49,14 @@ func newLogsCommand(dockerCli *command.DockerCli) *cobra.Command {
opts.target = args[0]
return runLogs(dockerCli, &opts)
},
Tags: map[string]string{"experimental": ""},
Copy link
Member

Choose a reason for hiding this comment

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

Ok, thinking what we should put here (bear with me, as this is still "new");

When talking to an older daemon, it should only be able to use this command if "experimental" is enabled. I guess that's handled by the daemon just returning a 404 if it's not enabled

However, it "officially" became a feature in docker 17.05 now, so should this be, like this?

Tags:  map[string]string{"version": "1.29"},

Thinking of new clients talking to older daemons. It's tricky, because it's still possible that we're talking to an older daemon with experimental features enabled 😓

ping @vieux wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now, if a current client talks to an older daemon with experimental enabled, the API is relatively unchanged, so the behavior might not be what you're expecting, but it will probably work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And by unexpected behavior, I might flags might not work or might be ignored, but there should not be panics.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, just recalled that I opened an issue for (roughly) this #28655. If we agree on that one, it should probably be blocked for older versions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@thaJeztah thaJeztah added this to the 17.05.0 milestone Apr 10, 2017
@thaJeztah thaJeztah requested a review from vieux April 10, 2017 11:58
@dperny
Copy link
Contributor Author

dperny commented Apr 10, 2017

Added requirement of API version 1.29 to avoid using endpoints on an experimental daemon.

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

Don't merge yet; @dperny is doing some docs changes and a minor textual change for the Usage

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

minor nits, but LGTM otherwise


Options:
--details Show extra details provided to logs
--no-resolve Do not map IDs to Names in output
--no-truc Do not truncate output
Copy link
Member

Choose a reason for hiding this comment

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

s/--no-truc/--no-trunc/ :smile:

Copy link
Member

Choose a reason for hiding this comment

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

also needs to be swapped with --no-task-id's (alphabetical)

-t, --timestamps Show timestamps
--tail string Number of lines to show from the end of the logs (default "all")
Copy link
Member

Choose a reason for hiding this comment

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

same here; --tail comes before --timestamps in output

Service logs API is now stable. Service logs now support all features,
except retrieving details provided to the log driver.

Signed-off-by: Drew Erny <[email protected]>
@dperny dperny force-pushed the service-logs-general-availability branch from f30e95e to 306cfec Compare April 10, 2017 20:40
@dperny
Copy link
Contributor Author

dperny commented Apr 10, 2017

@thaJeztah alphabetized

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member

alphabet-street

@thaJeztah
Copy link
Member

/cc @albers @sdurrheimer 🥇

@@ -17,14 +16,16 @@ advisory: "experimental"
# service logs

```Markdown
Usage: docker service logs [OPTIONS] SERVICE
Usage: docker service logs [OPTIONS] SERVICE|TASK
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, so for bash completion I will need a list of all tasks. ATM, this can be done with

docker service ps ""

Is this supported syntax, will this continue to work?

Copy link
Member

Choose a reason for hiding this comment

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

Good question, looks like a "tricky" one

Copy link
Contributor

Choose a reason for hiding this comment

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

interesting /cc @aluzzardi

@dperny
Copy link
Contributor Author

dperny commented Apr 11, 2017

Windows timed out. z appears to have successfully PASSed all of the tests and then decided to FAIL anyway.

@vieux vieux merged commit 17a3e45 into moby:master Apr 11, 2017
dnephin pushed a commit to dnephin/docker that referenced this pull request Apr 17, 2017
…bility

Remove experimental from service logs
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.

8 participants