-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat(eol): added eol dates #148
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition, we have to add this updater here.
https://github.com/aquasecurity/vuln-list-update/blob/main/.github/workflows/update.yml
main.go
Outdated
if err := src.Update(); err != nil { | ||
return xerrors.Errorf("Alpine end of life dates update error: %w", err) | ||
} | ||
commitMsg = "CBL-Mariner Vulnerability Data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not CBL-Mariner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, changed
eol/alpine/eof_test.go
Outdated
want map[string]time.Time | ||
}{ | ||
{ | ||
name: "happy path", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add sad path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 2 tests
eol/alpine/eof.go
Outdated
if err := os.MkdirAll(dir, os.ModePerm); err != nil { | ||
return xerrors.Errorf("failed to mkdir: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WriteJSON also creates a dir.
Lines 13 to 15 in 357afc5
if err := fs.MkdirAll(dir, os.ModePerm); err != nil { | |
return xerrors.Errorf("unable to create a directory: %w", err) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, i didn't see that. Thank you. Removed
eol/alpine/eof.go
Outdated
dir := filepath.Join(config.vulnListDir, eolAlpineFolder) | ||
if err := os.RemoveAll(dir); err != nil { | ||
return xerrors.Errorf("unable to remove github security advisory directory: %w", err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a single file, right? Looks like we don't have to remove dir as it overwrites the existing file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
eol/alpine/eof.go
Outdated
} | ||
} | ||
|
||
func (config Config) Update() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: a single letter name is fine.
func (config Config) Update() error { | |
func (c Config) Update() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
eol/alpine/eof.go
Outdated
return eolDates, nil | ||
} | ||
|
||
func (config Config) save(dates map[string]time.Time) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
eol/alpine/eof.go
Outdated
|
||
const ( | ||
eolAlpineFolder = "eol/alpine" | ||
eolAlpineFile = "eol-alpine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we have an entire file name here?
eolAlpineFile = "eol-alpine" | |
eolAlpineFile = "alpine.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
Added, thanks! |
Description
Added list of end-of-life dates.
EOL dated taken from: