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

Commit 97dbe37

Browse files
committed
Updating Readme
1 parent 07a2e60 commit 97dbe37

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

README.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ type PackageInfo struct {
114114

115115
#### Single Version Diffs
116116

117-
The single version differs (apt, pip) have the following json output structure:
117+
Single version differs (apt) have the following json output structure:
118118

119119
```
120120
type PackageDiff struct {
@@ -130,7 +130,7 @@ Image1 and Image2 are the image names. Packages1 and Packages2 map package name
130130

131131
#### Multi Version Diffs
132132

133-
The multi version differs (node) support processing images which may have multiple versions of the same package. Below is the json output structure:
133+
The multi version differs (pip, node) support processing images which may have multiple versions of the same package. Below is the json output structure:
134134

135135
```
136136
type MultiVersionPackageDiff struct {
@@ -154,42 +154,38 @@ type MultiVersionInfo struct {
154154

155155
## Known issues
156156

157-
To run container-diff on image IDs or URLs, docker must be installed.
157+
To run container-diff on image IDs, docker must be installed.
158158

159159
## Example Run
160160

161+
// TODO FIX EXAMPLE RUN
162+
161163
```
162-
$ container-diff gcr.io/google-appengine/python:latest gcr.io/google-appengine/python:2017-07-25-110644 -p -a -n
164+
$ container-diff gcr.io/google-appengine/python:2017-07-21-123058 gcr.io/google-appengine/python:2017-06-29-190410 -a -n -p
163165
164-
-----Apt Diff-----
166+
-----AptDiffer-----
165167
166-
Packages found only in gcr.io/google-appengine/python:latest: None
168+
Packages found only in gcr.io/google-appengine/python:2017-07-21-123058: None
167169
168-
Packages found only in gcr.io/google-appengine/python:2017-07-25-110644: None
170+
Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
169171
170172
Version differences:
171-
(Package: gcr.io/google-appengine/python:latest gcr.io/google-appengine/python:2017-07-25-110644)
172-
perl: {5.20.2-3 deb8u7 17584} {5.20.2-3 deb8u8 17584}
173-
174-
libgnutls-deb0-28: {3.3.8-6 deb8u6 1808} {3.3.8-6 deb8u7 1808}
175-
176-
perl-base: {5.20.2-3 deb8u7 5098} {5.20.2-3 deb8u8 5098}
177-
178-
perl-modules: {5.20.2-3 deb8u7 15108} {5.20.2-3 deb8u8 15108}
179-
180-
-----Node Diff-----
173+
PACKAGE IMAGE1 (gcr.io/google-appengine/python:2017-07-21-123058) IMAGE2 (gcr.io/google-appengine/python:2017-06-29-190410)
174+
-libgcrypt20 1.6.3-2 deb8u4, 998B 1.6.3-2 deb8u3, 1002B
175+
176+
-----NodeDiffer-----
181177
182-
Packages found only in gcr.io/google-appengine/python:latest: None
178+
Packages found only in gcr.io/google-appengine/python:2017-07-21-123058: None
183179
184-
Packages found only in gcr.io/google-appengine/python:2017-07-25-110644: None
180+
Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
185181
186182
Version differences: None
187183
188-
-----Pip Diff-----
184+
-----PipDiffer-----
189185
190-
Packages found only in gcr.io/google-appengine/python:latest: None
186+
Packages found only in gcr.io/google-appengine/python:2017-07-21-123058: None
191187
192-
Packages found only in gcr.io/google-appengine/python:2017-07-25-110644: None
188+
Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
193189
194190
Version differences: None
195191
@@ -205,14 +201,14 @@ Feel free to develop your own differ leveraging the utils currently available.
205201
In order to quickly make your own differ, follow these steps:
206202

207203
1. Add your diff identifier to the flags in [root.go](https://github.com/GoogleCloudPlatform/container-diff/blob/ReadMe/cmd/root.go)
208-
2. Determine if you can use existing differ tools. If you can make use of existing tools, you then need to construct the structs to feed to the diff tools by getting all of the packages for each image or the analogous quality to be diffed. To determine if you can leverage existing tools, think through these questions:
204+
2. Determine if you can use existing differ tools. If you can make use of existing tools, you then need to construct the structs to feed into the diff tools by getting all of the packages for each image or the analogous quality to be diffed. To determine if you can leverage existing tools, think through these questions:
209205
- Are you trying to diff packages?
210206
- Yes: Does the relevant package manager support different versions of the same package on one image?
211-
- Yes: Use `GetMultiVerisonMapDiff` to diff `map[string]map[string]utils.PackageInfo` objects. See [nodeDiff.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/nodeDiff.go#L33) for an example.
212-
- No: Use `GetMapDiff` to diff `map[string]utils.PackageInfo` objects. See [aptDiff.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/aptDiff.go#L29) or [pipDiff.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/pipDiff.go#L23) for examples.
207+
- Yes: Use `GetMultiVerisonMapDiff` to diff `map[string]map[string]utils.PackageInfo` objects. See [nodeDiff.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/nodeDiff.go#L33) or [pipDiff.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/pipDiff.go#L23) for examples.
208+
- No: Use `GetMapDiff` to diff `map[string]utils.PackageInfo` objects. See [aptDiff.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/aptDiff.go#L29).
213209
- No: Look to [History](https://github.com/GoogleCloudPlatform/container-diff/blob/ReadMe/differs/historyDiff.go) and [File System](https://github.com/GoogleCloudPlatform/container-diff/blob/ReadMe/differs/fileDiff.go) differs as models for diffing.
214210

215-
3. Write your Diff driver such that you have a struct for your differ type and a method for that differ called Diff:
211+
3. Write your Diff driver in the `differs` directory, such that you have a struct for your differ type and a method for that differ called Diff:
216212

217213
```
218214
type YourDiffer struct {}
@@ -225,7 +221,15 @@ If using existing package differ tools, you should create the appropriate struct
225221

226222
Otherwise, create your own differ which should yield information to fill a DiffResult in the next step.
227223

228-
4. Create a DiffResult for your differ if you're not using existing utils or want to wrap the output. This is where you define how your differ should output for a human readable format and as a struct which can then be written to a `.json` file. See [output_utils.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/utils/output_utils.go).
224+
4. Create a DiffResult for your differ.
225+
```
226+
type DiffResult interface {
227+
GetStruct() DiffResult
228+
OutputText(diffType string) error
229+
}
230+
```
231+
232+
This is where you define how your differ should output for a human readable format (`OutputText`) and as a struct which can then be written to a `.json` file. See [output_utils.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/utils/output_utils.go).
229233

230234
5. Add your differ to the diffs map in [differs.go](https://github.com/GoogleCloudPlatform/container-diff/blob/master/differs/differs.go#L22) with the corresponding Differ struct as the value.
231235

0 commit comments

Comments
 (0)