Commit Graph

8 Commits

Author SHA1 Message Date
Kavindu Dodanduwa b58fab3df0
chore: move packaging & isolate service implementations (#1234)
## This PR

**Background**

This is an attempt to move services and wiring logic to their end usage.

For example, having `runtime` package in the core module did not provide
any advantage. This package was only used by `flagd` and contained the
logic that binds configurations to service implementations.

Similarly, `flagd-proxy` exposed `sync` service, and having that inside
the core module seemed out of place.

**What's changed**

I have moved `runtime` package to `flagd` & specific service
implementations (flag evaluation and sync service) to their end usage.

**Why ?**

I considered this to be a pre-requisite for
https://github.com/open-feature/flagd/issues/1230. If I attempted to add
another `sync` implementation to the current core module, it would have
made the whole packaging confusing (ex:- we have two sync proto
implementations, which do not serve the same purpose. One for
flagd-proxy and the other for flagd).

After this refactoring, I could add the flagd's sync service, where it
serve buf connect and I can locate that within flagd.

Besides, we still have a core module with all the sharables. 

Consider the current packaging in the below diagram,


![image](https://github.com/open-feature/flagd/assets/8186721/ce8b2358-c136-492c-a646-178fe42d9841)


* nore - core sync is for flag data sync listeners such as files, K8s
...

Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
2024-03-05 09:52:06 -08:00
Giovanni Liva 5c8ed7c6dd
fix: add signal handling to SyncFlags grpc (#1176)
Signed-off-by: Giovanni Liva <giovanni.liva@dynatrace.com>
2024-01-30 08:53:12 -05:00
Craig Pastro 49f6fe5679
chore!: remove deprecated flags (#1075)
Remove deprecated flags in flagd and flagd-proxy. Slight clean up of the
code by removing `getPortValueOrDefault`. Setting the default value in
the definition of the flag accomplishes the same thing.

Signed-off-by: Craig Pastro <craig.pastro@gmail.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
2023-12-15 11:39:44 -05:00
Florian Bacher 0c7f78a95f
chore: refactoring component structure (#1044)
This PR refactors the core package by restructuring the components
responsible for managing the subscriptions, as well as the creation of
sync sources. The following changes have been made:

- Renamed `sync-store` package to `subscriptions`. This has been done to
avoid confusion because we already have a `sync`, and a `store`.
package. Within the package, the `SyncStore`. has been renamed to
`subscriptions.Manager`, which should reflect its responsibility in a
better way. Also, the `syncHandler` has been renamed to `multiplexer`,
as this one is responsible for sending updates of a certain target to
all subscribers - `syncHandler` was a bit too generic in my opinion.
- Moved the `GetSyncSourceFromURI` method to a new package,
`sync/builder`, to remove the responsibility of building concrete sync
sources from the subscription manager
- Moved the logic of retrieving the K8s client config to the sync
builder. Previously, this was done in the `runtime` package by calling
the respective methods for the config retrieval provided by the
`sync/kubernetes` package and then handing that config back to the
initialization of the `K8sSync`. Note: This step can potentially be done
in a separate PR, if so desired.

---------

Signed-off-by: Florian Bacher <florian.bacher@dynatrace.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
2023-12-07 06:59:17 +01:00
Craig Pastro 5635e38703
refactor: Rename metrics-port to management-port (#1012)
Signed-off-by: Craig Pastro <craig.pastro@gmail.com>
2023-11-16 15:08:57 -05:00
odubajDT ed5e6e5f3e
feat(flagd-proxy): introduce zero-downtime (#752)
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
2023-07-26 08:41:30 +02:00
James Milligan c0e2fa0073
refactor: introduce isyncstore interface (#660)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- decouples the sync store from sync server startup, allowing for
alternative sync store implementations to be introduced

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->

### Notes
<!-- any additional notes for this PR -->

### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->

---------

Signed-off-by: James Milligan <james@omnant.co.uk>
2023-05-17 14:28:34 +01:00
James Milligan 223de99ee3
feat!: proposal - rename `kube-flagd-proxy` to `flagd-proxy` (#576)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- renames package `kube-flagd-proxy` to `flagd-proxy`
- updates all references of `kube-flagd-proxy` to `flagd-proxy`

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->


https://github.com/open-feature/open-feature-operator/pull/412#discussion_r1151133259

### Notes
<!-- any additional notes for this PR -->

### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->

---------

Signed-off-by: James Milligan <james@omnant.co.uk>
2023-03-30 11:33:23 -04:00