Skip to content

[SREP-3299] feat: Add readonly flag for backplane login command#886

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
samanthajayasinghe:readonly-login
Feb 5, 2026
Merged

[SREP-3299] feat: Add readonly flag for backplane login command#886
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
samanthajayasinghe:readonly-login

Conversation

@samanthajayasinghe
Copy link
Contributor

@samanthajayasinghe samanthajayasinghe commented Feb 2, 2026

What type of PR is this?

  • fix (Bug Fix)
  • feat (New Feature)
  • docs (Documentation)
  • test (Test Coverage)
  • chore (Clean Up / Maintenance Tasks)
  • other (Anything that doesn't fit the above)

What this PR does / Why we need it?

Adding readonly flag to the backplane CLI

Which Jira/Github issue(s) does this PR fix?

  • Related Issue #
  • Closes #

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • Ran unit tests locally
  • Validated the changes in a cluster
  • Included documentation changes with PR
  • Backward compatible

/label tide/merge-method-squash

@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 2, 2026

@samanthajayasinghe: This pull request references SREP-3299 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What type of PR is this?

  • fix (Bug Fix)
  • [*] feat (New Feature)
  • docs (Documentation)
  • test (Test Coverage)
  • chore (Clean Up / Maintenance Tasks)
  • other (Anything that doesn't fit the above)

What this PR does / Why we need it?

Adding readonly flag to the backplane CLI

Which Jira/Github issue(s) does this PR fix?

  • Related Issue #
  • Closes #

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • [*] Ran unit tests locally
  • [*] Validated the changes in a cluster
  • Included documentation changes with PR
  • Backward compatible

/label tide/merge-method-squash

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 2, 2026
@openshift-ci openshift-ci bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Feb 2, 2026
@openshift-ci openshift-ci bot requested review from a7vicky and feichashao February 2, 2026 23:31
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 2, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Feb 2, 2026

@samanthajayasinghe: This pull request references SREP-3299 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What type of PR is this?

  • fix (Bug Fix)
  • feat (New Feature)
  • docs (Documentation)
  • test (Test Coverage)
  • chore (Clean Up / Maintenance Tasks)
  • other (Anything that doesn't fit the above)

What this PR does / Why we need it?

Adding readonly flag to the backplane CLI

Which Jira/Github issue(s) does this PR fix?

  • Related Issue #
  • Closes #

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • Ran unit tests locally
  • Validated the changes in a cluster
  • Included documentation changes with PR
  • Backward compatible

/label tide/merge-method-squash

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 openshift-eng/jira-lifecycle-plugin repository.

@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 53.04%. Comparing base (62a772a) to head (a63c24e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/ocm-backplane/login/login.go 95.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
+ Coverage   52.91%   53.04%   +0.12%     
==========================================
  Files          86       86              
  Lines        6525     6538      +13     
==========================================
+ Hits         3453     3468      +15     
+ Misses       2610     2609       -1     
+ Partials      462      461       -1     
Files with missing lines Coverage Δ
cmd/ocm-backplane/login/login.go 67.30% <95.00%> (+1.05%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samanthajayasinghe
Copy link
Contributor Author

/test lint

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 4, 2026

@samanthajayasinghe: all tests passed!

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.

@xiaoyu74
Copy link
Contributor

xiaoyu74 commented Feb 5, 2026

Thanks @samanthajayasinghe - The code logic looks good to me.

As https://gitlab.cee.redhat.com/service/backplane-api/-/merge_requests/755 has been merged and has been deployed in staging env: https://redhat-internal.slack.com/archives/C0140EM7BFW/p1770265553055589

Just run an E2E with the newly build bp-cli binary with this PR:

 ./ocm-backplane login 2nto5tnphh185ao4394ltrt8urchm1mc --readonly

kubeconfig updated with ro path para added in serverURL

apiVersion: v1
clusters:
- cluster:
    proxy-url: http://squid.corp.redhat.com:3128
    server: https://api.stage.backplane.openshift.com/backplane/cluster/2nto5tnphh185ao4394ltrt8urchm1mc/ro/
  name: shawn-welly-hcp
contexts:
- context:
    cluster: shawn-welly-hcp
    namespace: default
    user: sbai.openshift
  name: default/shawn-welly-hcp/sbai.openshift
current-context: default/shawn-welly-hcp/sbai.openshif

Call cluster-api with write and it's blocked as expected:

oc create ns test
Error from server (Forbidden): unknown (post namespaces)

@xiaoyu74 xiaoyu74 changed the title SREP-3299: Add readonly flag for backplane login command [SREP-3299] feat: Add readonly flag for backplane login command Feb 5, 2026
@openshift-ci-robot openshift-ci-robot removed the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Feb 5, 2026
@openshift-ci-robot
Copy link

@samanthajayasinghe: No Jira issue is referenced in the title of this pull request.
To reference a jira issue, add 'XYZ-NNN:' to the title of this pull request and request another refresh with /jira refresh.

Details

In response to this:

What type of PR is this?

  • fix (Bug Fix)
  • feat (New Feature)
  • docs (Documentation)
  • test (Test Coverage)
  • chore (Clean Up / Maintenance Tasks)
  • other (Anything that doesn't fit the above)

What this PR does / Why we need it?

Adding readonly flag to the backplane CLI

Which Jira/Github issue(s) does this PR fix?

  • Related Issue #
  • Closes #

Special notes for your reviewer

Unit Test Coverage

Guidelines

  • If it's a new sub-command or new function to an existing sub-command, please cover at least 50% of the code
  • If it's a bug fix for an existing sub-command, please cover 70% of the code

Test coverage checks

  • Added unit tests
  • Created jira card to add unit test
  • This PR may not need unit tests

Pre-checks (if applicable)

  • Ran unit tests locally
  • Validated the changes in a cluster
  • Included documentation changes with PR
  • Backward compatible

/label tide/merge-method-squash

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 openshift-eng/jira-lifecycle-plugin repository.

@xiaoyu74
Copy link
Contributor

xiaoyu74 commented Feb 5, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 5, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: samanthajayasinghe, xiaoyu74

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:
  • OWNERS [samanthajayasinghe,xiaoyu74]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 005c98d into openshift:main Feb 5, 2026
7 checks passed
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. lgtm Indicates that a PR is ready to be merged. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants