-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
openshift resources prometheus rules (#4411)
Introduce openshift-prometheus-rules as a separate integration that handles prometheus rule for namespace openshiftResources. Similar to openshift-routes or openshift-vault-secrets. This will speed up app-interface PR checks. Ticket: APPSRE-10344
- Loading branch information
Showing
5 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from collections.abc import Iterable | ||
from typing import Any | ||
|
||
import reconcile.openshift_resources_base as orb | ||
from reconcile.utils.runtime.integration import DesiredStateShardConfig | ||
from reconcile.utils.semver_helper import make_semver | ||
|
||
QONTRACT_INTEGRATION = "openshift-prometheus-rules" | ||
QONTRACT_INTEGRATION_VERSION = make_semver(1, 0, 0) | ||
PROVIDERS = ["prometheus-rule"] | ||
|
||
|
||
def run( | ||
dry_run: bool, | ||
thread_pool_size: int = 10, | ||
internal: bool | None = None, | ||
use_jump_host: bool = True, | ||
cluster_name: Iterable[str] | None = None, | ||
exclude_cluster: Iterable[str] | None = None, | ||
namespace_name: str | None = None, | ||
) -> None: | ||
orb.QONTRACT_INTEGRATION = QONTRACT_INTEGRATION | ||
orb.QONTRACT_INTEGRATION_VERSION = QONTRACT_INTEGRATION_VERSION | ||
|
||
orb.run( | ||
dry_run=dry_run, | ||
thread_pool_size=thread_pool_size, | ||
internal=internal, | ||
use_jump_host=use_jump_host, | ||
providers=PROVIDERS, | ||
cluster_name=cluster_name, | ||
exclude_cluster=exclude_cluster, | ||
namespace_name=namespace_name, | ||
init_api_resources=True, | ||
) | ||
|
||
|
||
def early_exit_desired_state(*args: Any, **kwargs: Any) -> dict[str, Any]: | ||
return orb.early_exit_desired_state(PROVIDERS) | ||
|
||
|
||
def desired_state_shard_config() -> DesiredStateShardConfig: | ||
return orb.desired_state_shard_config() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters