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 kclient functions for creating deployments #2509

Merged

Conversation

rajivnathan
Copy link
Contributor

@rajivnathan rajivnathan commented Jan 13, 2020

Signed-off-by: Rajiv Senthilnathan rajivsen@ca.ibm.com

What type of PR is this?
/kind feature

What does does this PR do / why we need it:
Adds the base kclient functions required for creating a Deployment that consists of a Pod with containers that map to each of the components in a Devfile. Once the devfile parsing is complete I can add the rest of the required code in a separate PR.

Which issue(s) this PR fixes:

Partially implements #2471

How to test changes / Special notes to the reviewer:

  1. cd pkg/kclient
  2. go test -v

Results:

=== RUN   TestCreateDeployment
=== RUN   TestCreateDeployment/Case:_Valid_deployment_name
=== RUN   TestCreateDeployment/Case:_Invalid_deployment_name
--- PASS: TestCreateDeployment (0.00s)
    --- PASS: TestCreateDeployment/Case:_Valid_deployment_name (0.00s)
    --- PASS: TestCreateDeployment/Case:_Invalid_deployment_name (0.00s)
=== RUN   TestGenerateContainerSpec
=== RUN   TestGenerateContainerSpec/#00
=== RUN   TestGenerateContainerSpec/container1
--- PASS: TestGenerateContainerSpec (0.00s)
    --- PASS: TestGenerateContainerSpec/#00 (0.00s)
    --- PASS: TestGenerateContainerSpec/container1 (0.00s)
=== RUN   TestGeneratePodSpec
=== RUN   TestGeneratePodSpec/podSpecTest
--- PASS: TestGeneratePodSpec (0.00s)
    --- PASS: TestGeneratePodSpec/podSpecTest (0.00s)
=== RUN   TestWaitAndGetPod
=== RUN   TestWaitAndGetPod/phase:_running
 ✓  Waiting for component to start [196543ns]
=== RUN   TestWaitAndGetPod/phase:_failed
 ✗  Waiting for component to start [100852ns]
=== RUN   TestWaitAndGetPod/phase:_unknown
 ✗  Waiting for component to start [103256ns]
--- PASS: TestWaitAndGetPod (0.00s)
    --- PASS: TestWaitAndGetPod/phase:_running (0.00s)
    --- PASS: TestWaitAndGetPod/phase:_failed (0.00s)
    --- PASS: TestWaitAndGetPod/phase:_unknown (0.00s)
PASS
ok  	github.com/openshift/odo/pkg/kclient	1.220s

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Jan 13, 2020
@openshift-ci-robot
Copy link
Collaborator

Hi @rajivnathan. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. Required by Prow. size/L labels Jan 13, 2020
Signed-off-by: Rajiv Senthilnathan <rajivsen@ca.ibm.com>
deployment := appsv1.Deployment{
TypeMeta: metav1.TypeMeta{
Kind: "Deployment",
APIVersion: "apps/v1",
Copy link
Contributor

Choose a reason for hiding this comment

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

should we make this a const?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added constants for the Kind and APIVersion

@girishramnani
Copy link
Contributor

/ok-to-test

Signed-off-by: Rajiv Senthilnathan <rajivsen@ca.ibm.com>
@girishramnani
Copy link
Contributor

/ok-to-test

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. Required by Prow. labels Jan 15, 2020
@rajivnathan
Copy link
Contributor Author

/retest

@girishramnani
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: girishramnani

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:

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Jan 21, 2020
@rajivnathan
Copy link
Contributor Author

/retest

Copy link
Contributor

@mohammedzee1000 mohammedzee1000 left a 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
/lgtm


// constants for deployments
const (
DeploymentKind = "Deployment"
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jan 22, 2020
@mohammedzee1000
Copy link
Contributor

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Jan 22, 2020
@mohammedzee1000
Copy link
Contributor

Sorry didnt see req for review by yusuf
/lgtm cancel
/hold cancel

@openshift-ci-robot openshift-ci-robot removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. lgtm Indicates that a PR is ready to be merged. Required by Prow. labels Jan 22, 2020
@mohammedzee1000
Copy link
Contributor

Once @kanchwala-yusuf takes a look we should be good to go

@kanchwala-yusuf
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jan 28, 2020
@openshift-merge-robot openshift-merge-robot merged commit 1985f38 into redhat-developer:master Jan 28, 2020
@rm3l rm3l added the estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. estimated-size/L (20-40) Rough sizing for Epics. About 2 sprints of work for a person. kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lgtm Indicates that a PR is ready to be merged. Required by Prow. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants