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
Describe the bug
Since v1.5.0, secrets of type key are not being pulled in the proper format.
To Reproduce
Install akv2k8s helm chart v2.5.1
Create a key in a key vault that can be accessed from the cluster akv2k8s is installed on.
Create an AzureKeyVaultSecret for the key
Note: Make sure to check out known issues (https://akv2k8s.io/troubleshooting/known-issues/) before submitting
Components and versions
Select which component(s) the bug relates to with [X].
[X] Controller, version:
1.5.0
(docker image tag)[ ] Env-Injector (webhook), version:
x.x.x
(docker image tag)[ ] Other
Describe the bug
Since v1.5.0, secrets of type key are not being pulled in the proper format.
To Reproduce
Install akv2k8s helm chart v2.5.1
Create a key in a key vault that can be accessed from the cluster akv2k8s is installed on.
Create an AzureKeyVaultSecret for the key
Decoding the secret will show:
Expected behavior
In previous versions of akv2k8s, the secret value would be formatted as a string:
Additional context
I think I've identified how this problem was introduced, although I do not know the exact fix.
In older versions of akv2k8s, the getKey method returned a JSONWebKey struct that included url encoded base64 strings
https://pkg.go.dev/github.com/Azure/[email protected]+incompatible/services/keyvault/2016-10-01/keyvault#JSONWebKey
However, the azkeys package being used now returns a JSONWebKey struct that includes values that are of the type
[]byte
. These are not being handled appropriately by the getKeys function as it seems they cannot be typecast to string.https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys#JSONWebKey
azure-key-vault-to-kubernetes/pkg/azure/keyvault/client/service.go
Lines 104 to 112 in 647b715
It seems like the
[]byte
data may be able to be converted properly by using one of the UnmarshalJSON functions included in azkeys, although I do not know exactly how this should be implemented. https://github.com/Azure/azure-sdk-for-go/blob/e9e6b6281766a4e71ea0ee0b7268692009e2794b/sdk/security/keyvault/azkeys/models_serde.go#L332The text was updated successfully, but these errors were encountered: