Skip to content

Commit

Permalink
Updates the controller configuration file name from agent.conf to
Browse files Browse the repository at this point in the history
controller.conf.

This is because on K8s, the agent's configuration is in in the
controller-n path instead of machine-n on metal/VMs. We must use a
different file name, or we overwrite the agent configuration.
  • Loading branch information
manadart committed Mar 15, 2024
1 parent ee56bf5 commit fda1af2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def _controller_config_path(self) -> str:
the local controller ID, then use it to construct a config path.
"""
controller_id = self._config_change_socket.get_controller_agent_id()
return f'/var/lib/juju/agents/controller-{controller_id}/agent.conf'
return f'/var/lib/juju/agents/controller-{controller_id}/controller.conf'

def _request_config_reload(self):
"""Send a reload request to the config reload socket"""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def test_dbcluster_relation_changed_write_file(
self.harness.update_relation_data(
relation_id, harness.charm.app.name, {'db-bind-addresses': json.dumps(bound)})

file_path = '/var/lib/juju/agents/controller-0/agent.conf'
file_path = '/var/lib/juju/agents/controller-0/controller.conf'
self.assertEqual(mock_open.call_count, 2)

# First call to read out the YAML
Expand Down

0 comments on commit fda1af2

Please sign in to comment.