Skip to content

[improvement] add validation admission webhook checks for resource name length#851

Merged
AshleyDumaine merged 3 commits into
mainfrom
validate-resource-name-len
Aug 27, 2025
Merged

[improvement] add validation admission webhook checks for resource name length#851
AshleyDumaine merged 3 commits into
mainfrom
validate-resource-name-len

Conversation

@AshleyDumaine

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Before it was possible to apply a resource that had a name that didn't fit the Linode API label length limitations. This adds a check on our validating admission webhooks so we can catch this before the user encounters a 400.
I also did some cleanup to standardize of our validating admission webhook logic.

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

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@codecov

codecov Bot commented Aug 27, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.60563% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.76%. Comparing base (7bd25af) to head (8d190d5).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...hook/v1alpha2/linodeobjectstoragebucket_webhook.go 0.00% 14 Missing ⚠️
...webhook/v1alpha2/linodeobjectstoragekey_webhook.go 76.00% 5 Missing and 1 partial ⚠️
...l/webhook/v1alpha2/linodeplacementgroup_webhook.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #851      +/-   ##
==========================================
+ Coverage   63.65%   64.76%   +1.11%     
==========================================
  Files          71       71              
  Lines        7827     7871      +44     
==========================================
+ Hits         4982     5098     +116     
+ Misses       2555     2465      -90     
- Partials      290      308      +18     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AshleyDumaine AshleyDumaine merged commit 30dce62 into main Aug 27, 2025
16 checks passed
@AshleyDumaine AshleyDumaine deleted the validate-resource-name-len branch August 28, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants