mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +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"
|
||||
return strings.Replace(
|
||||
content,
|
||||
sshPublicKeyFileContentMarker,
|
||||
base64.StdEncoding.EncodeToString(sshPublicKey),
|
||||
1,
|
||||
key := base64.StdEncoding.EncodeToString(sshPublicKey)
|
||||
base64Marker := base64.StdEncoding.EncodeToString([]byte(sshPublicKeyFileContentMarker))
|
||||
replacer := strings.NewReplacer(
|
||||
sshPublicKeyFileContentMarker, key,
|
||||
base64Marker, key,
|
||||
)
|
||||
return replacer.Replace(content)
|
||||
}
|
||||
|
||||
func imageToInstanceName(imageConfig *internalGCEImage) string {
|
||||
|
Loading…
Reference in New Issue
Block a user