Skip to content

Commit

Permalink
Move ingress handling to a resource processor
Browse files Browse the repository at this point in the history
This change moves the handling of IngressClasses and Ingresses to their
own resource processors. Because this was the last Kubernetes type being
handled by the fetcher, we also remove the legacy code for handling
different types. Going forward, all new Kubernetes object handling will
go into a separate processor type.
  • Loading branch information
impl committed Feb 8, 2021
1 parent bf8aa10 commit 09b3709
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 390 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ Please see the [Envoy documentation](https://www.envoyproxy.io/docs/envoy/latest

## Next Release

### Ambasssador API Gateway + Ambassador Edge Stack

- Bugfix: Fix an issue that caused Dev Portal to sporadically respond with upstream connect timeout when loading content
- Bugfix: Prevent potential reconcile loop when updating the status of an Ingress.

## [1.11.1] February 04, 2021
[1.11.1]: https://github.com/datawire/ambassador/compare/v1.11.0...v1.11.1
Expand Down
2 changes: 0 additions & 2 deletions python/ambassador/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ def __init__(self, schema_dir_path: Optional[str]=None) -> None:

self.logger.debug("SCHEMA DIR %s" % os.path.abspath(self.schema_dir_path))
self.k8s_status_updates: Dict[str, Tuple[str, str, Optional[Dict[str, Any]]]] = {} # Tuple is (name, namespace, status_json)
self.k8s_ingresses: Dict[str, Any] = {}
self.k8s_ingress_classes: Dict[str, Any] = {}
self.pod_labels: Dict[str, str] = {}
self._reset()

Expand Down
15 changes: 15 additions & 0 deletions python/ambassador/fetch/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,21 @@ def watt_key(self) -> str:
return 'secret'


class IngressClassesDependency (Dependency):
"""
A dependency that provides the list of ingress classes that are valid (i.e.,
have the proper controller) for this cluster.
"""

ingress_classes: MutableSet[str]

def __init__(self):
self.ingress_classes = set()

def watt_key(self) -> str:
return 'ingressclasses'


D = TypeVar('D', bound=Dependency)


Expand Down
Loading

0 comments on commit 09b3709

Please sign in to comment.