Skip to content

OADP CLI check - do not attempt to connect to server#1904

Closed
mpryc wants to merge 1 commit into
openshift:oadp-devfrom
mpryc:fix-oadp-cli-check
Closed

OADP CLI check - do not attempt to connect to server#1904
mpryc wants to merge 1 commit into
openshift:oadp-devfrom
mpryc:fix-oadp-cli-check

Conversation

@mpryc
Copy link
Copy Markdown
Contributor

@mpryc mpryc commented Aug 14, 2025

Use --client with kubectl oadp version in the CLI availability check to ensure it only reports the client version without attempting to connect to the cluster. This prevents errors when the velero namespace is not yet present during test setup.

The example error:
https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/openshift_oadp-operator/1897/pull-ci-openshift-oadp-operator-oadp-dev-4.19-e2e-test-cli-aws/1955901235508809728/artifacts/e2e-test-cli-aws/e2e/build-log.txt

@openshift-ci openshift-ci Bot requested review from kaovilai and weshayutin August 14, 2025 09:59
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Aug 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mpryc

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

The pull request process is described here

Details 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. label Aug 14, 2025
Use `--client-only` with `kubectl oadp version` in the CLI
availability check to ensure it only reports the client
version without attempting to connect to the cluster.

Signed-off-by: Michal Pryc <mpryc@redhat.com>
@mpryc mpryc force-pushed the fix-oadp-cli-check branch from cbf5124 to 8de0f08 Compare August 14, 2025 12:22
// Verify OADP CLI is available (should be installed in Docker image)
log.Print("Verifying OADP CLI is available...")
cmd := exec.Command("kubectl", "oadp", "version")
cmd := exec.Command("kubectl", "oadp", "version", "--client-only")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's how currently oadp client is implemented but IMO the flag should be --client to match what is in the kubectl:

https://kubernetes.io/docs/reference/kubectl/#operations

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's more a parallel to how velero CLI is doing, not exactly kubectl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think keep it same as velero CLI, and propose velero CLI upstream match kubectl in the future.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Aug 14, 2025

@mpryc: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/4.20-e2e-test-hcp-aws 8de0f08 link false /test 4.20-e2e-test-hcp-aws
ci/prow/4.19-e2e-test-cli-aws 8de0f08 link true /test 4.19-e2e-test-cli-aws
ci/prow/4.19-e2e-test-hcp-aws 8de0f08 link true /test 4.19-e2e-test-hcp-aws

Full PR test history. Your PR dashboard.

Details

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.

@kaovilai kaovilai requested a review from Joeavaikath August 14, 2025 18:45
@kaovilai
Copy link
Copy Markdown
Member

kaovilai commented Aug 14, 2025

From reviewing recent CLI e2e PR, failures are from a path issue and solved in #1899. Even with velero version trying to connect to server, it is only printing as error, but is not the root cause of recent cli CI failures.

We can leave this PR open for discussion if we rather this check be purely client-only for cleaner logs/semantics.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 16, 2025
@openshift-merge-robot
Copy link
Copy Markdown

PR needs rebase.

Details

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.

@weshayutin
Copy link
Copy Markdown
Contributor

whayutin@fedora:~/OPENSHIFT/git/OADP/oadp-operator$ remote_velero version
Client:
	Version: konveyor-dev
	Git commit: -
Server:
	Version: konveyor-dev
whayutin@fedora:~/OPENSHIFT/git/OADP/oadp-operator$ oc oadp version
Client:
	Version: 
	Git commit: -
Server:
	Version: konveyor-dev

@weshayutin weshayutin closed this Oct 9, 2025
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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants