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

cmd/contour: adds sds cli #1048

Merged
merged 1 commit into from
Apr 30, 2019
Merged

Conversation

mattalberts
Copy link

Addresses the third high-level design bullet point, support sds in the
contour cli for debugging.

Updates: #898
Signed-off-by: Matt Alberts malberts@cloudflare.com

@mattalberts
Copy link
Author

mattalberts commented Apr 25, 2019

@@ -293,6 +293,16 @@ func (s *Secret) Data() map[string][]byte {
return s.Object.Data
}

// Cert returns the secret's tls certificate
func (s *Secret) Cert() []byte {
return s.Object.Data[v1.TLSCertKey]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could there be a case where the cert is not in the secret?

Copy link
Author

@mattalberts mattalberts Apr 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's plausible. It is assumed to be valued when setting up the downstream context; but on review, that isn't guaranteed. If the map key were missing, the vhost would be given an empty array of bytes right now.

It feels like the the structure should be verified while creating a SecureVirtualHost vertex.

What about as part of func (b *builder) lookupSecret(m meta) *Secret? There is handling for when the function returns nil; missing structure could value the return as nil (there just needs to be a way to signal that to the user via an event or log message).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These got marked as outdated when I rebased. They were brought in with #1047.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok no biggie, there's another issue where we get the cert and not the key and it causes issues, but let's not try and fix that in this (just been on my mind).

Copy link
Author

@mattalberts mattalberts Apr 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its okay! I'm glad you mentioned it. I remember looking at it while I drafted the PR, when deciding to introduce the helper functions on *dag.Secret. Is there already an issue for that? I can clean them all up at one time in another PR :).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet its this one, #1051 :)


// PrivateKey returns the secret's tls private key
func (s *Secret) PrivateKey() []byte {
return s.Object.Data[v1.TLSPrivateKeyKey]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here if the key is nil?

Copy link
Author

@mattalberts mattalberts Apr 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. If the key doesn't exist, the return would be populated as and empty []byte.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Addresses the third high-level design bullet point, support sds in the
contour cli for debugging.

Updates: projectcontour#898
Signed-off-by: Matt Alberts <malberts@cloudflare.com>
Copy link
Member

@stevesloka stevesloka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@stevesloka stevesloka merged commit 5a3d7e0 into projectcontour:master Apr 30, 2019
@davecheney davecheney added this to the 0.12.0 milestone May 7, 2019
@mattalberts mattalberts deleted the xds-sds-cli branch May 16, 2019 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants