Skip to content

Conversation

jellonek
Copy link
Contributor

@jellonek jellonek commented Sep 25, 2018

Closes #748


This change is Reviewable

Copy link
Contributor

@ivan4th ivan4th left a 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

Copy link
Contributor Author

@jellonek jellonek left a 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 specify base64 encoding via VirtletCloudInitUserDataSourceEncoding 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.

Copy link
Contributor

@lukaszo lukaszo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 1 change requests, 0 of 2 approvals obtained (waiting on @ivan4th)

Copy link
Contributor

@ivan4th ivan4th left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 3 files at r1, 2 of 2 files at r2.
Reviewable status: 1 change requests, 1 of 2 approvals obtained

@ivan4th ivan4th merged commit 47fc8a9 into master Sep 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants