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

[Maintenance Windows] Create go module for MaintenanceWindowPolicy resolver #2114

Closed
2 of 3 tasks
lindnerby opened this issue Dec 12, 2024 · 2 comments · Fixed by #2155
Closed
2 of 3 tasks

[Maintenance Windows] Create go module for MaintenanceWindowPolicy resolver #2114

lindnerby opened this issue Dec 12, 2024 · 2 comments · Fixed by #2155
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@lindnerby
Copy link
Member

lindnerby commented Dec 12, 2024

Description

In lifecycle-manager we create a new go module /pkg/maintwindow containing the logic for the window resolver as seen in internal.
Adding tests and notifying orchestration-operator team that the pkg can be used by them and shared.

Reasons

We want to offer the code for resolving MaintenanceWindowPolicy and ResolvedWindow to be shared.

Acceptance Criteria

  • New go.mod in /pkg/maintwindow containing resolver logic
  • Logic is unit tested
  • Ping orchestration-operator team (= SRE) that they can use and import the dependency to their project

Testing approach

  • Unit testing

Related issue

@ruanxin
Copy link
Contributor

ruanxin commented Dec 20, 2024

Notes

In Go projects, the pkg folder is typically used to store packages intended for use by other projects. If we place this resolver under pkg, it implies that other projects would depend directly on the lifecycle manager project, which is not our intention. Instead, we want this library to be a standalone Go module.

For reference, you can find numerous examples of how the pkg folder is used in other projects here:
https://github.com/golang-standards/project-layout/tree/master/pkg
Notably, there seems to be no concern regarding designing Go modules under pkg in these examples.

This also highlights another issue:

I propose we consider an alternative folder structure or use the api module instead. Personally, I prefer using the api module for sharing this resolver code, as it aligns well with its intended purpose.

@Tomasz-Smelcerz-SAP
Copy link
Member

I decided to go with a dedicated directory: /maintenancewindows to host the new module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants