Skip to content

Commit 694c9da

Browse files
authored
Add Jaegar ocp resource (#2518)
1 parent b8e91fa commit 694c9da

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

ocp_resources/jaeger.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md
2+
3+
4+
from typing import Any
5+
from ocp_resources.resource import NamespacedResource
6+
7+
8+
class Jaeger(NamespacedResource):
9+
"""
10+
Jaeger is the Schema for the jaegers.jaegertracing.io API
11+
"""
12+
13+
api_group: str = NamespacedResource.ApiGroup.JAEGERTRACING_IO
14+
15+
def __init__(
16+
self,
17+
strategy: str | None = None,
18+
ingress: dict[str, Any] | None = None,
19+
collector: dict[str, Any] | None = None,
20+
**kwargs: Any,
21+
) -> None:
22+
"""
23+
Args:
24+
strategy (str): Jaeger deployment strategy ("allInOne" or "production").
25+
ingress (dict[str, Any]): Optional ingress settings for Jaeger UI.
26+
collector (dict[str, Any]): Optional collector configuration.
27+
"""
28+
super().__init__(**kwargs)
29+
self.strategy = strategy
30+
self.ingress = ingress
31+
self.collector = collector
32+
33+
def to_dict(self) -> None:
34+
super().to_dict()
35+
if not self.kind_dict and not self.yaml_file:
36+
self.res["spec"] = {}
37+
_spec = self.res["spec"]
38+
if self.strategy is not None:
39+
_spec["strategy"] = self.strategy
40+
if self.ingress is not None:
41+
_spec["ingress"] = self.ingress
42+
if self.collector is not None:
43+
_spec["collector"] = self.collector
44+
45+
# End of generated code

ocp_resources/resource.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ class ApiGroup:
501501
IMAGEREGISTRY_OPERATOR_OPENSHIFT_IO: str = "imageregistry.operator.openshift.io"
502502
INSTANCETYPE_KUBEVIRT_IO: str = "instancetype.kubevirt.io"
503503
INTEGREATLY_ORG: str = "integreatly.org"
504+
JAEGERTRACING_IO = "jaegertracing.io"
504505
K8S_CNI_CNCF_IO: str = "k8s.cni.cncf.io"
505506
K8S_MARIADB_COM: str = "k8s.mariadb.com"
506507
K8S_OVN_ORG: str = "k8s.ovn.org"

0 commit comments

Comments
 (0)