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

Support processing multiple HTTP listeners #121

Merged
merged 1 commit into from
Jun 23, 2022
Merged

Conversation

pleshakov
Copy link
Contributor

@pleshakov pleshakov commented May 27, 2022

Proposed changes

Problem:
The Gateway needs to process a Gateway resource. Currently, that is
already supported by the 'state' package. However, that support is
limited. For example, the package doesn't allow processing multiple
listeners. More over, the approach used in the 'state' package is hard
to extend to support multiple listeners.
This prompts development of a better solution.

As a first deliverable, we want to support processing multiple HTTP
listeners assuming they all bind to port 80.
We also assume that the Gateway only supports a single Gateway resource
with known namespace and name.

Solution - replace the existing types of the state package with
the new ones:

  • Introduce Configuration, which is an internal representation of the
    Gateway configuration.
  • Introduce Statuses, which holds status-related information about
    processed resources.
  • Introduce ChangeProcessor, which processes changes to Gateway API
    resources and returns new Configuration and Statuses.

internal/newstate/change_processor_test.go Outdated Show resolved Hide resolved
internal/newstate/change_processor_test.go Outdated Show resolved Hide resolved
internal/newstate/change_processor_test.go Outdated Show resolved Hide resolved
internal/newstate/configuration.go Outdated Show resolved Hide resolved
internal/newstate/configuration_test.go Outdated Show resolved Hide resolved
internal/newstate/graph_test.go Outdated Show resolved Hide resolved
internal/newstate/graph_test.go Outdated Show resolved Hide resolved
internal/newstate/graph_test.go Outdated Show resolved Hide resolved
internal/newstate/helpers_test.go Outdated Show resolved Hide resolved
internal/newstate/statuses.go Outdated Show resolved Hide resolved
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

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

LGTM!

I left one small comment but I'll go ahead and approve the changes

internal/newstate/graph.go Outdated Show resolved Hide resolved
Problem:
The Gateway needs to process a Gateway resource. Currently, that is
already supported by the 'state' package. However, that support is
limited. For example, the package doesn't allow processing  multiple
listeners. More over, the approach used in the 'state' package is hard
to extend to support multiple listeners. 
This prompts development of a better solution.

As a first deliverable, we want to support processing multiple HTTP
listeners assuming they all bind to port 80. 
We also assume that the Gateway only supports a single Gateway resource
with known namespace and name.

Solution - replace the existing types of the state package with
the new ones:
- Introduce Configuration, which is an internal representation of the
Gateway configuration. 
- Introduce Statuses, which holds status-related information about
processed resources.
- Introduce ChangeProcessor, which processes changes to Gateway API
resources and returns new Configuration and Statuses.
@pleshakov pleshakov merged commit 497266d into main Jun 23, 2022
@pleshakov pleshakov deleted the feature/listeners branch June 23, 2022 03:35
@lucacome lucacome added the enhancement New feature or request label Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants