-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implemented IPPool and IPreservations creation flow and static IPs set #630
base: onpremises-provisioning
Are you sure you want to change the base?
Implemented IPPool and IPreservations creation flow and static IPs set #630
Conversation
controllers/clusters/on_premises.go
Outdated
return "", err | ||
} | ||
|
||
usedCIDRs := []string{} |
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.
Let's use var usedCIDRs []string
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.
Ok, will use
controllers/clusters/on_premises.go
Outdated
ipReservationsList := &apicalico.IPReservationList{} | ||
err := k8sclient.List(ctx, ipReservationsList, &client.ListOptions{ | ||
LabelSelector: labels.SelectorFromSet(map[string]string{ | ||
models.ControlledByLabel: models.OperatorLabel, | ||
}), | ||
}) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
for _, reservation := range ipReservationsList.Items { | ||
return reservation.Spec.ReservedCIDRs[0], nil | ||
} | ||
|
||
icIPPoolList := &apicalico.IPPoolList{} |
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.
Let's use ipReservationsList
and ipPoolList
variables or
icIPReservationsList
and icIPPoolList
, not both versions
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.
Ok, will remove ic
prefix
controllers/clusters/on_premises.go
Outdated
func getAvailablePrivateCIDR(unavailCIDRs []string) (string, error) { | ||
for i := 0; i < 255; i++ { | ||
checkNet := net.IPNet{ | ||
IP: net.ParseIP(fmt.Sprintf("10.%d.0.0", i)), |
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.
Why do you use the second octet and mask 24? maybe we should use the third one here?
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.
Yeah, added third octet
2a0bb5b
to
f31809a
Compare
//+kubebuilder:rbac:groups=projectcalico.org,resources=ipreservations,verbs=get;list;watch;create;update;patch;delete;deletecollection | ||
//+kubebuilder:rbac:groups=projectcalico.org,resources=ippools,verbs=get;list;watch;create;update;patch;delete;deletecollection |
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.
Let's add to another cluster's controllers, wdyt?
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.
These roles applied for manager so they work for all controllers
9366fa1
to
9292b20
Compare
0f36b70
to
d7fcad4
Compare
No description provided.