mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Allow SSH e2e node base64 key injection
With the change of the CRI-O jobs to use butane, we now have a verification for base64 data urls in place. This means that the following URL is invalid: ``` data:text/plain;base64,GCE_SSH_PUBLIC_KEY_FILE_CONTENT ``` This means we have to pass valid base64 to the URL. To fix that, we now allow to inject SSH key values with both, the `GCE_SSH_PUBLIC_KEY_FILE_CONTENT` field and its base64 encoded variant. Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
parent
119dc95369
commit
85106dc327
@ -935,12 +935,13 @@ func ignitionInjectGCEPublicKey(path string, content string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const sshPublicKeyFileContentMarker = "GCE_SSH_PUBLIC_KEY_FILE_CONTENT"
|
const sshPublicKeyFileContentMarker = "GCE_SSH_PUBLIC_KEY_FILE_CONTENT"
|
||||||
return strings.Replace(
|
key := base64.StdEncoding.EncodeToString(sshPublicKey)
|
||||||
content,
|
base64Marker := base64.StdEncoding.EncodeToString([]byte(sshPublicKeyFileContentMarker))
|
||||||
sshPublicKeyFileContentMarker,
|
replacer := strings.NewReplacer(
|
||||||
base64.StdEncoding.EncodeToString(sshPublicKey),
|
sshPublicKeyFileContentMarker, key,
|
||||||
1,
|
base64Marker, key,
|
||||||
)
|
)
|
||||||
|
return replacer.Replace(content)
|
||||||
}
|
}
|
||||||
|
|
||||||
func imageToInstanceName(imageConfig *internalGCEImage) string {
|
func imageToInstanceName(imageConfig *internalGCEImage) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user