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

Commit 31f910d

Browse files
Merge pull request #16 from abbytiz/ReadmeUpdates
Updating Readme
2 parents e193efa + 311f60f commit 31f910d

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

README.md

Lines changed: 29 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,36 @@ 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

161161
```
162-
$ container-diff gcr.io/google-appengine/python:latest gcr.io/google-appengine/python:2017-07-25-110644 -p -a -n
162+
$ container-diff gcr.io/google-appengine/python:2017-07-21-123058 gcr.io/google-appengine/python:2017-06-29-190410 -a -n -p
163163
164-
-----Apt Diff-----
164+
-----AptDiffer-----
165165
166-
Packages found only in gcr.io/google-appengine/python:latest: None
166+
Packages found only in gcr.io/google-appengine/python:2017-07-21-123058: None
167167
168-
Packages found only in gcr.io/google-appengine/python:2017-07-25-110644: None
168+
Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
169169
170170
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-----
171+
PACKAGE IMAGE1 (gcr.io/google-appengine/python:2017-07-21-123058) IMAGE2 (gcr.io/google-appengine/python:2017-06-29-190410)
172+
-libgcrypt20 1.6.3-2 deb8u4, 998B 1.6.3-2 deb8u3, 1002B
181173
182-
Packages found only in gcr.io/google-appengine/python:latest: None
174+
-----NodeDiffer-----
183175
184-
Packages found only in gcr.io/google-appengine/python:2017-07-25-110644: None
176+
Packages found only in gcr.io/google-appengine/python:2017-07-21-123058: None
177+
178+
Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
185179
186180
Version differences: None
187181
188-
-----Pip Diff-----
182+
-----PipDiffer-----
189183
190-
Packages found only in gcr.io/google-appengine/python:latest: None
184+
Packages found only in gcr.io/google-appengine/python:2017-07-21-123058: None
191185
192-
Packages found only in gcr.io/google-appengine/python:2017-07-25-110644: None
186+
Packages found only in gcr.io/google-appengine/python:2017-06-29-190410: None
193187
194188
Version differences: None
195189
@@ -205,14 +199,14 @@ Feel free to develop your own differ leveraging the utils currently available.
205199
In order to quickly make your own differ, follow these steps:
206200

207201
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:
202+
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:
209203
- Are you trying to diff packages?
210204
- 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.
205+
- 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.
206+
- 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).
213207
- 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.
214208

215-
3. Write your Diff driver such that you have a struct for your differ type and a method for that differ called Diff:
209+
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:
216210

217211
```
218212
type YourDiffer struct {}
@@ -225,7 +219,15 @@ If using existing package differ tools, you should create the appropriate struct
225219

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

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).
222+
4. Create a DiffResult for your differ.
223+
```
224+
type DiffResult interface {
225+
GetStruct() DiffResult
226+
OutputText(diffType string) error
227+
}
228+
```
229+
230+
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).
229231

230232
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.
231233

0 commit comments

Comments
 (0)