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

test: Tests for helm chart & some fixes for found issues #1752

Merged
merged 24 commits into from
Sep 1, 2024

Conversation

dadrus
Copy link
Owner

@dadrus dadrus commented Sep 1, 2024

Related issue(s)

closes #1717

Checklist

  • I agree to follow this project's Code of Conduct.
  • I have read, and I am following this repository's Contributing Guidelines.
  • I have read the Security Policy.
  • I have referenced an issue describing the bug/feature request.
  • I have added tests that prove the correctness of my implementation.

Description

Implementation of unit tests for the helm chart.

During the course of this work, the following issues were identified and resolved:

  • Specifying custom annotations in the deployment configuration caused the error: heimdall/templates/deployment.yaml:28:22: executing "heimdall/templates/deployment.yaml" at <.Values.deployment.annotations>: nil pointer evaluating interface {}.deployment. This was due to a copy-paste mistake in the template’s annotation access definition within the with clause. Instead of correctly using . to reference the current context, .Values.deployment.annotations was incorrectly used within the nested template.
  • In version v0.12.0-alpha, the configuration structure of heimdall was redesigned. Many properties related to mechanisms and rule provider configuration were moved to the top level of the configuration, whereas they were previously nested under the rules property. However, the configuration for the admission controller (validating webhook) in the helm chart was not updated accordingly, and the helm chart still expected its configuration to be under the rules property.
  • The configuration for the above said validating webhook did not allow for the setup of a namespace selector, despite the presence of relevant configuration options. Before this pull request, any provided properties would be incorrectly applied at the top level of the webhook configuration instead of under the namespaceSelector, causing them to be ignored by the Kubernetes server API.

Changelist

  • fix: Fixed a nil pointer error in the Helm chart that occurred when a deployment was configured with custom annotations due to an incorrect reference in the deployment template.
  • fix: Updated the admission controller configuration in the Helm chart to align with the redesigned structure done in v0.12.0-alpha release of heimdall.
  • fix: Corrected the placement of namespace selector properties in the Helm chart's admission controller configuration.

Copy link

codecov bot commented Sep 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.74%. Comparing base (14fc2de) to head (71fc81f).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1752      +/-   ##
==========================================
+ Coverage   89.68%   89.74%   +0.06%     
==========================================
  Files         271      271              
  Lines        8993     8993              
==========================================
+ Hits         8065     8071       +6     
+ Misses        687      684       -3     
+ Partials      241      238       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dadrus dadrus merged commit 4c059b3 into main Sep 1, 2024
28 checks passed
@dadrus dadrus deleted the chore/helm_unittests branch September 1, 2024 11:51
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.

Unit tests for the helm chart
1 participant