Skip to content

fix oadp detection commands#69

Merged
Joeavaikath merged 1 commit intomigtools:oadp-devfrom
stillalearner:fix_oadp_detection
Oct 16, 2025
Merged

fix oadp detection commands#69
Joeavaikath merged 1 commit intomigtools:oadp-devfrom
stillalearner:fix_oadp_detection

Conversation

@stillalearner
Copy link
Copy Markdown
Contributor

@stillalearner stillalearner commented Oct 16, 2025

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

  1. OADP deployment
  2. DPA check
  3. Velero deployment

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 find openshift-adp-controller-manager deployment
🔍 Looking for DataProtectionApplication (DPA) resources...
Could not find DataProtectionApplication resources
🔍 Looking for Velero deployment as fallback...
⚠️ Could not detect OADP or Velero deployment in cluster
🤔 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:

  1. Test admin commands: kubectl oadp backup get
  2. Test non-admin commands: kubectl oadp nonadmin backup get
  3. Manage NABSL requests: kubectl oadp nabsl get
  4. Change namespace: kubectl oadp client config set namespace=`

@Joeavaikath Joeavaikath merged commit 3e67d37 into migtools:oadp-dev Oct 16, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants