Remove crate private identity_pem
field from Config
#771
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The concatenated
identity_pem
field shouldn't be necessary. At least, it shouldn't be necessary to be stored inConfig
because the client certificates and the private key are inconfig.auth_info
.I'm not sure why we're doing the following:
https://github.com/kube-rs/kube-rs/blob/52f69b9a89aa9e23605eb7f9c3ca673260e21853/kube-client/src/config/mod.rs#L269-L278
where
accept_invalid_certs
only respects the config when failing to loadidentity_pem
and wheninsecure_skip_tls_verify
is set true.The following should be fine:
Also, the error from
identity_pem()
is ignored. I don't thinkload_client_certificate()
andload_client_key()
called inidentity_pem()
are defined correctly.https://github.com/kube-rs/kube-rs/blob/52f69b9a89aa9e23605eb7f9c3ca673260e21853/kube-client/src/config/file_config.rs#L404-L414
These errors when the fields are not present in config, but that's valid and should return
None
in that case.Ideally, we should validate the configured fields when creating a
Config
and error when it's configured with an invalid Base64 or path.This PR removes
identity_pem
field with minimal changes.