You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to have my API credentials for my provider in a secret, as the comment above the structure suggests. However, the test will then fail, because the secret is not present.
Other examples use two config keys, one SecretKeySelector and one plain string, one is used during testing and one on an actual cluster. I don't like this solution as there is the possibility of a less than optimal configuration, and it also doesn't test the secret handling, as it will be executed in production.
Is there a place, where I can hook my own function in and submit my secret to the apiserver before testing?
The text was updated successfully, but these errors were encountered:
@patrick246 I had the same question. I found a way to inject secrets before the tests are executed.
The trick is to set the ManifestPath to a yaml file (a directory is not working!) that can contain Kubernetes objects. Usually, the test suite looks for a config.json file in the ManifestPath and uses it for initializing a config object. But if you provide a custom config object (see in the code below), this one is used instead and the file, given in the ManifestPath, will be applied while the test suite sets up the namespace.
So to use secrets (or any other objects) in tests
set the ManifestPath to a yaml file
create a config object by reading the config.json file manually
I want to have my API credentials for my provider in a secret, as the comment above the structure suggests. However, the test will then fail, because the secret is not present.
Other examples use two config keys, one SecretKeySelector and one plain string, one is used during testing and one on an actual cluster. I don't like this solution as there is the possibility of a less than optimal configuration, and it also doesn't test the secret handling, as it will be executed in production.
Is there a place, where I can hook my own function in and submit my secret to the apiserver before testing?
The text was updated successfully, but these errors were encountered: