[PR #2255] [MERGED] wrap policy in policy manager interface #2573

Closed
opened 2025-12-29 03:21:52 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2255
Author: @kradalby
Created: 11/25/2024
Status: Merged
Merged: 11/26/2024
Merged by: @kradalby

Base: mainHead: kradalby/policy-manager-inf3


📝 Commits (1)

  • 93d531e wrap policy in policy manager interface

📊 Changes

16 files changed (+741 additions, -370 deletions)

View changed files

📝 .github/workflows/test-integration.yaml (+1 -2)
📝 hscontrol/app.go (+113 -50)
📝 hscontrol/auth.go (+7 -0)
📝 hscontrol/db/node_test.go (+11 -2)
📝 hscontrol/db/routes.go (+5 -15)
📝 hscontrol/grpcv1.go (+26 -24)
📝 hscontrol/mapper/mapper.go (+19 -41)
📝 hscontrol/mapper/mapper_test.go (+3 -2)
📝 hscontrol/mapper/tail.go (+4 -4)
📝 hscontrol/mapper/tail_test.go (+3 -2)
📝 hscontrol/oidc.go (+14 -0)
hscontrol/policy/pm.go (+181 -0)
hscontrol/policy/pm_test.go (+158 -0)
📝 hscontrol/poll.go (+11 -8)
📝 integration/cli_test.go (+181 -220)
📝 integration/hsic/hsic.go (+4 -0)

📄 Description

this PR "wraps" the policy in a manager interface, and implements it for the policy v1.

This work has two goals,

  • A stepping stone to change how often we recreate the policy when used in netmap creations
  • An interface that can be implemented by a new policy implementation to make it easier to run both or tests both. Making us able to introduce a new one, while having the old available while we work out bugs and so on.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2255 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 11/25/2024 **Status:** ✅ Merged **Merged:** 11/26/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/policy-manager-inf3` --- ### 📝 Commits (1) - [`93d531e`](https://github.com/juanfont/headscale/commit/93d531e7e7028aef2cbed0f4eac08d2dd9c43cc4) wrap policy in policy manager interface ### 📊 Changes **16 files changed** (+741 additions, -370 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test-integration.yaml` (+1 -2) 📝 `hscontrol/app.go` (+113 -50) 📝 `hscontrol/auth.go` (+7 -0) 📝 `hscontrol/db/node_test.go` (+11 -2) 📝 `hscontrol/db/routes.go` (+5 -15) 📝 `hscontrol/grpcv1.go` (+26 -24) 📝 `hscontrol/mapper/mapper.go` (+19 -41) 📝 `hscontrol/mapper/mapper_test.go` (+3 -2) 📝 `hscontrol/mapper/tail.go` (+4 -4) 📝 `hscontrol/mapper/tail_test.go` (+3 -2) 📝 `hscontrol/oidc.go` (+14 -0) ➕ `hscontrol/policy/pm.go` (+181 -0) ➕ `hscontrol/policy/pm_test.go` (+158 -0) 📝 `hscontrol/poll.go` (+11 -8) 📝 `integration/cli_test.go` (+181 -220) 📝 `integration/hsic/hsic.go` (+4 -0) </details> ### 📄 Description this PR "wraps" the policy in a manager interface, and implements it for the policy v1. This work has two goals, - A stepping stone to change how often we recreate the policy when used in netmap creations - An interface that can be implemented by a _new_ policy implementation to make it easier to run both or tests both. Making us able to introduce a new one, while having the old available while we work out bugs and so on. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:21:52 +01:00
adam closed this issue 2025-12-29 03:21:52 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2573