Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odf-info: stop owning the odf-info configMap #2959

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

rewantsoni
Copy link
Member

Since odf-info is created in operator namespace, in case of multi- storageCluster, we get a "cross-namespace owner references are disallowed" issue. To address this, stop owning the configMap and watch the configMap from storageCluster reconciler

More info on "cross-namespace owner references are disallowed" here.

Bug: https://issues.redhat.com/browse/DFBUGS-1266

@rewantsoni
Copy link
Member Author

/hold for testing

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 9, 2025
Since odf-info is created in operator namespace, in case of multi
storageCluster, we get a "cross-namespace owner references are
disallowed" issue. To address this, stop owning the configMap
and watch the configMap from storageCluster reconciler

Signed-off-by: Rewant Soni <[email protected]>
Signed-off-by: Rewant Soni <[email protected]>
Copy link
Member

@iamniting iamniting left a comment

Choose a reason for hiding this comment

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

Changes looks good to me, Can you pls test it. Once verified pls remove the hold.

/hold

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 9, 2025
Copy link
Contributor

openshift-ci bot commented Jan 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iamniting, rewantsoni

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 9, 2025
@rewantsoni
Copy link
Member Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@rewantsoni: once the present PR merges, I will cherry-pick it on top of release-4.18 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.18

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.

@rewantsoni
Copy link
Member Author

Tested by updating the operator image on the 4.17 cluster:

apiVersion: v1
data:
  openshift-storage-extended_ocs-external-storagecluster.config.yaml: |
    version: 4.17.2-rhodf
    deploymentType: external
    clients: []
    storageCluster:
      namespacedName:
        namespace: openshift-storage-extended
        name: ocs-external-storagecluster
      storageProviderEndpoint: ""
      cephClusterFSID: fed0dd40-d244-11ef-8777-0050568f2b8d
      isDrOptimized: "false"
    storageSystemName: ocs-external-storagecluster-storagesystem
  openshift-storage_ocs-storagecluster.config.yaml: |
    version: 4.17.2-rhodf
    deploymentType: internal
    clients: []
    storageCluster:
      namespacedName:
        namespace: openshift-storage
        name: ocs-storagecluster
      storageProviderEndpoint: ""
      cephClusterFSID: 4f76f6a2-cbac-40dc-8dec-fcb373c4a52f
      isDrOptimized: "false"
    storageSystemName: ocs-storagecluster-storagesystem
kind: ConfigMap
metadata:
  creationTimestamp: "2025-01-14T08:24:20Z"
  name: odf-info
  namespace: openshift-storage
  ownerReferences:
  - apiVersion: ocs.openshift.io/v1
    kind: StorageCluster
    name: ocs-storagecluster
    uid: b7a7701c-7fbf-422a-b532-541879efd96b
  resourceVersion: "262526"
  uid: 2edf7879-9e7f-4072-b04c-144dea0bac52
  
  
 NAMESPACE                    NAME                          AGE     PHASE   EXTERNAL   CREATED AT             VERSION
openshift-storage-extended   ocs-external-storagecluster   6h37m   Ready   true       2025-01-14T08:24:39Z   4.17.0
openshift-storage            ocs-storagecluster            6h41m   Ready              2025-01-14T08:21:06Z   4.17.0

@rewantsoni
Copy link
Member Author

[rewantsoni multicluster] date && k get cm odf-info -nopenshift-storage
Wed Jan 15 12:59:06 IST 2025
NAME       DATA   AGE
odf-info   1      68s
[rewantsoni multicluster] date && k delete cm odf-info -nopenshift-storage
Wed Jan 15 12:59:20 IST 2025
configmap "odf-info" deleted
[rewantsoni multicluster] date && k get cm odf-info -nopenshift-storage   
Wed Jan 15 12:59:24 IST 2025
NAME       DATA   AGE
odf-info   1      4s
[rewantsoni multicluster] date && k get cm odf-info -nopenshift-storage -oyaml
Wed Jan 15 13:03:56 IST 2025
apiVersion: v1
data:
  openshift-storage-extended_ocs-external-storagecluster.config.yaml: |
    version: 4.17.2-rhodf
    deploymentType: external
    clients: []
    storageCluster:
      namespacedName:
        namespace: openshift-storage-extended
        name: ocs-external-storagecluster
      storageProviderEndpoint: ""
      cephClusterFSID: fed0dd40-d244-11ef-8777-0050568f2b8d
      isDrOptimized: "false"
    storageSystemName: ocs-external-storagecluster-storagesystem
  openshift-storage_ocs-storagecluster.config.yaml: |
    version: 4.17.2-rhodf
    deploymentType: internal
    clients: []
    storageCluster:
      namespacedName:
        namespace: openshift-storage
        name: ocs-storagecluster
      storageProviderEndpoint: ""
      cephClusterFSID: 4f76f6a2-cbac-40dc-8dec-fcb373c4a52f
      isDrOptimized: "false"
    storageSystemName: ocs-storagecluster-storagesystem
kind: ConfigMap
metadata:
  creationTimestamp: "2025-01-15T07:29:21Z"
  name: odf-info
  namespace: openshift-storage
  resourceVersion: "806677"
  uid: 7cdcf2b5-0547-4d72-8d27-98cd6cd1eeb4

@iamniting
Copy link
Member

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 57599d6 into red-hat-storage:main Jan 15, 2025
11 checks passed
@openshift-cherrypick-robot

@rewantsoni: new pull request created: #2967

In response to this:

/cherry-pick release-4.18

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.

@rewantsoni
Copy link
Member Author

/cherry-pick release-4.17

@openshift-cherrypick-robot

@rewantsoni: #2959 failed to apply on top of branch "release-4.17":

Applying: odf-info: stop owning the odf-info configMap
Using index info to reconstruct a base tree...
M	controllers/storagecluster/odfinfoconfig.go
M	controllers/storagecluster/storagecluster_controller.go
M	controllers/util/predicates.go
Falling back to patching base and 3-way merge...
Auto-merging controllers/util/predicates.go
CONFLICT (content): Merge conflict in controllers/util/predicates.go
Auto-merging controllers/storagecluster/storagecluster_controller.go
CONFLICT (content): Merge conflict in controllers/storagecluster/storagecluster_controller.go
Auto-merging controllers/storagecluster/odfinfoconfig.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 odf-info: stop owning the odf-info configMap

In response to this:

/cherry-pick release-4.17

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.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants