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

feat(greenhousectl): validation of cluster name during onboarding #785

Merged
merged 7 commits into from
Nov 27, 2024

Conversation

kengou
Copy link
Contributor

@kengou kengou commented Nov 27, 2024

Description

  • greenhousectl cluster boostrap enforces of the 40 character limit and no -- in the ClusterName
  • the secret webhook is enforcing the name validation for type greenhouse.sap/kubeconfig. the func are re-used from cluster webhook:
    if err := invalidateDoubleDashesInName(cluster, logger); err != nil {
    return nil, err
    }
    // capping the name at 40 chars, so we ensure to get unique urls for exposed services per cluster. service-name/namespace hash needs to fit (max 63 chars)
    if err := capName(cluster, logger, 40); err != nil {
    return nil, err
    }

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help
  • Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Added to documentation?

  • 📜 README.md
  • 🤝 Documentation pages updated
  • 🙅 no documentation needed
  • (if applicable) generated OpenAPI docs for CRD changes

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@kengou kengou requested a review from a team as a code owner November 27, 2024 08:52
@kengou kengou linked an issue Nov 27, 2024 that may be closed by this pull request
3 tasks
Copy link
Contributor

@IvoGoman IvoGoman left a comment

Choose a reason for hiding this comment

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

Looks good.

pkg/cmd/cluster_bootstrap.go Outdated Show resolved Hide resolved
pkg/cmd/cluster_bootstrap.go Outdated Show resolved Hide resolved
@kengou kengou requested a review from IvoGoman November 27, 2024 09:46
@kengou kengou force-pushed the feat/validationclustername branch from 0cb810d to 1b9827e Compare November 27, 2024 12:58
@kengou kengou merged commit f584845 into main Nov 27, 2024
21 checks passed
@kengou kengou deleted the feat/validationclustername branch November 27, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] - Validation of Cluster name during onboarding
2 participants