openshift / oc

The OpenShift Command Line, part of OKD
https://www.openshift.org
Apache License 2.0
185 stars 373 forks source link

OCPBUGS-32108: stop loading legacy schemes on global scheme #1775

Closed flavianmissi closed 1 month ago

flavianmissi commented 1 month ago

for some reason, when loading ungroupified legacy schemes oc set env overrides apiVersion values of openshift objects, removing the api group, which makes them invalid in recent versions of openshift.

what changed

testing

openshift-ci-robot commented 1 month ago

@flavianmissi: This pull request references Jira Issue OCPBUGS-32108, which is invalid:

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.

In response to [this](https://github.com/openshift/oc/pull/1775): >for some reason, when loading ungroupified legacy schemes `oc set env` overrides `apiVersion` values of openshift objects, removing the api group, which makes them invalid in recent versions of openshift. > >wip because we need to fully understand the side-effects of removing this before moving forward with this change. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
flavianmissi commented 1 month ago

errors seem legit:

error: missing apiVersion or kind and cannot assign it; no kind is registered for the type v1.ClusterResourceQuota in scheme \"k8s.io/kubectl/pkg/scheme/scheme.go:28\"
...
error: missing apiVersion or kind and cannot assign it; no kind is registered for the type v1.Route in scheme "k8s.io/kubectl/pkg/scheme/scheme.go:28"

will look into it later.

flavianmissi commented 1 month ago

test failures seem unrelated /retest

flavianmissi commented 1 month ago

/jira refresh

openshift-ci-robot commented 1 month ago

@flavianmissi: This pull request references Jira Issue OCPBUGS-32108, 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 (4.17.0) matches configured target version for branch (4.17.0) * bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact: /cc @zhouying7780

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

In response to [this](https://github.com/openshift/oc/pull/1775#issuecomment-2137385830): >/jira refresh Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
flavianmissi commented 1 month ago

latest force push only rewords a commit to better describe its changes.

openshift-ci-robot commented 1 month ago

@flavianmissi: This pull request references Jira Issue OCPBUGS-32108, which is valid.

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

Requesting review from QA contact: /cc @zhouying7780

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

In response to [this](https://github.com/openshift/oc/pull/1775): >for some reason, when loading ungroupified legacy schemes `oc set env` overrides `apiVersion` values of openshift objects, removing the api group, which makes them invalid in recent versions of openshift. > >### what changed >* remove global loading of legacy schemes >* create custom schemes for create and expose commands >* override upstream expose print flag type setter to use the custom expose scheme > >### testing >* regression tests for `oc` >* ensure that `oc set env` no longer overrides the `apiVersion` of routes and deployment configs >* ensure we don't regress https://issues.redhat.com/browse/OCPBUGS-15772; in other words, make sure `oc set route-backends` and `oc edit route` work in microshift >* ? Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 1 month ago

@flavianmissi: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
ardaguclu commented 1 month ago

Thank you /lgtm

openshift-ci[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ardaguclu, flavianmissi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/oc/blob/master/OWNERS)~~ [ardaguclu] 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 commented 1 month ago

@flavianmissi: Jira Issue OCPBUGS-32108: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-32108 has been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/oc/pull/1775): >for some reason, when loading ungroupified legacy schemes `oc set env` overrides `apiVersion` values of openshift objects, removing the api group, which makes them invalid in recent versions of openshift. > >### what changed >* remove global loading of legacy schemes >* create custom schemes for create and expose commands >* override upstream expose print flag type setter to use the custom expose scheme > >### testing >* regression tests for `oc` >* ensure that `oc set env` no longer overrides the `apiVersion` of routes and deployment configs >* ensure we don't regress https://issues.redhat.com/browse/OCPBUGS-15772; in other words, make sure `oc set route-backends` and `oc edit route` work in microshift >* ? Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Foc). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
flavianmissi commented 1 month ago

thanks for the approval @ardaguclu ! as promised, here's a follow-up PR removing the legacy pkg: https://github.com/openshift/oc/pull/1791

openshift-bot commented 1 month ago

[ART PR BUILD NOTIFIER]

This PR has been included in build openshift-enterprise-cli-container-v4.17.0-202405311312.p0.g672cf68.assembly.stream.el9 for distgit openshift-enterprise-cli. All builds following this will include this PR.