-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add metadata
and ipamConfig
to worker
configuration
#39
Conversation
8427bca
to
54079ff
Compare
for _, networkRef := range providerSpec.AddressesFromNetworks { | ||
// check if IPAddress exists | ||
ipAddr := &ipamv1alpha1.IP{} | ||
ipAddrName := req.Machine.Name |
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.
Here is a naming collision, if a machine requests more than one IP.
if err = d.metalClient.Get(ctx, ipAddrKey, ipAddr); err != nil && !apierrors.IsNotFound(err) { | ||
return nil, err | ||
} | ||
if err == nil { | ||
klog.V(3).Infof("IP found %s", ipAddrName) | ||
} | ||
if apierrors.IsNotFound(err) { |
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.
This looks quite complicated to me. What about the following?
err = d.metalClient.Get()
if err == nil {
// append ip
continue
}
if !apierrors.IsNotFound(err) {
return nil, err
}
// IP creation path + append ip
@@ -45,6 +47,18 @@ func (d *metalDriver) DeleteMachine(ctx context.Context, req *driver.DeleteMachi | |||
return nil, status.Error(codes.Unknown, fmt.Sprintf("error deleting ignition secret: %s", err.Error())) | |||
} | |||
|
|||
ip := &ipamv1alpha1.IP{ | |||
ObjectMeta: metav1.ObjectMeta{ | |||
Name: req.Machine.Name, |
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.
Also, needs a change to support multiple IP objects per node.
pkg/api/v1alpha1/provider.go
Outdated
@@ -32,4 +34,15 @@ type ProviderSpec struct { | |||
DnsServers []netip.Addr `json:"dnsServers,omitempty"` | |||
// ServerLabels are passed to the ServerClaim to find a server with certain properties | |||
ServerLabels map[string]string `json:"serverLabels,omitempty"` | |||
// MedaData is a key-value map of additional data which should be passed to the Machine. |
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.
Typo
54079ff
to
2d168a6
Compare
674876e
to
4b804f7
Compare
worker
metadata
and ipamConfig
worker
metadata
and ipamConfig
metadata
and ipamConfig
to worker
configuration
Proposed Changes
Fixes #