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

Implement helm add & install in helm e2e test #1803

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

THUzxj
Copy link

@THUzxj THUzxj commented Jul 20, 2024

Hi,

for adding helm e2e tests discussed in #1769, I have implemented helm add repo, and install chart. The helm API is from e2e-framework. I would appreciate it if you could review the implementation for further development.

And for our future plan:

  • Which components should we verify for successfully deployed by helm? For example, service and pods?
  • Which existing test cases can be integrated into helm e2e tests?

Additionally, I encountered an error stating:

"seccompProfile (pod or container must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")" 

when running helm install via the code, despite the command working fine when executed manually in the terminal. As a workaround, I added f.NamespacePodSecurityEnforceLevel = admissionapi.LevelBaseline. I'm uncertain if this is the correct approach. Do you have any suggestions or improvements for this issue?

Thank you very much!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 20, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @THUzxj!

It looks like this is your first PR to kubernetes-sigs/node-feature-discovery 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/node-feature-discovery has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @THUzxj. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 20, 2024
Copy link

netlify bot commented Jul 20, 2024

Deploy Preview for kubernetes-sigs-nfd failed. Why did it fail? →

Name Link
🔨 Latest commit a18ce34
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-nfd/deploys/66bd7b0e39bd1e0008df8aae

@ArangoGutierrez
Copy link
Contributor

/assign @marquiz

@ArangoGutierrez
Copy link
Contributor

/assign

test/e2e/helm_test.go Show resolved Hide resolved
"k8s.io/kubernetes/test/e2e/framework"
"sigs.k8s.io/e2e-framework/third_party/helm"

// e2enetwork "k8s.io/kubernetes/test/e2e/framework/network"
Copy link
Contributor

Choose a reason for hiding this comment

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

??

admissionapi "k8s.io/pod-security-admission/api"
)

// Actual test suite
Copy link
Contributor

Choose a reason for hiding this comment

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

Helm based test suite

Comment on lines 26 to 43
chart_name := "nfd/node-feature-discovery"
release_name := "node-feature-discovery"
version := "0.16.3"

Copy link
Contributor

Choose a reason for hiding this comment

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

We should test local helm charts, instead of released ones, this way we can tests if current changes will break Helm deployment

version := "0.16.3"

Context("when deploying by helm", Ordered, func() {

Copy link
Contributor

Choose a reason for hiding this comment

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

trailing extra line

Comment on lines 42 to 57
// manager := helm.New(framework.TestContext.KubeConfig)
// err := manager.RunRepo(helm.WithArgs("remove", "nfd"))
// Expect(err).NotTo(HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

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

??

Comment on lines 73 to 76
// Error: error waiting for service node-feature-discovery-xxxx/ to appear: resource name may not be empty
// By("Waiting for the nfd-master service to be up")
// nfdSvc, err := f.ClientSet.CoreV1().Services(f.Namespace.Name).Get(ctx, "nfd-master", v1.GetOptions{})
// Expect(e2enetwork.WaitForService(ctx, f.ClientSet, f.Namespace.Name, nfdSvc.Name, true, time.Second, 10*time.Second)).NotTo(HaveOccurred())
Copy link
Contributor

Choose a reason for hiding this comment

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

???

Expect(err).NotTo(HaveOccurred())
})

//
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are adding comments here, we should comment each step also

Copy link
Contributor

Choose a reason for hiding this comment

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

@THUzxj please address this comment

Copy link
Author

Choose a reason for hiding this comment

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

Sorry maybe I don't fully understand "comment each step", so I just removed this comment

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: THUzxj
Once this PR has been reviewed and has the lgtm label, please ask for approval from arangogutierrez. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@THUzxj
Copy link
Author

THUzxj commented Jul 22, 2024

@ArangoGutierrez Thanks for your review. I will fix the code soon.

@THUzxj THUzxj force-pushed the helm branch 3 times, most recently from 4859578 to f0ae10e Compare July 22, 2024 16:30
@ArangoGutierrez
Copy link
Contributor

@ArangoGutierrez Thanks for your review. I will fix the code soon.

Hey @THUzxj how's this going, ping me if you need any help

@THUzxj
Copy link
Author

THUzxj commented Jul 29, 2024

@ArangoGutierrez Thanks for your review. I will fix the code soon.

Hey @THUzxj how's this going, ping me if you need any help

Sorry that I am not familiar with the review process. I have fixed your comments and maybe you could review it again.

@ArangoGutierrez
Copy link
Contributor

@THUzxj

They @THUzxj sorry for the delay, been busy on the day job, will review this this week

workingDir, err := os.Getwd()
chartPath := filepath.Join(workingDir, "../../", "deployment", "helm", "node-feature-discovery")
Expect(err).NotTo(HaveOccurred())
By("helm install " + release_name + " " + chartPath + " --namespace " + f.Namespace.Name + " --wait")
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

done

Expect(err).NotTo(HaveOccurred())
})

//
Copy link
Contributor

Choose a reason for hiding this comment

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

@THUzxj please address this comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants