Skip to content

OCPBUGS-56258: Replace deprecated oc sa get-token with oc create token - #119567

Open
smunaval wants to merge 1 commit into
openshift:mainfrom
smunaval:OCPBUGS-56258-oc-create-token
Open

OCPBUGS-56258: Replace deprecated oc sa get-token with oc create token#119567
smunaval wants to merge 1 commit into
openshift:mainfrom
smunaval:OCPBUGS-56258-oc-create-token

Conversation

@smunaval

@smunaval smunaval commented Sep 9, 2026

Copy link
Copy Markdown

Version(s):
main (in-development OpenShift 5.1). Still present in published 4.17-4.22 docs.

Issue:
https://issues.redhat.com/browse/OCPBUGS-56258

Link to docs preview:
Preview is generated after an org member comments /ok-to-test.
Affected module: modules/service-accounts-as-oauth-clients.adoc
Published 4.22 page (still shows the deprecated command):
https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/authentication_and_authorization/using-service-accounts-as-oauth-client

QE review:

  • QE has approved this change.

Additional information:
The service-accounts-as-OAuth-clients topic currently tells users to run:

$ oc sa get-token <service_account_name>

That command is deprecated. The replacement is:

$ oc create token <service_account_name>

Verified still present in OpenShift 4.22:

  • Published 4.22 docs still show $ oc sa get-token <service_account_name> on the OAuth client page above.
  • Reproduced on OCP 4.22.7: oc sa get-token prints a deprecation warning (Use oc create token instead) and fails without a service account name; oc create token works and returns a token.

This PR is a one-line docs change so the procedure matches current oc behavior.

Reproduced on OCP 4.22.7: oc sa get-token fails and is deprecated; oc create token works.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@smunaval: This pull request references Jira Issue OCPBUGS-56258, which is invalid:

  • expected the bug to target the "5.1.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Reproduced on OCP 4.22.7: oc sa get-token fails and is deprecated; oc create token works.

Version(s):

Issue:

Link to docs preview:

QE review:

  • QE has approved this change.

Additional information:

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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Sep 9, 2026
@openshift-ci openshift-ci Bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 9, 2026
@openshift-ci

openshift-ci Bot commented Sep 9, 2026

Copy link
Copy Markdown

Hi @smunaval. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@smunaval: This pull request references Jira Issue OCPBUGS-56258, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Version(s):
main (in-development OpenShift 5.1). Still present in published 4.17–4.22 docs.

Issue:
https://issues.redhat.com/browse/OCPBUGS-56258

Link to docs preview:
Preview is generated after an org member comments /ok-to-test.
Affected module: modules/service-accounts-as-oauth-clients.adoc
Published 4.22 page (still shows the deprecated command):
https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/authentication_and_authorization/using-service-accounts-as-oauth-client

QE review:

  • QE has approved this change.

Additional information:
The service-accounts-as-OAuth-clients topic currently tells users to run:

$ oc sa get-token <service_account_name>

That command is deprecated. The replacement is:

$ oc create token <service_account_name>

Verified still present in OpenShift 4.22:

  • Published 4.22 docs still show $ oc sa get-token <service_account_name> on the OAuth client page above.
  • Reproduced on OCP 4.22.7: oc sa get-token prints a deprecation warning (Use oc create token instead) and fails without a service account name; oc create token works and returns a token.

This PR is a one-line docs change so the procedure matches current oc behavior.

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

Copy link
Copy Markdown

@smunaval: This pull request references Jira Issue OCPBUGS-56258, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Version(s):
main (in-development OpenShift 5.1). Still present in published 4.17–4.22 docs.

Issue:
https://issues.redhat.com/browse/OCPBUGS-56258

Link to docs preview:
Preview is generated after an org member comments /ok-to-test.
Affected module: modules/service-accounts-as-oauth-clients.adoc
Published 4.22 page (still shows the deprecated command):
https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/authentication_and_authorization/using-service-accounts-as-oauth-client

QE review:

  • QE has approved this change.

Additional information:
The service-accounts-as-OAuth-clients topic currently tells users to run:

$ oc sa get-token <service_account_name>

That command is deprecated. The replacement is:

$ oc create token <service_account_name>

Verified still present in OpenShift 4.22:

  • Published 4.22 docs still show $ oc sa get-token <service_account_name> on the OAuth client page above.
  • Reproduced on OCP 4.22.7: oc sa get-token prints a deprecation warning (Use oc create token instead) and fails without a service account name; oc create token works and returns a token.

This PR is a one-line docs change so the procedure matches current oc behavior.

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.

1 similar comment
@openshift-ci-robot

Copy link
Copy Markdown

@smunaval: This pull request references Jira Issue OCPBUGS-56258, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
Details

In response to this:

Version(s):
main (in-development OpenShift 5.1). Still present in published 4.17–4.22 docs.

Issue:
https://issues.redhat.com/browse/OCPBUGS-56258

Link to docs preview:
Preview is generated after an org member comments /ok-to-test.
Affected module: modules/service-accounts-as-oauth-clients.adoc
Published 4.22 page (still shows the deprecated command):
https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/authentication_and_authorization/using-service-accounts-as-oauth-client

QE review:

  • QE has approved this change.

Additional information:
The service-accounts-as-OAuth-clients topic currently tells users to run:

$ oc sa get-token <service_account_name>

That command is deprecated. The replacement is:

$ oc create token <service_account_name>

Verified still present in OpenShift 4.22:

  • Published 4.22 docs still show $ oc sa get-token <service_account_name> on the OAuth client page above.
  • Reproduced on OCP 4.22.7: oc sa get-token prints a deprecation warning (Use oc create token instead) and fails without a service account name; oc create token works and returns a token.

This PR is a one-line docs change so the procedure matches current oc behavior.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants