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

[Devfile] Remove namespace flag from odo commands #2909

Merged

Conversation

johnmcollier
Copy link
Member

@johnmcollier johnmcollier commented Apr 16, 2020

What type of PR is this?

Uncomment only one /kind line, and delete the rest.
For example, > /kind bug would simply become: /kind bug

/kind cleanup
/area devfile

What does does this PR do / why we need it:
As mentioned earlier, we decided to use only the --project flag in odo for devfile components and to not use --namespace at this moment. This PR removes the --namespace flag that was added to certain odo commands for use with devfile components and uses --project instead. For commands that didn't have the --project flag added to it, the flag was added.

Integration tests updated to use --project only as well.

Which issue(s) this PR fixes:

Fixes #2769

How to test changes / Special notes to the reviewer:

  • Run the unit and integration tests
  • odo create --project <project> -> Verify namespace/project in env.yaml is correct
  • odo push --project <project> -> should push to the proper namespace
  • odo delete --project <project> -> should delete from the proper namespace
  • odo watch --project <project> -> should push changes to the proper namespace

Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@openshift-ci-robot openshift-ci-robot added kind/cleanup area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. labels Apr 16, 2020
@johnmcollier
Copy link
Member Author

/retest

More OpenShift CI flakiness

@johnmcollier
Copy link
Member Author

/retest

@codecov
Copy link

codecov bot commented Apr 17, 2020

Codecov Report

Merging #2909 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2909   +/-   ##
=======================================
  Coverage   44.71%   44.71%           
=======================================
  Files         107      107           
  Lines       10126    10126           
=======================================
  Hits         4528     4528           
  Misses       5162     5162           
  Partials      436      436           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08c339c...58c1aa1. Read the comment docs.

@kadel
Copy link
Member

kadel commented Apr 17, 2020

/approve

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kadel

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. labels Apr 17, 2020
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 17, 2020
@@ -65,6 +66,13 @@ func (po *PushOptions) Complete(name string, cmd *cobra.Command, args []string)
}
po.EnvSpecificInfo = envinfo
po.Context = genericclioptions.NewDevfileContext(cmd)

if cmd.Flags().Changed("project") {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be moved here https://github.com/openshift/odo/blob/6740e5177ae11db734f7d3d303c4f689015e3b91/pkg/odo/genericclioptions/context.go#L343. We are repeating the same steps in all the above files.

Copy link
Member Author

Choose a reason for hiding this comment

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

@mik-dass You're right, good catch!

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, we don't need to move any code to resolveNamespace, just update it to retrieve the namespace from the --project flag.

So long as we initialize the devfile context in each command that needs it, we can retrieve the namespace via kclient.Namespace

Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@johnmcollier
Copy link
Member Author

/retest

1 similar comment
@johnmcollier
Copy link
Member Author

/retest

Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@johnmcollier
Copy link
Member Author

/retest

@johnmcollier
Copy link
Member Author

More CI infra flakes 😢

/retest

Signed-off-by: John Collier <John.J.Collier@ibm.com>
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. Required by Prow. label Apr 24, 2020
@johnmcollier
Copy link
Member Author

/retest

Giving the builds a kick due to the gosec issues earlier

@johnmcollier
Copy link
Member Author

/retest

1 similar comment
@johnmcollier
Copy link
Member Author

/retest

@johnmcollier
Copy link
Member Author

@mik-dass I've rebased and addressed your review comment (retrieving namespace from the getNamespace function)

Copy link
Contributor

@mik-dass mik-dass left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 27, 2020
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

2 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@johnmcollier
Copy link
Member Author

There may be a potential merge conflict with this and #2922, so I'm holding this so that it doesn't slip in to this afternoon's release and delay 2922. I'll cancel the hold after the release.

/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 Apr 27, 2020
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 27, 2020
Signed-off-by: John Collier <John.J.Collier@ibm.com>
@johnmcollier
Copy link
Member Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. Required by Prow. label Apr 27, 2020
@maysunfaisal
Copy link
Contributor

maysunfaisal commented Apr 27, 2020

tests were updated! Thx
re-adding lgtm
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Apr 27, 2020
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

5 similar comments
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit f81ca6b into redhat-developer:master Apr 28, 2020
@rm3l rm3l added the area/refactoring Issues or PRs related to code refactoring label Jun 16, 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. area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. area/refactoring Issues or PRs related to code refactoring lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Devfile odo push should use --project instead of --namespace
8 participants