Skip to content

Add ODG controller #411

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

Merged
merged 1 commit into from
May 27, 2025
Merged

Add ODG controller #411

merged 1 commit into from
May 27, 2025

Conversation

zkdev
Copy link
Member

@zkdev zkdev commented Apr 8, 2025

Reconciles ODG resources in mODG-root cluster and creates ODG-Extension resources (via gardener-resource-manager).

What this PR does / why we need it:

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Release note:


@zkdev zkdev requested a review from a team as a code owner April 8, 2025 08:30
@ocm-ci-robot-0 ocm-ci-robot-0 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Apr 8, 2025
import odg_operator.odg_model as odgm


ci.log.configure_default_logging()
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to new code to avoid dependencies to ci.* packages. esp. sth. basic like logging we should rather define locally (esp. considering that we might see a different logging infrastructure for ODG - e.g. conveying logs to some service, rather than (only) printing to stdout).

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, but for logging I suggest to address this as a separate topic (there are many usages of ci.log modul across odg-extensions).

For ci.util I will copy the merge-dict function 👍

@zkdev zkdev force-pushed the zkdev-odg-controller branch 3 times, most recently from 218d87a to 484d21a Compare May 2, 2025 13:45
@zkdev zkdev force-pushed the zkdev-odg-controller branch 5 times, most recently from 9b20804 to 24641a8 Compare May 13, 2025 15:00
@zkdev zkdev requested a review from 8R0WNI3 May 13, 2025 15:03
@zkdev zkdev force-pushed the zkdev-odg-controller branch from 24641a8 to dc5c0de Compare May 14, 2025 07:24
@@ -0,0 +1,583 @@
import argparse
Copy link
Collaborator

Choose a reason for hiding this comment

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

is it, naming-wise a good match to have a package odg_operator (emphasis on the operator part), w/ a submodule odg_controller?

Copy link
Member Author

Choose a reason for hiding this comment

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

An k8s operator is a method of managing a k8s application using resource, controllers, and domain specific stuff.
I prefer a dedicated repository, for the time being I think the package is okay.

Copy link
Member

Choose a reason for hiding this comment

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

We might omit the odg_ prefix for the modules as it's already expressed by the package name odg_operator, wdyt?

Copy link
Member Author

Choose a reason for hiding this comment

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

for model and util there are name collisions, thus odg prefix has to remain.
for controller we could remove it, however considering consistency and that we will restructure repositories anyways, I think we should keep the prefix for now.

Copy link
Member

Choose a reason for hiding this comment

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

Why are there name collisions if they are part of the odg_operator package?

Copy link
Member Author

Choose a reason for hiding this comment

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

well, package local import would look like that:

import util

this would collide with top level util module


we could workaround this with "full path" (import odg_operator.util) as we typically add the repo-dir to PYTHONPATH, nevertheless I'd like to avoid introducing such pitfalls.

Copy link
Member

@8R0WNI3 8R0WNI3 May 27, 2025

Choose a reason for hiding this comment

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

Hmm, AFAIK we always import modules with "full path" within this code base, so I'd vote to use a consistent approach either way.
Edit: I just saw those imports are using the "full path" already anyways.

@zkdev zkdev force-pushed the zkdev-odg-controller branch from dc5c0de to 7878934 Compare May 15, 2025 14:49
@@ -0,0 +1,583 @@
import argparse
Copy link
Member

Choose a reason for hiding this comment

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

We might omit the odg_ prefix for the modules as it's already expressed by the package name odg_operator, wdyt?

@zkdev zkdev force-pushed the zkdev-odg-controller branch from 7878934 to 4faf902 Compare May 22, 2025 06:50
@zkdev zkdev requested a review from ccwienk May 22, 2025 06:50
@zkdev zkdev force-pushed the zkdev-odg-controller branch from 4faf902 to 93f3acc Compare May 22, 2025 07:02
@zkdev zkdev force-pushed the zkdev-odg-controller branch 2 times, most recently from e452e0b to acdc8c2 Compare May 26, 2025 15:17
@@ -0,0 +1,583 @@
import argparse
Copy link
Member

Choose a reason for hiding this comment

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

Why are there name collisions if they are part of the odg_operator package?

Reconciles ODG resources in mODG-root cluster and creates ODG-Extension
resources (via gardener-resource-manager).
@zkdev zkdev force-pushed the zkdev-odg-controller branch from acdc8c2 to 71932bd Compare May 27, 2025 07:18
Copy link
Member

@8R0WNI3 8R0WNI3 left a comment

Choose a reason for hiding this comment

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

/lgtm

@zkdev zkdev merged commit 2e9baab into master May 27, 2025
41 of 42 checks passed
@zkdev zkdev deleted the zkdev-odg-controller branch May 27, 2025 08:02
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.

4 participants