Skip to content
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 GenerateInitContainers function to generator #89

Merged
merged 6 commits into from
Jun 3, 2021

Conversation

yangcao77
Copy link
Collaborator

Signed-off-by: Stephanie yangcao@redhat.com

What does this PR do?

This PR adopts GenerateInitContainers and it's supporting functions getCommandsFromEvent and getCommandsMap from odo, including the unit tests associated with those functions

What issues does this PR fix or reference?

devfile/api#181

Is your PR tested? Consider putting some instruction how to test your changes

add unit tests

Signed-off-by: Stephanie <yangcao@redhat.com>
Signed-off-by: Stephanie <yangcao@redhat.com>
Copy link
Member

@maysunfaisal maysunfaisal left a comment

Choose a reason for hiding this comment

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

preStart is now apply, so we should update it. Its one of the reasons why odo disabled preStart because they dont support it atm

we should also probably update odo code and remove where they call initContainers, err := utils.GetPreStartInitContainers(a.Devfile, containers) since its never executed 🤔

pkg/devfile/generator/generators.go Show resolved Hide resolved
pkg/devfile/generator/generators.go Show resolved Hide resolved
pkg/devfile/generator/utils.go Outdated Show resolved Hide resolved
pkg/devfile/generator/utils.go Outdated Show resolved Hide resolved
pkg/devfile/generator/generators.go Show resolved Hide resolved
pkg/devfile/generator/generators.go Outdated Show resolved Hide resolved
pkg/devfile/generator/generators.go Outdated Show resolved Hide resolved
pkg/devfile/generator/generators.go Outdated Show resolved Hide resolved
pkg/devfile/parser/data/v2/common/command_helper.go Outdated Show resolved Hide resolved
@@ -50,6 +50,33 @@ func GetExecWorkingDir(dc v1.Command) string {
return ""
}

// GetApplyComponent returns the component of the exec command
Copy link
Member

Choose a reason for hiding this comment

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

update desc and a test case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

Signed-off-by: Stephanie <yangcao@redhat.com>
@openshift-ci openshift-ci bot added the lgtm label Jun 3, 2021
@openshift-ci
Copy link

openshift-ci bot commented Jun 3, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maysunfaisal, yangcao77

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [maysunfaisal,yangcao77]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants