-
Notifications
You must be signed in to change notification settings - Fork 85
Add ConsoleCLIDownload for oadp-cli #1997
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
base: oadp-dev
Are you sure you want to change the base?
Conversation
| displayName: oadp - OADP operator Command Line Interface (CLI) | ||
| links: | ||
| - href: https://github.com/migtools/oadp-cli/releases/ | ||
| text: Download oadp No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want s/Download oadp/Download OADP CLI/ ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW... OADP should always be in caps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So from the other cli tools on that page, I gathered that lowercase is for the actual command (oc, odo)
So lowercase is used to emphasize that it's the CLI tool which gives you access to that command on the CLI
Basically, matches the other CLI tools on that page
|
This is just a step to making the oadp-cli available to customers. Additional requiements
Issue tracker: migtools/oadp-cli#71 |
|
note that the yaml here will need to also be in config/ dir and run |
654ea69
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Joeavaikath The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Joeavaikath The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2 similar comments
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Joeavaikath The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Joeavaikath The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
ai-explains-test-failure: The unit test build succeeded, but the final lint step failed:
Because |
|
/retest |
|
/retest-required |
weshayutin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image needs to be built on both AMD64 and ARM64 for dev testing purposes.
Node-Selectors: <none>
Tolerations: node.kubernetes.io/memory-pressure:NoSchedule op=Exists
node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 5m45s default-scheduler Successfully assigned openshift-adp/openshift-adp-oadp-cli-server-7689b54d59-dkzcv to ip-10-0-116-201.us-west-2.compute.internal
Normal AddedInterface 5m45s multus Add eth0 [10.131.1.162/23] from ovn-kubernetes
Normal Pulled 5m44s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 996ms (996ms including waiting). Image size: 353031244 bytes.
Normal Pulled 5m42s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 883ms (883ms including waiting). Image size: 353031244 bytes.
Normal Pulled 5m28s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 1.296s (1.296s including waiting). Image size: 353031244 bytes.
Normal Pulled 5m2s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 1.302s (1.302s including waiting). Image size: 353031244 bytes.
Normal Pulled 4m8s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 1.09s (1.09s including waiting). Image size: 353031244 bytes.
Normal Created 2m43s (x6 over 5m44s) kubelet Created container: oadp-cli-server
Normal Started 2m43s (x6 over 5m44s) kubelet Started container oadp-cli-server
Normal Pulled 2m43s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 1.157s (1.157s including waiting). Image size: 353031244 bytes.
Warning BackOff 16s (x26 over 5m41s) kubelet Back-off restarting failed container oadp-cli-server in pod openshift-adp-oadp-cli-server-7689b54d59-dkzcv_openshift-adp(9835f1c8-309f-4bd1-bc9a-f3e0aabbc2fc)
Normal Pulling 2s (x7 over 5m45s) kubelet Pulling image "quay.io/konveyor/oadp-cli-binaries"
Normal Pulled 1s kubelet Successfully pulled image "quay.io/konveyor/oadp-cli-binaries" in 882ms (882ms including waiting). Image size: 353031244 bytes.
whayutin@fedora:~/OPENSHIFT/git/OADP/oadp-operator$ oc get all -n openshift-adp
Warning: apps.openshift.io/v1 DeploymentConfig is deprecated in v4.14+, unavailable in v4.10000+
NAME READY STATUS RESTARTS AGE
pod/f31243f3480a6431d31a9ab844198a2fac80d19d92455907166296678bh26sq 0/1 Completed 0 6m13s
pod/openshift-adp-controller-manager-64d4c876f8-svg5g 1/1 Running 0 6m2s
pod/openshift-adp-oadp-cli-server-7689b54d59-dkzcv 0/1 CrashLoopBackOff 6 (17s ago) 6m2s
pod/ttl-sh-oadp-operator-bundle-8046d1af-1h 1/1 Running 0 6m17s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/openshift-adp-cli-server ClusterIP 172.30.125.71 <none> 80/TCP 6m6s
service/openshift-adp-controller-manager-metrics-service ClusterIP 172.30.11.45 <none> 8443/TCP 6m6s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/openshift-adp-controller-manager 1/1 1 1 6m3s
deployment.apps/openshift-adp-oadp-cli-server 0/1 1 0 6m3s
NAME DESIRED CURRENT READY AGE
replicaset.apps/openshift-adp-controller-manager-64d4c876f8 1 1 1 6m3s
replicaset.apps/openshift-adp-oadp-cli-server-7689b54d59 1 1 0 6m3s
NAME STATUS COMPLETIONS DURATION AGE
job.batch/f31243f3480a6431d31a9ab844198a2fac80d19d92455907166296678b5f237 Complete 1/1 6s 6m14s
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
route.route.openshift.io/oadp-cli-server-route oadp-cli-server-route-openshift-adp.apps.wdharm420.migration.redhat.com openshift-adp-cli-server http edge/Redirect None
whayutin@fedora:~/OPENSHIFT/git/OADP/oadp-operator$ oc logs -f deployment.apps/openshift-adp-oadp-cli-server
exec container process `/usr/local/bin/download-server`: Exec format error
|
Installation should be tightened up a little: TO |
|
ConsoleCLIDownload is a cluster scoped resource |
As long as each time this creates, if one already exists, it gets updated to the newest version without failing I think it's safe to have this be leftover. |
|
On a fresh operator install, the deployment is reset and so we get the latest image for oadp-cli-binaries regardless of ConsoleCLIDownload resource being there, cause it just points to it |
|
/retest ai-retester: The |
|
/retest ai-retester: The "Mongo application CSI" test timed out because the |
|
/retest ai-retester: The end-to-end test |
|
/retest ai-retester: The Mongo backup/restore test never got out of the “waiting to start” state – the |
|
/retest ai-retester: The |
|
/retest |
|
@kaovilai @Joeavaikath you have to rebase :) |
|
As far as prow goes, no you don't. :) assuming no conflicts |
|
/retest |
receipts if interested in digging more: emphasis mine. TL;DR: each test run contains changes from base branch merged into it. Subsequent retests or new test triggers also bring latest base branch changes into it. |
|
/retest ai-retester: The |
|
/retest ai-retester: The |
Signed-off-by: Joseph <jvaikath@redhat.com>
…and ConsoleCLIDownload will be moved into a controller Signed-off-by: Joseph <jvaikath@redhat.com>
Better than piggybacking off leader election, if leader changes it will repeatcontroller can better ensure route changes and deployment changes don't affect the end goal of having ConsoleCLIDownload with the right link Signed-off-by: Joseph <jvaikath@redhat.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
75f4d68 to
b46f2af
Compare
WalkthroughAdds OpenShift Console CLI download support: new CLI download controller that manages a CLI server Deployment, Service, Route, and ConsoleCLIDownload; RBAC for console.openshift.io; manager env var and relatedImage; console API scheme registration and controller wiring. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
cmd/main.go (1)
275-284: Guard CLI download setup whenWATCH_NAMESPACEis empty
CLIDownloadSetupassumeswatchNamespaceis the operator namespace and non-empty. WhengetWatchNamespace()fails and returns"", this runnable will try to create namespaced resources with an empty namespace, which can cause startup failures in “watch all namespaces” scenarios.Consider short-circuiting here (e.g., skip adding
CLIDownloadSetupor make it a no-op) whenwatchNamespace == "".internal/controller/cli_download_controller.go (2)
76-122: Reconcile Deployment/Service spec to handle upgrades, not just initial create
reconcileCLIResourcesonly creates the Deployment and Service onIsNotFoundand otherwise leaves them untouched. If you later change the CLI server image, ports, or resource requests, existing clusters will keep the old spec indefinitely.Consider reconciling to a desired spec (or using
controllerutil.CreateOrUpdate) so that Deployment and Service are updated when the operator version or image reference changes, while still being idempotent.
155-167: Tighten retry logic for route hostname to avoid unbounded goroutinesWhen
route.Spec.Hostis empty, the code logs and spawns a goroutine that sleeps 5s and callsreconcileCLIResourcesagain. If the route never gets a hostname (e.g., misconfig or router issue), this will recursively schedule retries forever, leaking goroutines and generating repeated API traffic.Consider instead:
- Looping with backoff inside the existing call while honoring
ctx.Done(), or- Returning an error and letting a higher-level retry (or manager restart) handle it, or
- Using a bounded retry loop with a maximum number of attempts before giving up with a clear log message.
This keeps behavior predictable and avoids silent background loops.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (6)
bundle/manifests/oadp-operator.clusterserviceversion.yaml(3 hunks)cmd/main.go(3 hunks)config/manager/manager.yaml(1 hunks)config/rbac/role.yaml(1 hunks)internal/controller/cli_download_controller.go(1 hunks)internal/controller/dataprotectionapplication_controller.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
config/manager/manager.yamlcmd/main.gointernal/controller/dataprotectionapplication_controller.goconfig/rbac/role.yamlinternal/controller/cli_download_controller.gobundle/manifests/oadp-operator.clusterserviceversion.yaml
🔇 Additional comments (5)
internal/controller/dataprotectionapplication_controller.go (1)
64-76: RBAC forconsoleclidownloadsis consistent and appropriately scopedThe added kubebuilder RBAC marker for
console.openshift.io/consoleclidownloadsmatches the ClusterRole/CSV updates and gives the operator exactly the verbs it needs for the new Console CLI download flow.config/manager/manager.yaml (1)
71-100: NewRELATED_IMAGE_CONSOLE_CLI_DOWNLOADenv wiring looks correctThe env var is added alongside other RELATED_IMAGE_* entries and aligns with the CSV deployment, so the CLI server image will be available both in-cluster and for local manager.yaml–driven runs.
config/rbac/role.yaml (1)
67-78: ClusterRole permissions forconsoleclidownloadsare appropriateGranting full CRUD + watch on
console.openshift.io/consoleclidownloadstomanager-rolelines up with the new controller behavior and other RBAC markers, without widening scope beyond that resource type.bundle/manifests/oadp-operator.clusterserviceversion.yaml (1)
1048-1059: CSV RBAC, env, andrelatedImagesupdates are coherentThe new
consoleclidownloadsRBAC, theRELATED_IMAGE_CONSOLE_CLI_DOWNLOADenv on the controller deployment, and theconsole-cli-downloadrelatedImagesentry are all consistent with the rest of the manifests and the new CLI download controller.Also applies to: 1307-1308, 1479-1480
internal/controller/cli_download_controller.go (1)
34-40: The review comment is incorrect:client.Clientdoes have aScheme()methodThe controller-runtime client.Client interface includes Scheme() *runtime.Scheme. The code at lines 88, 111, and 134 calling
c.Client.Scheme()inSetOwnerReferencecalls is valid and will compile successfully. The struct does not need modification, and the suggested fix is unnecessary.Likely an incorrect or invalid review comment.
|
/retest-required |
Signed-off-by: Joseph <jvaikath@redhat.com>
Signed-off-by: Joseph <jvaikath@redhat.com>
|
@Joeavaikath: The following tests failed, say
Full PR test history. Your PR dashboard. 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. |
|
/retest |
|
All tests passing, wow |
| Port: &routev1.RoutePort{ | ||
| TargetPort: intstr.FromString("http"), | ||
| }, | ||
| TLS: &routev1.TLSConfig{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test after removing this
Traffic from route to svc is http

Why the changes were made
Tackles migtools/oadp-cli#76
Two main changes:
Flow:
How to test the changes made