fix oadp detection commands#69
Merged
Joeavaikath merged 1 commit intomigtools:oadp-devfrom Oct 16, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why the changes were made
The OADP CLI installation process was failing to detect existing OADP deployments in the cluster, even when they were properly installed. This was caused by incorrect kubectl commands in the detection logic that tried to retrieve specific named resources across all namespaces, which is not supported by kubectl.
Problems fixed:
CLI incorrectly reported "Could not find openshift-adp-controller-manager deployment" even when the deployment existed
CLI incorrectly reported "Could not find Velero deployment" even when Velero deployments existed
Users with properly installed OADP were unable to use the CLI due to false negative detection
Root cause: The commands kubectl get deployment --all-namespaces don't work because kubectl doesn't allow retrieving specific named resources across all namespaces. This caused the detection logic to always fail, even when deployments existed.
Also, This PR includes changes to make sure
All the 3 checks are performed everytime.
Output before fix( even when oadp controller was installed with no DPA) :
`
📋 Configuration:
🔍 Detecting OADP deployment in cluster...
⚠️ Could not detect OADP or Velero deployment in cluster
Could not find openshift-adp-controller-manager deployment
🔍 Looking for DataProtectionApplication (DPA) resources...
Could not find DataProtectionApplication resources
🔍 Looking for Velero deployment as fallback...
🤔 Which namespace should admin commands use for Velero resources?
(Common options: openshift-adp, velero, oadp)
`
How to test the changes made
make install
Output after fix (when oadp is installed with DPA)
`make install
Building kubectl-oadp for current platform (darwin/arm64)...
✅ Built kubectl-oadp successfully!
Installing kubectl-oadp to /Users/ssingla/.local/bin...
✅ Installed to /Users/ssingla/.local/bin
🔍 Checking PATH configuration...
✅ /Users/ssingla/.local/bin is already in PATH
📋 Configuration:
🔍 Detecting OADP deployment in cluster...
✅ Found OADP controller in namespace: openshift-adp
🔍 Looking for DataProtectionApplication (DPA) resources...
✅ Found DPA resource in namespace: openshift-adp
🔍 Looking for Velero deployment as fallback...
✅ Found Velero deployment in namespace: openshift-adp
Setting Velero namespace to: openshift-adp
✅ Client config initialized
🧪 Verifying installation...
✅ Installation verified: kubectl oadp plugin is accessible
Client:
Version:
Git commit: -
Server:
Version: v1.16.1-OADP
📋 Next steps: