X Tutup
Skip to content

Add log-driver and options to service inspect "pretty" format#1950

Merged
silvin-lubecki merged 1 commit intodocker:masterfrom
RahulZoldyck:1943-bug-fix
Jan 17, 2020
Merged

Add log-driver and options to service inspect "pretty" format#1950
silvin-lubecki merged 1 commit intodocker:masterfrom
RahulZoldyck:1943-bug-fix

Conversation

@RahulZoldyck
Copy link
Contributor

@RahulZoldyck RahulZoldyck commented Jun 16, 2019

What I did

Fixes issue #1943 docker inspect not having log information

How I did it

Added template for Log Driver information in serviceInspectPrettyTemplate

How to verify it

docker service create --log-driver=json-file --log-opt max-file=5 --name loggie nginx:alpine
docker service inspect --format=pretty loggie

Description for the changelog

Added Log Driver information in the prettify template.

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "1943-bug-fix" git@github.com:RahulZoldyck/cli.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

@codecov-io
Copy link

codecov-io commented Jun 16, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@c6d10b6). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master    #1950   +/-   ##
=========================================
  Coverage          ?   56.74%           
=========================================
  Files             ?      310           
  Lines             ?    21808           
  Branches          ?        0           
=========================================
  Hits              ?    12375           
  Misses            ?     8518           
  Partials          ?      915

@RahulZoldyck RahulZoldyck changed the title Fixes Issue #1943 Fixes Issue #1943 docker inspect not having log information Jun 18, 2019
@RahulZoldyck
Copy link
Contributor Author

RahulZoldyck commented Sep 10, 2019

@GordonTheTurtle requesting review for the PR

@thaJeztah
Copy link
Member

Whoops, this one dropped off my list.

Tested this, and looks good:

ID:		ix149209ecm256o1ty9b5zw06
Name:		loggie
Service Mode:	Replicated
 Replicas:	1
Placement:
UpdateConfig:
 Parallelism:	1
 On failure:	pause
 Monitoring Period: 5s
 Max failure ratio: 0
 Update order:      stop-first
RollbackConfig:
 Parallelism:	1
 On failure:	pause
 Monitoring Period: 5s
 Max failure ratio: 0
 Rollback order:    stop-first
ContainerSpec:
 Image:		nginx:alpine@sha256:08a230429c2d27b8a5668163f3c20e73e6bba6aad4796aaea90372fbaebca122
 Init:		false
Log Driver:
 Name:		json-file
 LogOpts:
  max-file:       5

Resources:
Endpoint Mode:	vip

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

ping @silvin-lubecki PTAL

Target: {{$secret.File.Name}}
Source: {{$secret.SecretName}}
{{- end }}{{ end }}

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we need/want those empty lines in the template? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Ah, yes, it's a bit redundant as we have the indentation already (at least inconsistent). Let me clone this one and update that

@thaJeztah thaJeztah changed the title Fixes Issue #1943 docker inspect not having log information Add log-driver and options to service inspect "pretty" format Jan 17, 2020
Signed-off-by: Rahul Zoldyck <rahulzoldyck@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member

rebased, squashed, and removed the newlines

Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

LGTM

@silvin-lubecki silvin-lubecki merged commit 7d087b5 into docker:master Jan 17, 2020
@silvin-lubecki
Copy link
Contributor

Thank you @RahulZoldyck for your contribution!! 👍

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.

5 participants

X Tutup