-
Notifications
You must be signed in to change notification settings - Fork 30
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
virtual-kubelet controller integration #130
Conversation
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
babf6c5
to
4035566
Compare
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
return nil, fmt.Errorf("unable to create certs: %w", err) | ||
} | ||
pool := x509.NewCertPool() | ||
pool.AddCert(certs[0]) |
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.
Should we do a bounds check here to be safe?
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.
What is the resolution for this?
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.
sorry missed this one, adding a check now
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.
added a check for the length of the certs after this line
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
Signed-off-by: galal-hussein <[email protected]>
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.
No major concerns, thanks for all the work on this PR.
func (c *config) unmarshalYAML(data []byte) error { | ||
var conf config | ||
|
||
if err := yaml.Unmarshal(data, &conf); err != nil { | ||
return err | ||
} | ||
|
||
if c.ClusterName == "" { | ||
c.ClusterName = conf.ClusterName | ||
} | ||
if c.ClusterNamespace == "" { | ||
c.ClusterNamespace = conf.ClusterNamespace | ||
} | ||
if c.HostConfigPath == "" { | ||
c.HostConfigPath = conf.HostConfigPath | ||
} | ||
if c.VirtualConfigPath == "" { | ||
c.VirtualConfigPath = conf.VirtualConfigPath | ||
} | ||
if c.KubeletPort == "" { | ||
c.KubeletPort = conf.KubeletPort | ||
} | ||
if c.AgentHostname == "" { | ||
c.AgentHostname = conf.AgentHostname | ||
} | ||
if c.NodeName == "" { | ||
c.NodeName = conf.NodeName | ||
} | ||
return nil | ||
} |
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.
Nit: to avoid copying over the fields (which will get worse over time as we add more fields), you can instead change the method to just return the config:
func (c *config) unmarshalYAML(data []byte) error { | |
var conf config | |
if err := yaml.Unmarshal(data, &conf); err != nil { | |
return err | |
} | |
if c.ClusterName == "" { | |
c.ClusterName = conf.ClusterName | |
} | |
if c.ClusterNamespace == "" { | |
c.ClusterNamespace = conf.ClusterNamespace | |
} | |
if c.HostConfigPath == "" { | |
c.HostConfigPath = conf.HostConfigPath | |
} | |
if c.VirtualConfigPath == "" { | |
c.VirtualConfigPath = conf.VirtualConfigPath | |
} | |
if c.KubeletPort == "" { | |
c.KubeletPort = conf.KubeletPort | |
} | |
if c.AgentHostname == "" { | |
c.AgentHostname = conf.AgentHostname | |
} | |
if c.NodeName == "" { | |
c.NodeName = conf.NodeName | |
} | |
return nil | |
} | |
func unmarshalYAML(data []byte) (*config, error) { | |
var conf config | |
err := yaml.Unmarshal(data, &conf) | |
return &conf, 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.
the problem is that we want the user to be able to mix and match for example, the user can set the --agent-hostname as a flag and at the same time add nodeName
in the config file, if we just returned the unmarshalled config it will ignore all the flags sat on the command line
* Virtual kubelet controller integration Signed-off-by: galal-hussein <[email protected]> * Add k3k-kubelet image to the release workflow Signed-off-by: galal-hussein <[email protected]> * Add k3k-kubelet image to the release workflow Signed-off-by: galal-hussein <[email protected]> * Fix build/release workflow Signed-off-by: galal-hussein <[email protected]> * Remove pkg directory in k3k-kubelet Signed-off-by: galal-hussein <[email protected]> * rename Type to Config Signed-off-by: galal-hussein <[email protected]> * Move the kubelet and config outside of pkg Signed-off-by: galal-hussein <[email protected]> * fix comments Signed-off-by: galal-hussein <[email protected]> * Fix naming throughout the package Signed-off-by: galal-hussein <[email protected]> * Fix comments Signed-off-by: galal-hussein <[email protected]> * more fixes to naming Signed-off-by: galal-hussein <[email protected]> * fixes Signed-off-by: galal-hussein <[email protected]> * fixes Signed-off-by: galal-hussein <[email protected]> * fixes Signed-off-by: galal-hussein <[email protected]> * fixes Signed-off-by: galal-hussein <[email protected]> --------- Signed-off-by: galal-hussein <[email protected]>
The PR does the following:
Issue: