Skip to content
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 option for peerPodOwnership #110

Closed

Conversation

solo-daemon
Copy link

fix #88

I tried to fix the issue though I am new to golang and kubernetes both. Would love to improve this pr and get it merged!

Signed-off-by: Amrit Prakash <[email protected]>
Copy link
Member

@jt-nti jt-nti left a comment

Choose a reason for hiding this comment

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

Hi @solo-daemon, thanks for the PR, it would be great to get a fix for this issue. I think the biggest piece of work will be to add some suitable tests, unfortunately there are any to build on yet- see #48. If you're happy to carry on working on this, I can assign the issue to you. Thanks again.

@@ -448,7 +449,22 @@ func CreateChaincodePod(
chaincodeData,
)

err := deleteChaincodePod(ctx, logger, podsClient, podName, namespace, chaincodeData)
peerPod, err := podsClient.Get(ctx, peerID, metav1.GetOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't look like the right way to get the peer pod. Instead, I think there needs to be something to look up the pod that the builder is running on, although I'm not sure how to do that off the top of my head.

Copy link
Author

Choose a reason for hiding this comment

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

The idea here was that whatever namespace is being passed to the Create Chain code pod will be the only namespace from which (if a peer pod exist ) can be added as an owner and the podsClient passed is created from the same namespace.

Copy link
Member

Choose a reason for hiding this comment

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

That makes sense, however I don't think there's currently any way to identify the peer pod. The builder would be running in the same container as the peer, so it would be in the same pod, but I've not found a way to get the current pod using the kubernetes client API (I'm probably just missing something obvious). The Downward API would work but that would add some requirements on the way the peer pod is defined, plus probably more config for the k8s builder.

@jt-nti
Copy link
Member

jt-nti commented May 8, 2024

I'm currently working on a PR to use a job to run chaincode which would resolve #88 (the pod's owner reference is now the job) and make this PR redundant. Thanks again for contributing to the k8s builder @solo-daemon.

@solo-daemon
Copy link
Author

@jt-nti it was a pleasure, i was contributing because i wanted to learn go-lang reading the code sure helped a lot. Thanks!

@solo-daemon solo-daemon closed this May 9, 2024
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.

k8s owner reference is not set in CC child pod
2 participants