Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit fbeea14

Browse files
committed
Update docs and tests.
1 parent e2f42d2 commit fbeea14

File tree

2 files changed

+26
-37
lines changed

2 files changed

+26
-37
lines changed

README.md

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -41,48 +41,37 @@ To use `container-diff analyze` to perform analysis on a single image, you need
4141

4242
```
4343
container-diff analyze <img> [Run default analyzers]
44-
container-diff analyze <img> --types=history [History]
45-
container-diff analyze <img> --types=file [File System]
46-
container-diff analyze <img> --types=pip [Pip]
47-
container-diff analyze <img> --types=apt [Apt]
48-
container-diff analyze <img> --types=node [Node]
49-
container-diff analyze <img> --types=apt,node [Apt and Node]
50-
# --types=<analyzer1>,<analyzer2>,<analyzer3>,...
44+
container-diff analyze <img> --type=history [History]
45+
container-diff analyze <img> --type=file [File System]
46+
container-diff analyze <img> --type=pip [Pip]
47+
container-diff analyze <img> --type=apt [Apt]
48+
container-diff analyze <img> --type=node [Node]
49+
container-diff analyze <img> --type=apt --type=node [Apt and Node]
50+
# --type=<analyzer1> --type=<analyzer2> --type=<analyzer3>,...
5151
```
5252

5353
To use container-diff to perform a diff analysis on two images, you need two Docker images (in the form of an ID, tarball, or URL from a repo). Once you have those images, you can run any of the following differs:
5454
```
5555
container-diff diff <img1> <img2> [Run all differs]
56-
container-diff diff <img1> <img2> --types=history [History]
57-
container-diff diff <img1> <img2> --types=file [File System]
58-
container-diff diff <img1> <img2> --types=pip [Pip]
59-
container-diff diff <img1> <img2> --types=apt [Apt]
60-
container-diff diff <img1> <img2> --types=node [Node]
56+
container-diff diff <img1> <img2> --type=history [History]
57+
container-diff diff <img1> <img2> --type=file [File System]
58+
container-diff diff <img1> <img2> --type=pip [Pip]
59+
container-diff diff <img1> <img2> --type=apt [Apt]
60+
container-diff diff <img1> <img2> --type=node [Node]
6161
```
6262

6363
You can similarly run many analyzers at once:
6464

6565
```
66-
container-diff diff <img1> <img2> --types=history,apt,node
66+
container-diff diff <img1> <img2> --type=history --type=apt --type=node
6767
```
6868

6969
To view the diff of an individual file in two different images, you can use the filename flag in conjuction with the file system diff analyzer.
7070

7171
```
72-
container-diff diff <img1> <img2> --types=file --filename=/path/to/file
72+
container-diff diff <img1> <img2> --type=file --filename=/path/to/file
7373
```
7474

75-
All of the analyzer flags with their long versions can be seen below:
76-
77-
| Differ | Short flag | Long Flag |
78-
| ------------------------- |:----------:| ----------:|
79-
| File system diff | -f | --file |
80-
| History | -d | --history |
81-
| npm installed packages | -n | --node |
82-
| pip installed packages | -p | --pip |
83-
| apt-get installed packages| -a | --apt |
84-
85-
8675
## Image Sources
8776

8877
container-diff supports Docker images located in both a local Docker daemon and a remote registry. To explicitly specify a local image, use the `daemon://` prefix on the image name; similarly, for an explicitly remote image, use the `remote://` prefix.
@@ -242,7 +231,7 @@ Tarballs provided directly to the tool must be in the Docker format (i.e. have a
242231
## Example Run
243232

244233
```
245-
$ container-diff diff gcr.io/google-appengine/python:2017-07-21-123058 gcr.io/google-appengine/python:2017-06-29-190410 --types=apt,node,pip
234+
$ container-diff diff gcr.io/google-appengine/python:2017-07-21-123058 gcr.io/google-appengine/python:2017-06-29-190410 --type=apt --type=node --type=pip
246235
247236
-----AptDiffer-----
248237

tests/integration_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,83 +97,83 @@ func TestDiffAndAnalysis(t *testing.T) {
9797
subcommand: "diff",
9898
imageA: diffBase,
9999
imageB: diffModified,
100-
differFlags: []string{"--types=file"},
100+
differFlags: []string{"--type=file"},
101101
expectedFile: "file_diff_expected.json",
102102
},
103103
{
104104
description: "apt differ",
105105
subcommand: "diff",
106106
imageA: aptBase,
107107
imageB: aptModified,
108-
differFlags: []string{"--types=apt"},
108+
differFlags: []string{"--type=apt"},
109109
expectedFile: "apt_diff_expected.json",
110110
},
111111
{
112112
description: "node differ",
113113
subcommand: "diff",
114114
imageA: nodeBase,
115115
imageB: nodeModified,
116-
differFlags: []string{"--types=node"},
116+
differFlags: []string{"--type=node"},
117117
expectedFile: "node_diff_order_expected.json",
118118
},
119119
{
120120
description: "multi differ",
121121
subcommand: "diff",
122122
imageA: multiBase,
123123
imageB: multiModified,
124-
differFlags: []string{"--types=node,pip,apt"},
124+
differFlags: []string{"--type=node", "--type=pip","--type=apt"},
125125
expectedFile: "multi_diff_expected.json",
126126
},
127127
{
128128
description: "multi differ local",
129129
subcommand: "diff",
130130
imageA: multiBaseLocal,
131131
imageB: multiModifiedLocal,
132-
differFlags: []string{"--types=node,pip,apt"},
132+
differFlags: []string{"--type=node", "--type=pip","--type=apt"},
133133
expectedFile: "multi_diff_expected.json",
134134
},
135135
{
136136
description: "history differ",
137137
subcommand: "diff",
138138
imageA: diffBase,
139139
imageB: diffModified,
140-
differFlags: []string{"--types=history"},
140+
differFlags: []string{"--type=history"},
141141
expectedFile: "hist_diff_expected.json",
142142
},
143143
{
144144
description: "apt sorted differ",
145145
subcommand: "diff",
146146
imageA: aptBase,
147147
imageB: aptModified,
148-
differFlags: []string{"--types=apt", "-o"},
148+
differFlags: []string{"--type=apt", "-o"},
149149
expectedFile: "apt_sorted_diff_expected.json",
150150
},
151151
{
152152
description: "apt analysis",
153153
subcommand: "analyze",
154154
imageA: aptModified,
155-
differFlags: []string{"--types=apt"},
155+
differFlags: []string{"--type=apt"},
156156
expectedFile: "apt_analysis_expected.json",
157157
},
158158
{
159159
description: "file sorted analysis",
160160
subcommand: "analyze",
161161
imageA: diffModified,
162-
differFlags: []string{"--types=file", "-o"},
162+
differFlags: []string{"--type=file", "-o"},
163163
expectedFile: "file_sorted_analysis_expected.json",
164164
},
165165
{
166166
description: "pip analysis",
167167
subcommand: "analyze",
168168
imageA: pipModified,
169-
differFlags: []string{"--types=pip"},
169+
differFlags: []string{"--type=pip"},
170170
expectedFile: "pip_analysis_expected.json",
171171
},
172172
{
173173
description: "node analysis",
174174
subcommand: "analyze",
175175
imageA: nodeModified,
176-
differFlags: []string{"--types=node"},
176+
differFlags: []string{"--type=node"},
177177
expectedFile: "node_analysis_expected.json",
178178
},
179179
}

0 commit comments

Comments
 (0)