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

Adding KUBECONFIG checks in odo catalog list components #4756

Merged

Conversation

mohammedzee1000
Copy link
Contributor

@mohammedzee1000 mohammedzee1000 commented May 31, 2021

What type of PR is this?
/kind bug

What does this PR do / why we need it:
This PR prevents outright error when provided KUBECONFIG env is invalid (not exists or is a directory) when odo catalog list components command is executed

Which issue(s) this PR fixes:

Fixes #4687

PR acceptance criteria:

  • Unit test

  • Integration test

  • Documentation

  • Update changelog

  • I have read the test guidelines

How to test changes / Special notes to the reviewer:

 ➜ make bin
go build -mod=vendor -ldflags="-X github.com/openshift/odo/pkg/version.GITCOMMIT=017422922" cmd/odo/odo.go
 ➜ KUBECONFIG="/doesnotexist" ./odo catalog list components
Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
java-openliberty              Java application stack using Open Liberty runtime                   DefaultDevfileRegistry
java-quarkus                  Upstream Quarkus with Java+GraalVM                                  DefaultDevfileRegistry
java-springboot               Spring Boot® using Java                                             DefaultDevfileRegistry
java-vertx                    Upstream Vert.x using Java                                          DefaultDevfileRegistry
java-wildfly                  Upstream WildFly                                                    DefaultDevfileRegistry
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     DefaultDevfileRegistry
nodejs                        Stack with NodeJS 12                                                DefaultDevfileRegistry
python                        Python Stack with Python 3.7                                        DefaultDevfileRegistry
python-django                 Python3.7 with Django                                               DefaultDevfileRegistry
 ➜ KUBECONFIG="`pwd`" ./odo catalog list components
Odo Devfile Components:
NAME                          DESCRIPTION                                                         REGISTRY
java-maven                    Upstream Maven and OpenJDK 11                                       DefaultDevfileRegistry
java-openliberty              Java application stack using Open Liberty runtime                   DefaultDevfileRegistry
java-quarkus                  Upstream Quarkus with Java+GraalVM                                  DefaultDevfileRegistry
java-springboot               Spring Boot® using Java                                             DefaultDevfileRegistry
java-vertx                    Upstream Vert.x using Java                                          DefaultDevfileRegistry
java-wildfly                  Upstream WildFly                                                    DefaultDevfileRegistry
java-wildfly-bootable-jar     Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     DefaultDevfileRegistry
nodejs                        Stack with NodeJS 12                                                DefaultDevfileRegistry
python                        Python Stack with Python 3.7                                        DefaultDevfileRegistry
python-django                 Python3.7 with Django                                               DefaultDevfileRegistry

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label May 31, 2021
@openshift-ci openshift-ci bot requested review from dharmit and prietyc123 May 31, 2021 06:30
pkg/util/util.go Outdated Show resolved Hide resolved
tests/integration/devfile/cmd_devfile_catalog_test.go Outdated Show resolved Hide resolved
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
pkg/util/util.go Outdated Show resolved Hide resolved
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
@feloy
Copy link
Contributor

feloy commented Jun 1, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jun 1, 2021
@girishramnani
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jun 1, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: girishramnani, mohammedzee1000

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. Required by Prow. label Jun 1, 2021
@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.

@mohammedzee1000
Copy link
Contributor Author

/refresh

@openshift-merge-robot openshift-merge-robot merged commit 07636c2 into redhat-developer:main Jun 1, 2021
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. kind/bug Categorizes issue or PR as related to a bug. 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.

odo catalog list components fails with non existing kubeconfig
5 participants