Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-8717

`oc patch project` not working with OCP 4.12

    XMLWordPrintable

Details

    • Important
    • No
    • Proposed
    • False
    • Hide

      None

      Show
      None
    • Hide
      An apiserver change in Kubernetes 1.25 caused the metadata.namespace field to be automatically populated in update and patch requests to the "projects" resource. As a result, the affected requests would generate spurious validation errors. The problematic behavior has been disabled for projects.
      Show
      An apiserver change in Kubernetes 1.25 caused the metadata.namespace field to be automatically populated in update and patch requests to the "projects" resource. As a result, the affected requests would generate spurious validation errors. The problematic behavior has been disabled for projects.
    • Bug Fix

    Description

      This is a clone of issue OCPBUGS-8701. The following is the description of the original issue:

      This is a clone of issue OCPBUGS-8232. The following is the description of the original issue:

      Description of problem:

      oc patch project command is failing to annotate the project

      Version-Release number of selected component (if applicable):

      4.12

      How reproducible:

      100%

      Steps to Reproduce:

      1. Run the below patch command to update the annotation on existing project
      ~~~
      oc patch project <PROJECT_NAME> --type merge --patch '{"metadata":{"annotations":{"openshift.io/display-name": "null","openshift.io/description": "This is a new project"}}}'
      ~~~
      
      
      

      Actual results:

      It produces the error output below:
      ~~~
      The Project "<PROJECT_NAME>" is invalid: * metadata.namespace: Invalid value: "<PROJECT_NAME>": field is immutable * metadata.namespace: Forbidden: not allowed on this type 
      ~~~ 

      Expected results:

      The `oc patch project` command should patch the project with specified annotation.

      Additional info:

      Tried to patch the project with OCP 4.11.26 version, and it worked as expected.
      ~~~
      oc patch project <PROJECT_NAME> --type merge --patch '{"metadata":{"annotations":{"openshift.io/display-name": "null","openshift.io/description": "New project"}}}'
      
      project.project.openshift.io/<PROJECT_NAME> patched
      ~~~
      
      The issue is with OCP 4.12, where it is not working. 

       

      Attachments

        Issue Links

          Activity

            People

              bluddy Ben Luddy
              openshift-crt-jira-prow OpenShift Prow Bot
              Rahul Gangwar Rahul Gangwar
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: