-
Notifications
You must be signed in to change notification settings - Fork 150
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
Support discoveryProperties in Configuration #619
Support discoveryProperties in Configuration #619
Conversation
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
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.
That's a nice feature here, the missing part is the validating webhook thing.
I also noticed you do the parameters gathering per discoveryEndpoints, it might be more efficient to do it only once at discoveryOperator's creation ?
Signed-off-by: Johnson Shih <[email protected]>
I thought about that but later changed to ready the secret information at the time establishing the endpoint connection. Reason:
|
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
…-new-work Signed-off-by: Johnson Shih <[email protected]>
let discovery_properties = r#" | ||
"discoveryProperties": [ | ||
{ | ||
"name": "" |
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.
curious, why this would be success case?
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.
we don't restrict empty name, as long as it's not None, we accept it (although it probably won't be used when DH query the secret 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.
seems strange to me to allow an empty name
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 an empty name should be an error, but won't block the PR based on that.
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.
if we treat empty name as error, should we treat name with all spaces as error, too? IMO, from syntax perspective, an empty string is a valid string and is valid as a key in key-value pair. We can allow it.
BTW, a null string for name is for sure not allowed, it's specified in the schema
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 dont think an empty string and a string with spaces are the same.
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'd be in favor of specifying name in the same way it is defined in core EnvVar
, that is as a C_IDENTIFIER
(i.e a string conforming to this regex: [A-Za-z_][A-Za-z0-9_]*
thus disallowing empty names and ensuring these discovery properties can be passed as environment variable if need arise.
I don't know if there is a way to translate that in the CRD or if we can only rely on the webhook to reject configurations that are in this case.
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.
yes, we can put pattern in the crd and not relies on webhook to validate the content. I'll investigate if we really want to make that hard restriction to the key name.
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.
filed Issue for the investigation effort.
#634
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
Signed-off-by: Johnson Shih <[email protected]>
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 won't block the PR for not triggering errors on empty names, but please create an issue for doing that later if you don't do it in this PR.
What this PR does / why we need it:
Discovery handlers need credential data for authenticated discovery. This PR allows users to specify credential data through discoveryProperties, Agent read the properties and pass them to discovery handlers.
This PR implements the proposal: project-akri/akri-docs#61
Special notes for your reviewer:
If applicable:
cargo fmt
)cargo build
)cargo clippy
)cargo test
)cargo doc
)