Skip to content

Add hash suffix on truncation for Kubernetes lease names (#708)#723

Merged
pjfanning merged 1 commit intoapache:1.3.xfrom
pjfanning:dns-1.3
Mar 28, 2026
Merged

Add hash suffix on truncation for Kubernetes lease names (#708)#723
pjfanning merged 1 commit intoapache:1.3.xfrom
pjfanning:dns-1.3

Conversation

@pjfanning
Copy link
Copy Markdown
Member

cherry pick e133bfe #702 #708

* Initial plan

* Add on-truncate-add-hash-length config with SHA-256/base32 hash suffix on truncation

Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>

* Add Base32EncodeSpec with edge-case tests; widen base32Encode to private[kubernetes]

Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>

* Switch hash suffix to take first N chars; add tests for names differing by last 1-2 chars

Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>

* Handle hashLength >= maxLength gracefully; fix test bugs and add edge-case tests

Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>

* scalafmt

* Refactor string concatenation to use string interpolation

* Update Base32EncodeSpec.scala

* Update Base32EncodeSpec.scala

* update long hash len logic

* Update MakeDNS1039CompatibleSpec.scala

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pjfanning <11783444+pjfanning@users.noreply.github.com>
@pjfanning pjfanning added this to the 1.3.0 milestone Mar 26, 2026
@pjfanning
Copy link
Copy Markdown
Member Author

the CI build failure is not related to this change and is dealt with in #729

Copy link
Copy Markdown
Member

@He-Pin He-Pin left a comment

Choose a reason for hiding this comment

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

lgtm

@pjfanning pjfanning merged commit 44051b9 into apache:1.3.x Mar 28, 2026
14 of 15 checks passed
@pjfanning pjfanning deleted the dns-1.3 branch March 28, 2026 10:01
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.

2 participants