Skip to content

Conversation

@tamilmani1989
Copy link
Member

What this PR does / why we need it:
Generate VethName based on podname and namespace in CNI. The function will generate hash of the key provided and return first 11 characters of hash. The key is "podname.podnamespace" in CNI.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

Release note:


k8sPodName := string(podCfg.K8S_POD_NAME)
if len(k8sPodName) == 0 {
err = plugin.Errorf("No k8s pod namespace provided.")
Copy link
Member Author

Choose a reason for hiding this comment

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

update log.

k8sPodName := string(podCfg.K8S_POD_NAME)
if len(k8sPodName) == 0 {
err = plugin.Errorf("No k8s pod namespace provided.")
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

just return plugin.Errorf(...)?

errEndpointInUse = fmt.Errorf("Endpoint is already joined to a sandbox")
errEndpointNotInUse = fmt.Errorf("Endpoint is not joined to a sandbox")

OptVethName = "vethname"
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a const file to add this to?

Copy link
Member Author

Choose a reason for hiding this comment

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

we are following the same thing in ipam/api.go

k8sNamespace := string(podCfg.K8S_POD_NAMESPACE)
if len(k8sNamespace) == 0 {
err = plugin.Errorf("No k8s pod namespace provided.")
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

please log here as well


// Parse network configuration from stdin.
nwCfg, err = cni.ParseNetworkConfig(args.StdinData)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

lets log the err here

@sharmasushant sharmasushant merged commit 41ecaed into Azure:master May 17, 2018
@tamilmani1989 tamilmani1989 deleted the vethname branch September 17, 2018 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants