-
Notifications
You must be signed in to change notification settings - Fork 1.4k
✨clusterctl: create the object graph for move #2060
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
✨clusterctl: create the object graph for move #2060
Conversation
fields: fields{ | ||
proxy: test.NewFakeProxy(). | ||
WithObjs( | ||
test.FakeCustomResourceDefinition("foo", "Bar", "v1", "v2"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing this function definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[1] waiting for #2059 to merge (I broke up in two PRs to keep this one as focused as possible)
@ncdc thanks for the feedback! |
Is this ready for rebasing? |
af7da0a
to
7df5f03
Compare
@ndcd rebased |
Thanks, will review shortly. |
"bootstrap.cluster.x-k8s.io/v1alpha3, Kind=DummyBootstrapConfig, ns1/m1": { | ||
dependents: []string{ | ||
"/, Kind=Secret, ns1/m1", | ||
//"/, Kind=Secret, ns1/cluster1-sa", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover of some tests. removed.
Really close! Just a few questions. |
|
||
// dependents contains the list of nodes that are owned by the current node. | ||
// Nb. This is the reverse of metadata.OwnerRef. | ||
dependents map[*node]struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use Empty
instead of struct{}
here if you want https://godoc.org/k8s.io/apimachinery/pkg/util/sets#Empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found using sets.Empty
a little bit confusing, so I have redefined empty locally and now it reads
map[*node]empty
7df5f03
to
24f9aef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
24f9aef
to
abbd257
Compare
@ncdc fixed #2060 (comment) comment |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, ncdc 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 |
What this PR does / why we need it:
This PR implements the creation of a graph of Kubernetes objects to be moved.
The graph is built by reading from the cluster:
The graph is built by navigating object references.
While creating the graph, the ower references are "reversed" so each object has its own set of descendants.
Which issue(s) this PR fixes :
Fixes #1525
rif #1729