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

feat: Remove ocm dependency from policy controller #711

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

mikenairn
Copy link
Member

@mikenairn mikenairn commented Dec 7, 2023

Remove all dependencies related to OCM from the policy controller and associated code.

Instead of labelling the OCM ManagedCluster resources with weight and geo metadata, the labels are now added to the gateway itself with the cluster name embedded.

"kuadrant.io/kind-mgc-control-plane_lb-attribute-weight":   "TSTATTR",
"kuadrant.io/kind-mgc-control-plane_lb-attribute-geo-code": "EU"

closes #622

ToDo

  • Add Watch for ManagedClusters to Gateway controller and transfer kuadrant.io labels

@openshift-ci openshift-ci bot added the approved label Dec 7, 2023
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from 89763f2 to 179d72f Compare December 7, 2023 21:38
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from 93759a5 to 8e31e4b Compare December 8, 2023 10:05
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from 8e31e4b to 2349f2b Compare December 8, 2023 10:16
@maksymvavilov maksymvavilov force-pushed the 662_remove_ocm_dependency branch from 2349f2b to 1fa4be0 Compare December 15, 2023 11:05
@maksymvavilov maksymvavilov marked this pull request as ready for review December 15, 2023 11:05
@maksymvavilov
Copy link
Contributor

/label tide/merge-method-squash

@openshift-ci openshift-ci bot added the tide/merge-method-squash Instructing Openshift CI bot to squash commits on merge label Dec 15, 2023
@@ -82,12 +83,6 @@ func (t *MultiClusterGatewayTarget) setClusterGatewayTargets(clusterGateways []C
return nil
}

// ClusterGateway contains the addresses of a Gateway on a single cluster and the attributes of the target cluster.
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this move into a utils package? Wondering would it be better in the api pkg as a none CRD type?

Copy link
Contributor

Choose a reason for hiding this comment

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

like perhaps cluster_types.go

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah gateway wrapper belongs elsewhere. pkg/apis certainly makes more sense. Moving that though would probably be better done in a different PR either before or after this one. Will look into it, if it doesn't add a lot of additional changes I'll add it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to do a follow up for this. There are some other changes/refactors/cleanup i want to make to the code that could all be part of a separate PR that has no functional changes.

Copy link
Contributor

@maleck13 maleck13 left a comment

Choose a reason for hiding this comment

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

Question about location of the wrapper types. Also would be good to have some verification steps

Remove all dependencies related to OCM from the policy controller and
associated code.

Instead of labeling the OCM ManagedCluster resources with weight and geo
metadata, the labels are now added to the gateway itself with the
cluster name embedded.

```
"kuadrant.io/kind-mgc-control-plane_lb-attribute-weight":   "TSTATTR",
"kuadrant.io/kind-mgc-control-plane_lb-attribute-geo-code": "EU"
```
Adds the watch for ManagedCluster resources to the gateway controller
and adds an additional step in the reconcile (reconcileClusterLabels) to
map the kuadrant.io labels from cluster(s) to gateway.

reconcileClusterLabels - Not Implemented
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from 24c5c16 to fd70c83 Compare January 22, 2024 09:18
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from fd70c83 to 094605f Compare January 22, 2024 09:37
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from 094605f to 1227ec6 Compare January 22, 2024 09:52
maksymvavilov and others added 2 commits January 23, 2024 08:01
…+ integration test

bump golangci-lint to 1.55.2
patch in e2e
policies, maps cluster events to gateways.

Use "clusters.kuadrant.io" for all cluster labels on the target gateway
and remove all existing cluster labels during reconciliation in order to
remove labels removed from the cluster resource.

Ensure only cluster labels for the current cluster are added when
processing labels.
@mikenairn mikenairn force-pushed the 662_remove_ocm_dependency branch from 1227ec6 to 1846155 Compare January 23, 2024 08:02
@mikenairn mikenairn removed the tide/merge-method-squash Instructing Openshift CI bot to squash commits on merge label Jan 23, 2024
Copy link
Contributor

@philbrookes philbrookes left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Contributor

openshift-ci bot commented Jan 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mikenairn, philbrookes

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 [mikenairn,philbrookes]

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

@openshift-merge-bot openshift-merge-bot bot merged commit aadac89 into main Jan 23, 2024
10 checks passed
@mikenairn mikenairn deleted the 662_remove_ocm_dependency branch January 23, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove OCM module dependencies from DNSPolicy
4 participants