-
Notifications
You must be signed in to change notification settings - Fork 42
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: add config package & optimize dir package #90
feat: add config package & optimize dir package #90
Conversation
c1110c4
to
921fa2a
Compare
config package migrate config package from notation to notation-go split out the signingkeys information from config.json to be a signingkeys.json file migrate config/util.go from notation to notation-go add reusable Load() & Save() function to manage different configuration file dir package optimize dir/path.go API make the file/directory name as a constent in dir/path.go Signed-off-by: Junjie Gao <43160897+JeyJeyGao@users.noreply.github.com>
921fa2a
to
7cfcf89
Compare
typo in pr description: |
ca98605
to
21f63ea
Compare
eb92e12
to
48fd391
Compare
LGTM |
lgtm |
cfedfc5
to
822a12b
Compare
config package migrate config package from notation to notation-go split out the signingkeys information from config.json to be a signingkeys.json file migrate config/util.go from notation to notation-go add reusable Load() & Save() function to manage different configuration file dir package optimize dir/path.go API make the file/directory name as a constent in dir/path.go Signed-off-by: Junjie Gao <43160897+JeyJeyGao@users.noreply.github.com>
822a12b
to
5d99707
Compare
Codecov Report
@@ Coverage Diff @@
## main #90 +/- ##
==========================================
+ Coverage 66.21% 68.10% +1.89%
==========================================
Files 32 35 +3
Lines 1835 1919 +84
==========================================
+ Hits 1215 1307 +92
+ Misses 501 490 -11
- Partials 119 122 +3
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
ebe0adf
to
d8e4a67
Compare
d8e4a67
to
61104be
Compare
Signed-off-by: Junjie Gao <43160897+JeyJeyGao@users.noreply.github.com>
c6389c1
to
730bd31
Compare
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.
LGTM
0e805cb
to
9711344
Compare
lgtm |
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
9711344
to
08d6a49
Compare
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.
LGTM
"github.com/opencontainers/go-digest" | ||
) | ||
|
||
const ( | ||
// CertificateExtension defines the extension of the certificate files | ||
CertificateExtension = ".crt" |
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.
certificates can be in .pem
, .cer
, .der
as well. If this is meant to be used for local certificates which are created using Notation, then we should rename this to LocalCertificateExtension
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.
LocalCertificateExtension
is better. I will rename it.
ConfigFile = "config.json" | ||
|
||
// KeyExtension defines the extension of the key files | ||
KeyExtension = ".key" |
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.
LocalKeyExtension
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.
Sure.
func checkError(err error) { | ||
// if path does not exist, the path can be used to create file | ||
if err != nil && !errors.Is(err, fs.ErrNotExist) { | ||
panic(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.
Do we really need to panic here? Returning errors seems to be a better option for Go libraries per https://stackoverflow.com/a/35413011
Signed-off-by: Junjie Gao <junjiegao@microsoft.com> Signed-off-by: Pritesh Bandi <pritesb@amazon.com>
config package
Config package includes the necessary configuration information for notation-go library. Previously, it is in notation project. It is time to migrate the config package to notation-go.
dir package