-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add KubeCon + CloudNativeCon NA '23 demo files #32
Add KubeCon + CloudNativeCon NA '23 demo files #32
Conversation
Signed-off-by: Marcela Melara <[email protected]>
5dde4e9
to
ce5b2fb
Compare
Signed-off-by: Marcela Melara <[email protected]>
66426d7
to
9e89fcd
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 largely. Just minor comments but I don't know if they're dealbreakers given the context...
scai-gen/cmd/rekor.go
Outdated
} | ||
|
||
fileScanner := bufio.NewScanner(readFile) | ||
fileScanner.Split(bufio.ScanLines) |
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.
Is this needed? This is the default, right?
Split sets the split function for the Scanner. The default split function is ScanLines.
scai-gen/cmd/rekor.go
Outdated
return fmt.Errorf("error decoding base64-encoded public key: %w", err) | ||
} | ||
|
||
// dedup |
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.
Could you clarify this comment?
scai-gen/cmd/rekor.go
Outdated
for _, line := range fileLines { | ||
lineStr := string(line) | ||
if strings.Contains(lineStr, "publicKey") { | ||
pkB64Raw := strings.TrimPrefix(lineStr, " \"publicKey\": ") |
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.
strings.TrimSpace
to make this more robust in case the output changes slightly?
scai-gen/cmd/rekor.go
Outdated
|
||
for _, line := range fileLines { | ||
lineStr := string(line) | ||
if strings.Contains(lineStr, "publicKey") { |
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.
I think strings.HasPrefix
may be better after TrimSpace
.
Thanks for your comments @adityasaky . I'm actually going to remove all of the Rekor related code since it's experimental and not included in the actual demo. |
Signed-off-by: Marcela Melara <[email protected]>
Adding a dedicated directory that contains all of the files and documentation used in the demo showed at Kubecon + CloudNativeCon `23.