Skip to content

Conversation

@ingvagabund
Copy link
Member

$ oc config get-contexts
CURRENT   NAME                                                                               CLUSTER                                                       AUTHINFO                                                                   NAMESPACE
          admin                                                                              test0531                                                      admin                                                                      
          admin-jchaloup                                                                     jchaloup-20200601                                             admin-jchaloup                                                             
          default/api-test0531-group-b-devcluster-openshift-com:6443/system:admin            api-test0531-group-b-devcluster-openshift-com:6443            system:admin/api-test0531-group-b-devcluster-openshift-com:6443            default
*         jenkins/api-jchaloup-20200601-group-b-devcluster-openshift-com:6443/system:admin   api-jchaloup-20200601-group-b-devcluster-openshift-com:6443   system:admin/api-jchaloup-20200601-group-b-devcluster-openshift-com:6443   jenkins
$ oc --context=jenkins/api-jchaloup-20200601-group-b-devcluster-openshift-com:6443/system:admin project
Using project "jenkins" on server "https://api.jchaloup-20200601.group-b.devcluster.openshift.com:6443".
$ oc --context=default/api-test0531-group-b-devcluster-openshift-com:6443/system:admin project
Using project "default" on server "https://api.test0531.group-b.devcluster.openshift.com:6443".
 $ oc project
Using project "jenkins" on server "https://api.jchaloup-20200601.group-b.devcluster.openshift.com:6443".
$ oc config use-context default/api-test0531-group-b-devcluster-openshift-com:6443/system:admin
Switched to context "default/api-test0531-group-b-devcluster-openshift-com:6443/system:admin".
$ oc project
Using project "default" on server "https://api.test0531.group-b.devcluster.openshift.com:6443".
$ oc --context=jenkins/api-jchaloup-20200601-group-b-devcluster-openshift-com:6443/system:admin project
Using project "jenkins" on server "https://api.jchaloup-20200601.group-b.devcluster.openshift.com:6443".
$ oc --context=default/api-test0531-group-b-devcluster-openshift-com:6443/system:admin project
Using project "default" on server "https://api.test0531.group-b.devcluster.openshift.com:6443".

@ingvagabund ingvagabund changed the title oc project: respect --context flag bug 1840411: oc project: respect --context flag Jun 1, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jun 1, 2020
@openshift-ci-robot
Copy link

@ingvagabund: This pull request references Bugzilla bug 1840411, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

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

In response to this:

bug 1840411: oc project: respect --context flag

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/test-infra repository.

@ingvagabund
Copy link
Member Author

/retest

Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One location nit, but the approach is good.
/assign

@ingvagabund ingvagabund force-pushed the oc-project-respect-context-argument branch from e5c9565 to d7ecf75 Compare June 4, 2020 11:13
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ingvagabund, soltysh

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:

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit e4f466b into openshift:master Jun 6, 2020
@openshift-ci-robot
Copy link

@ingvagabund: All pull requests linked via external trackers have merged: openshift/oc#444. Bugzilla bug 1840411 has been moved to the MODIFIED state.

Details

In response to this:

bug 1840411: oc project: respect --context flag

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/test-infra repository.

wking added a commit to wking/oc that referenced this pull request Aug 29, 2025
…mmits

Originally, the change-log generation focused on merge commits, which
are common in many repositories.  For example, in this 'oc' repository:

  $ git log --graph --oneline -10
  *   559c67e (HEAD -> main, origin/main) Merge pull request openshift#2083 from wking/oc-adm-upgrade-recommend-certificate-authority
  |\
  | * b98b2e1 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
  * |   e7900fe Merge pull request openshift#2082 from ardaguclu/code-rabbit-test
  |\ \
  | |/
  |/|
  | * ffe752e Remove mentioning about IRC channel from README
  * | f114b17 OTA-1581: Promote `oc adm upgrade status` to general availability (openshift#2063)
  * |   1c54ec0 Merge pull request openshift#2077 from hongkailiu/OTA-1601
  |\ \
  | * | 5f1dbb8 Move not-lines-related table.Write out of the loop
  | * | a352662 Truncate long reasons
  | * | 11f9f47 Reproduce the long reason issue
  | * | 970f883 status: improve line break handling for CO Message

4299014 (Add squash-merge support into oc adm release info,
2022-04-26, openshift#1116), and mentioned the insights operator:

  $ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
  $ cd insights-operator
  $ git log --graph --oneline -5
  * da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (openshift#1110)
  * 737b59b fix: incorrect anonymization of domains (openshift#1111)
  * b5185da feat: add permissions to gather clusterrole (openshift#1106)
  * 3099eb0 feat: Allow on-demand gathering during initial periodic run (openshift#1109)
  * 7f8b40d RFE-4152: Add missing readonlyRootFilesystem (openshift#1104)

But some repositories also use a mixture of real merges and squash or
rebase merges:

  $ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
  $ cd operator-framework-operator-controller
  $ git log --graph --oneline -11
  * 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
  * 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
  * 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
  * 28299f38 UPSTREAM: <carry>: remove obsolete owners
  * 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
  * 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
  *   a7d35272 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  |\
  | * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
  | * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume
that all content came in via merge commits, and not mention the other
changes:

  $ git log --first-parent --merges --oneline
  a7d3527 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  4cae159 Merge pull request openshift#449 from openshift-bot/synchronize-upstream
  82f63dc Merge pull request openshift#444 from openshift-bot/synchronize-upstream
  6f91d84 Merge pull request openshift#435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those
merges.  But we'll also include the count of any elided, non-merge,
first-parent commits:

  $ git log --first-parent --no-merges --oneline | wc -l
  16

Folks interested in what exactly was elided will have to click through
to 'Full changelog' or otherwise go digging.  But at least they'll get
the count of elided commits to know that there is more information
there to see behind that click.
wking added a commit to wking/oc that referenced this pull request Aug 29, 2025
…mmits

Originally, the change-log generation focused on merge commits, which
are common in many repositories.  For example, in this 'oc' repository:

  $ git log --graph --oneline -10
  *   559c67e (HEAD -> main, origin/main) Merge pull request openshift#2083 from wking/oc-adm-upgrade-recommend-certificate-authority
  |\
  | * b98b2e1 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
  * |   e7900fe Merge pull request openshift#2082 from ardaguclu/code-rabbit-test
  |\ \
  | |/
  |/|
  | * ffe752e Remove mentioning about IRC channel from README
  * | f114b17 OTA-1581: Promote `oc adm upgrade status` to general availability (openshift#2063)
  * |   1c54ec0 Merge pull request openshift#2077 from hongkailiu/OTA-1601
  |\ \
  | * | 5f1dbb8 Move not-lines-related table.Write out of the loop
  | * | a352662 Truncate long reasons
  | * | 11f9f47 Reproduce the long reason issue
  | * | 970f883 status: improve line break handling for CO Message

4299014 (Add squash-merge support into oc adm release info,
2022-04-26, openshift#1116), and mentioned the insights operator:

  $ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
  $ cd insights-operator
  $ git log --graph --oneline -5
  * da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (openshift#1110)
  * 737b59b fix: incorrect anonymization of domains (openshift#1111)
  * b5185da feat: add permissions to gather clusterrole (openshift#1106)
  * 3099eb0 feat: Allow on-demand gathering during initial periodic run (openshift#1109)
  * 7f8b40d RFE-4152: Add missing readonlyRootFilesystem (openshift#1104)

But some repositories also use a mixture of real merges and squash or
rebase merges:

  $ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
  $ cd operator-framework-operator-controller
  $ git log --graph --oneline -11
  * 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
  * 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
  * 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
  * 28299f38 UPSTREAM: <carry>: remove obsolete owners
  * 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
  * 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
  *   a7d35272 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  |\
  | * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
  | * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume
that all content came in via merge commits, and not mention the other
changes:

  $ git log --first-parent --merges --oneline
  a7d3527 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  4cae159 Merge pull request openshift#449 from openshift-bot/synchronize-upstream
  82f63dc Merge pull request openshift#444 from openshift-bot/synchronize-upstream
  6f91d84 Merge pull request openshift#435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those
merges.  But we'll also include the count of any elided, non-merge,
first-parent commits:

  $ git log --first-parent --no-merges --oneline | wc -l
  16

Folks interested in what exactly was elided will have to click through
to 'Full changelog' or otherwise go digging.  But at least they'll get
the count of elided commits to know that there is more information
there to see behind that click.
wking added a commit to wking/oc that referenced this pull request Aug 29, 2025
…mmits

Originally, the change-log generation focused on merge commits, which
are common in many repositories.  For example, in this 'oc' repository:

  $ git log --graph --oneline -10
  *   559c67e (HEAD -> main, origin/main) Merge pull request openshift#2083 from wking/oc-adm-upgrade-recommend-certificate-authority
  |\
  | * b98b2e1 pkg/cli/admin/inspectalerts: Pass through --certificate-authority, etc.
  * |   e7900fe Merge pull request openshift#2082 from ardaguclu/code-rabbit-test
  |\ \
  | |/
  |/|
  | * ffe752e Remove mentioning about IRC channel from README
  * | f114b17 OTA-1581: Promote `oc adm upgrade status` to general availability (openshift#2063)
  * |   1c54ec0 Merge pull request openshift#2077 from hongkailiu/OTA-1601
  |\ \
  | * | 5f1dbb8 Move not-lines-related table.Write out of the loop
  | * | a352662 Truncate long reasons
  | * | 11f9f47 Reproduce the long reason issue
  | * | 970f883 status: improve line break handling for CO Message

4299014 (Add squash-merge support into oc adm release info,
2022-04-26, openshift#1116), and mentioned the insights operator:

  $ git clone --depth 10 --branch master https://github.com/openshift/insights-operator
  $ cd insights-operator
  $ git log --graph --oneline -5
  * da45333 (HEAD -> master, origin/master, origin/HEAD) OCPBUGS-60611: virt launcher logs gatherer (openshift#1110)
  * 737b59b fix: incorrect anonymization of domains (openshift#1111)
  * b5185da feat: add permissions to gather clusterrole (openshift#1106)
  * 3099eb0 feat: Allow on-demand gathering during initial periodic run (openshift#1109)
  * 7f8b40d RFE-4152: Add missing readonlyRootFilesystem (openshift#1104)

But some repositories also use a mixture of real merges and squash or
rebase merges:

  $ git clone --depth 20 --branch main https://github.com/openshift/operator-framework-operator-controller
  $ cd operator-framework-operator-controller
  $ git log --graph --oneline -11
  * 9319f22a (HEAD -> main, origin/main, origin/HEAD) UPSTREAM: <carry>: Ensure unique name for bad-catalog tests
  * 9b50498a UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * 2ed1a5c8 UPSTREAM: <carry>: Migrate single/own namespace tests
  * 0c4f4303 UPSTREAM: <carry>: [OTE] add catalog tests from openshift/origin
  * 28299f38 UPSTREAM: <carry>: remove obsolete owners
  * 5aa7897f UPSTREAM: <carry>: [OTE] - Readme:Add info to help use payload-aggregate with new tests
  * 0bb19537 UPSTREAM: <carry>: Adds ResourceVersion checks to the tls secret deletion test, mirroring the logic used in the certificate rotation test. This makes the test more robust by ensuring a new secret is created, not just that an existing one is still present.
  * e9e3220f UPSTREAM: <carry>: [OTE] Add webhook to validate openshift-service-ca certificate rotation
  *   a7d35272 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  |\
  | * d93f9d16 UPSTREAM: <drop>: configure the commit-checker
  | * 9a69e8ed UPSTREAM: <drop>: remove upstream GitHub configuration

Before this commit, the logic would find the merge commits, assume
that all content came in via merge commits, and not mention the other
changes:

  $ git log --first-parent --merges --oneline
  a7d3527 Merge pull request openshift#453 from openshift-bot/synchronize-upstream
  4cae159 Merge pull request openshift#449 from openshift-bot/synchronize-upstream
  82f63dc Merge pull request openshift#444 from openshift-bot/synchronize-upstream
  6f91d84 Merge pull request openshift#435 from openshift-bot/synchronize-upstream

With this commit, we'll continue to include a line for each of those
merges.  But we'll also include the count of any elided, non-merge,
first-parent commits:

  $ git log --first-parent --no-merges --oneline | wc -l
  16

Folks interested in what exactly was elided will have to click through
to 'Full changelog' or otherwise go digging.  But at least they'll get
the count of elided commits to know that there is more information
there to see behind that click.
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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants