Skip to content

Commit

Permalink
OpensearchCOS module not needed, using COSAgent directly
Browse files Browse the repository at this point in the history
  • Loading branch information
juditnovak committed Dec 4, 2023
1 parent df083e9 commit 2ed9511
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 64 deletions.
1 change: 0 additions & 1 deletion lib/charms/opensearch/v0/constants_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
ClientRelationName = "opensearch-client"
PeerRelationName = "opensearch-peers"
PeerClusterRelationName = "peer-cluster"
COSRelationName = "cos-agent"
COSPort = "9200"


Expand Down
9 changes: 2 additions & 7 deletions lib/charms/opensearch/v0/opensearch_base_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
from datetime import datetime
from typing import Dict, List, Optional, Type

from charms.grafana_agent.v0.cos_agent import COSAgentProvider
from charms.opensearch.v0.constants_charm import (
AdminUserInitProgress,
CertsExpirationError,
ClientRelationName,
ClusterHealthRed,
ClusterHealthUnknown,
COSPort,
COSRelationName,
PeerRelationName,
PluginConfigChangeError,
RequestUnitServiceOps,
Expand Down Expand Up @@ -45,7 +45,6 @@
generate_password,
)
from charms.opensearch.v0.opensearch_config import OpenSearchConfig
from charms.opensearch.v0.opensearch_cos import OpenSearchCOSProvider
from charms.opensearch.v0.opensearch_distro import OpenSearchDistribution
from charms.opensearch.v0.opensearch_exceptions import (
OpenSearchError,
Expand Down Expand Up @@ -137,7 +136,7 @@ def __init__(self, *args, distro: Type[OpenSearchDistribution] = None):
self.status = Status(self)
self.health = OpenSearchHealth(self)
self.ops_lock = OpenSearchOpsLock(self)
self.cos_integration = OpenSearchCOSProvider(
self.cos_integration = COSAgentProvider(
self,
metrics_endpoints=[
{"path": "/_prometheus/metrics", "port": COSPort},
Expand Down Expand Up @@ -175,10 +174,6 @@ def __init__(self, *args, distro: Type[OpenSearchDistribution] = None):
self.framework.observe(
self.on[STORAGE_NAME].storage_detaching, self._on_opensearch_data_storage_detaching
)
self.framework.observe(
self.on[COSRelationName].relation_created,
self.cos_integration._on_cos_agent_relation_created,
)

self.framework.observe(self.on.set_password_action, self._on_set_password_action)
self.framework.observe(self.on.get_password_action, self._on_get_password_action)
Expand Down
56 changes: 0 additions & 56 deletions lib/charms/opensearch/v0/opensearch_cos.py

This file was deleted.

0 comments on commit 2ed9511

Please sign in to comment.