-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add DisableInitContainer field in the CR #1880
Conversation
Signed-off-by: dkwon17 <[email protected]>
Signed-off-by: dkwon17 <[email protected]>
7dcad41
to
fcf092a
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.
Small documentation comments but overall LGTM
api/v2/checluster_types.go
Outdated
// When the `/home/user` directory is persisted, the init container is used to initialize the directory before | ||
// the workspace starts. If set to true, the init container will not be created. | ||
// This field is not used if the `workspace.persistUserHome.enabled` field is set to false. | ||
// Enabled by default. |
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.
I'm a bit confused, I thought this was disabled by default? Do we have a docs bug in DWO?
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.
Right, the value is set to false by default, but the init container itself enabled by default
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.
Ah okay that makes more sense. Maybe we should write "Set to false by default" or "The init container is enabled by default"? I'm okay with leaving it as is, but it almost reads as "DisableInitContainer is enabled by default = the init contianer is disabled by default"
Signed-off-by: dkwon17 <[email protected]>
/test v14-devworkspace-happy-path |
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.
@dkwon17 could you clarify what is the motivation and use-case behind this feature?
from the first glance DisableInitContainer
looks like internal impl details rather than smth. to be exposed for configuration
/retest |
@ibuziuk The new field allows persistenthome setup from the tooling container's entrypoint instead of the initcontainer, since disabling the initcontainer means that persistent home can now only be set up by the tooling container (which was the beheaviour before this PR https://github.com/devfile/devworkspace-operator/pull/1251/files#diff-f1f3498fd50bbc235d4d09f5f5485a91f5a4a5cfeb20b127c96fc849a30ba56b). |
// the workspace starts. If set to true, the init container will not be created. | ||
// This field is not used if the `devEnvironments.persistUserHome.enabled` field is set to false. | ||
// Enabled by default. | ||
DisableInitContainer *bool `json:"disableInitContainer,omitempty"` |
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.
@dkwon17 maybe we should clarify more when this flag should be used?
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.
How about:
// Determines whether the init container that initializes the persistent home directory should be disabled.
// When the `/home/user` directory is persisted, the init container is used to initialize the directory before
// the workspace starts. If set to true, the init container will not be created.
// Disabling the init container allows persistent home to be prepared from the first workspace container's entrypoint script.
// This field is not used if the `workspace.persistUserHome.enabled` field is set to false.
// The init container is enabled by default.
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.
Looks good to me, though I'd modify the way "first workspace container" is said:
// Disabling the init container allows persistent home to be prepared from the first workspace container's entrypoint script.
I'm not sure what's the "standard" way of calling the main/tooling container? Do we say "tooling container" or "first container component"?
Some alternatives:
Disabling the init container allows home persistence to be initialized by the entrypoint present in the workspace's first container component.
Disabling the init container leaves the responsibility of initializing home persistence to the workspace's tooling container component, through an entrypoint, for example.
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.
Thanks, in my latest commit I went with:
che-operator/api/v2/checluster_types.go
Lines 482 to 488 in 11ddb35
// Determines whether the init container that initializes the persistent home directory should be disabled. | |
// When the `/home/user` directory is persisted, the init container is used to initialize the directory before | |
// the workspace starts. If set to true, the init container will not be created. | |
// Disabling the init container allows home persistence to be initialized by the entrypoint present in the workspace's first container component. | |
// This field is not used if the `devEnvironments.persistUserHome.enabled` field is set to false. | |
// The init container is enabled by default. | |
DisableInitContainer *bool `json:"disableInitContainer,omitempty"` |
Signed-off-by: dkwon17 <[email protected]>
I've made the changes to the description, could you please take a look again @ibuziuk |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AObuchow, dkwon17, tolusha The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@dkwon17: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Build 3.16 :: get-sources-rhpkg-container-build_3.16/55: devspaces-operator-bundle : 3.16 :: Failed in 63401097 : BREW:BUILD/STATUS:UNKNOWN |
Build 3.17 :: operator-bundle_3.x/3456: Console, Changes, Git Data |
Build 3.17 :: sync-to-downstream_3.x/7479: Console, Changes, Git Data |
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7459: devspaces-operator-bundle : 3.x :: Failed in 63402297 : BREW:BUILD/STATUS:UNKNOWN |
Build 3.17 :: operator-bundle_3.x/3457: Console, Changes, Git Data |
Build 3.17 :: sync-to-downstream_3.x/7480: Console, Changes, Git Data |
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7460: devspaces-operator-bundle : 3.x :: Failed in 63402455 : BREW:BUILD/STATUS:UNKNOWN |
Build 3.16 :: operator-bundle_3.16/26: Console, Changes, Git Data |
Build 3.16 :: sync-to-downstream_3.16/60: Console, Changes, Git Data |
Build 3.16 :: get-sources-rhpkg-container-build_3.16/56: devspaces-operator-bundle : 3.16 :: Failed in : BREW:BUILD/STATUS:UNKNOWN |
Build 3.17 :: operator-bundle_3.x/3458: Console, Changes, Git Data |
Build 3.17 :: sync-to-downstream_3.x/7481: Console, Changes, Git Data |
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7461: devspaces-operator-bundle : 3.x :: Failed in 63405390 : BREW:BUILD/STATUS:UNKNOWN |
Build 3.16 :: operator-bundle_3.16/27: Console, Changes, Git Data |
Build 3.16 :: sync-to-downstream_3.16/61: Console, Changes, Git Data |
Build 3.16 :: get-sources-rhpkg-container-build_3.16/57: devspaces-operator-bundle : 3.16 :: Failed in 63407640 : BREW:BUILD/STATUS:UNKNOWN |
Build 3.17 :: operator-bundle_3.x/3459: Console, Changes, Git Data |
Build 3.17 :: sync-to-downstream_3.x/7482: Console, Changes, Git Data |
Build 3.17 :: get-sources-rhpkg-container-build_3.x/7462: devspaces-operator-bundle : 3.x :: Failed in 63408548 : BREW:BUILD/STATUS:UNKNOWN |
Build 3.16 :: operator-bundle_3.16/28: Console, Changes, Git Data |
Build 3.16 :: sync-to-downstream_3.16/62: Console, Changes, Git Data |
Build 3.16 :: get-sources-rhpkg-container-build_3.16/58: devspaces-operator-bundle : 3.16 :: Failed in 63409047 : BREW:BUILD/STATUS:UNKNOWN |
What does this PR do?
This PR adds the DisableInitContainer field in the CheCluster CR.
This field sets the
config.workspaces.persistUserHome.disableInitContainer
field in the Che-owned DWOC.Screenshot/screencast of this PR
What issues does this PR fix or reference?
How to test this PR?
devworkspace-config
DWOC in theeclipse-che
namespace has the following fields:spec.devEnvironments.persistUserHome.disableInitContainer
tofalse
. Verify that the DWOC has the following fields:spec.devEnvironments.persistUserHome.disableInitContainer
field. Verify that thedisableInitContainer
has been removed from the DWOC:PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.