-
Notifications
You must be signed in to change notification settings - Fork 128
Add an option to store whole user-data in secret/configmap entry #770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8700c27
to
fba180f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 2 approvals obtained (waiting on @jellonek)
docs/cloud-init-data-generation.md, line 72 at r1 (raw file):
# it's also possible to store whole user-data contents in above data # source under particular key:
it's also possible to specify that the whole user-data contents are stored in a ConfigMap under the specified key:
docs/cloud-init-data-generation.md, line 77 at r1 (raw file):
# in above example contents of user-data is text which can be decoded # as plain (default if omitted), or base64 according to value # of the following:
by default, the contents of user-data in a ConfigMap key is specified as plain text, but it can also be encoded using base64:
docs/cloud-init-data-generation.md, line 264 at r1 (raw file):
There is also an option to store whole contents of user-data in a single key of appropirate resource which can be selected by `VirtletCloudInitUserDataSourceKey`. It can be stored as `base64` encoded data, or `plain` text (default if value not set) according to value of `VirtletCloudInitUserDataSourceEncoding` annotation.
There's also an option to store the whole contents of user-data in a single key of ConfigMap which can be specified using VirtletCloudInitUserDataSourceKey
. By default, the data are stored there as plain text but you can also specify base64
encoding via VirtletCloudInitUserDataSourceEncoding
annotation.
pkg/metadata/types/annotations.go, line 231 at r1 (raw file):
data, found := va.UserData[key] if !found { return fmt.Errorf("user-data script source not found under key %q", key)
under the key
pkg/metadata/types/annotations.go, line 236 at r1 (raw file):
dataStr, ok := data.(string) if !ok { return fmt.Errorf("failed to read user-data script source from key %q", key)
from the key
pkg/metadata/types/annotations.go, line 245 at r1 (raw file):
ud, err := base64.StdEncoding.DecodeString(dataStr) if err != nil { return fmt.Errorf("failed to decode user-data script in base64 encoding: %v", err)
failed to decode the base64-encoded user-data script
pkg/metadata/types/annotations.go, line 249 at r1 (raw file):
va.UserDataScript = string(ud) default: return fmt.Errorf("failed to decode user-data script: %q is unknown encoding", encoding)
failed to decode the user-data script: unknown encoding %q
fba180f
to
5e95020
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @ivan4th)
docs/cloud-init-data-generation.md, line 72 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
it's also possible to specify that the whole user-data contents are stored in a ConfigMap under the specified key:
Done.
docs/cloud-init-data-generation.md, line 77 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
by default, the contents of user-data in a ConfigMap key is specified as plain text, but it can also be encoded using base64:
Done.
docs/cloud-init-data-generation.md, line 264 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
There's also an option to store the whole contents of user-data in a single key of ConfigMap which can be specified using
VirtletCloudInitUserDataSourceKey
. By default, the data are stored there as plain text but you can also specifybase64
encoding viaVirtletCloudInitUserDataSourceEncoding
annotation.
Done.
pkg/metadata/types/annotations.go, line 231 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
under the key
Done.
pkg/metadata/types/annotations.go, line 236 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
from the key
Done.
pkg/metadata/types/annotations.go, line 245 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
failed to decode the base64-encoded user-data script
Done.
pkg/metadata/types/annotations.go, line 249 at r1 (raw file):
Previously, ivan4th (Ivan Shvedunov) wrote…
failed to decode the user-data script: unknown encoding %q
Done.
5e95020
to
679a491
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @ivan4th)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 3 files at r1, 2 of 2 files at r2.
Reviewable status: 1 change requests, 1 of 2 approvals obtained
Closes #748
This change is