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 all.json #218

Merged
merged 1 commit into from
Oct 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions commands/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ func (p *HistoryCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{
}
var hosts []string
for _, f := range files {
// TODO this "if block" will be deleted in a future release
if f.Name() == "all.json" {
continue
}
if filepath.Ext(f.Name()) != ".json" {
continue
}
Expand Down
12 changes: 0 additions & 12 deletions report/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ func (w JSONWriter) Write(scanResults []models.ScanResult) (err error) {
}

var jsonBytes []byte
if jsonBytes, err = json.Marshal(scanResults); err != nil {
return fmt.Errorf("Failed to Marshal to JSON: %s", err)
}
all := filepath.Join(path, "all.json")
if err := ioutil.WriteFile(all, jsonBytes, 0600); err != nil {
return fmt.Errorf("Failed to write JSON. path: %s, err: %s", all, err)
}

for _, r := range scanResults {
jsonPath := ""
if len(r.Container.ContainerID) == 0 {
Expand Down Expand Up @@ -117,10 +109,6 @@ func LoadOneScanHistory(jsonDir string) (scanHistory models.ScanHistory, err err
return
}
for _, file := range files {
// TODO this "if block" will be deleted in a future release
if file.Name() == "all.json" {
continue
}
if filepath.Ext(file.Name()) != ".json" {
continue
}
Expand Down
10 changes: 0 additions & 10 deletions report/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ func (w S3Writer) Write(scanResults []models.ScanResult) (err error) {
// http://docs.aws.amazon.com/sdk-for-go/latest/v1/developerguide/common-examples.title.html
svc := getS3()
timestr := time.Now().Format("20060102_1504")
key := fmt.Sprintf("%s/%s", timestr, "all.json")
_, err = svc.PutObject(&s3.PutObjectInput{
Bucket: &c.Conf.S3Bucket,
Key: &key,
Body: bytes.NewReader(jsonBytes),
})
if err != nil {
return fmt.Errorf("Failed to upload data to %s/%s, %s", c.Conf.S3Bucket, key, err)
}

for _, r := range scanResults {
key := ""
if len(r.Container.ContainerID) == 0 {
Expand Down