Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add TLS integration to the NMS #467

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

patriciareinoso
Copy link
Contributor

@patriciareinoso patriciareinoso commented Nov 7, 2024

Description

After integrating with TLS certificates interface, the NMS is served on https. This PR updates the address used to reach the NMS on the integration tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that validate the behaviour of the software
  • I validated that new and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have bumped the version of the library

@patriciareinoso patriciareinoso marked this pull request as ready for review November 18, 2024 10:42
@patriciareinoso patriciareinoso requested a review from a team as a code owner November 18, 2024 10:42
@patriciareinoso patriciareinoso marked this pull request as draft November 18, 2024 11:08
@patriciareinoso patriciareinoso force-pushed the TELCO-1408-add-tls-integration-nms branch from e03f768 to 11bf828 Compare November 19, 2024 09:07
@patriciareinoso patriciareinoso marked this pull request as ready for review November 19, 2024 09:11
Copy link
Contributor

@Gmerold Gmerold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gatici
Copy link
Contributor

gatici commented Nov 19, 2024

Pydantic validation errors happens:

unit-self-signed-certificates-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "relation-ids" for self-signed-certificates/0-certificates-relation-changed-0b9e87ce7834d07361adc929de957e94
unit-nms-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "juju-log" for nms/0-auth_database-relation-joined-b049f3e28dbfe4ea50140b82abea5be6
unit-nms-0: 2024-11-19 09:16:30 DEBUG unit.nms/0.juju-log auth_database:31: Emitting Juju event auth_database_relation_joined.
unit-traefik-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "juju-log" for traefik/0-ingress-relation-created-2939c7cf43e87b8f1e01b821055e9525
unit-traefik-0: 2024-11-19 09:16:30 ERROR unit.traefik/0.juju-log ingress:44: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 1199, in <module>
    main(TraefikIngressCharm, use_juju_for_storage=True)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 548, in main
    manager.run()
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 527, in run
    self._emit()
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 516, in _emit
    _emit_charm_event(self.charm, self.dispatcher.event_name)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 147, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/traefik_k8s/v2/ingress.py", line 461, in _handle_relation
    self.on.data_provided.emit(  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 675, in _handle_ingress_data_provided
    self._process_ingress_relation(event.relation)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 754, in _process_ingress_relation
    self._provide_ingress(relation, provider)  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 878, in _provide_ingress
    config = config_getter(relation)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 942, in _get_configs_per_app
    ipa.publish_url(relation, external_url)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/traefik_k8s/v2/ingress.py", line 552, in publish_url
    IngressProviderAppData(ingress=ingress_url).dump(relation.data[self.app])  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/pydantic/main.py", line 176, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for IngressProviderAppData
ingress.url
  Input should be a valid URL, invalid IPv4 address [type=url_parsing, input_value='http://sdcore-nms.10.0.0.4/', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/url_parsing
unit-self-signed-certificates-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "relation-list" for self-signed-certificates/0-certificates-relation-changed-0b9e87ce7834d07361adc929de957e94

@Gmerold
Copy link
Contributor

Gmerold commented Nov 19, 2024

Pydantic validation errors happens:

unit-self-signed-certificates-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "relation-ids" for self-signed-certificates/0-certificates-relation-changed-0b9e87ce7834d07361adc929de957e94
unit-nms-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "juju-log" for nms/0-auth_database-relation-joined-b049f3e28dbfe4ea50140b82abea5be6
unit-nms-0: 2024-11-19 09:16:30 DEBUG unit.nms/0.juju-log auth_database:31: Emitting Juju event auth_database_relation_joined.
unit-traefik-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "juju-log" for traefik/0-ingress-relation-created-2939c7cf43e87b8f1e01b821055e9525
unit-traefik-0: 2024-11-19 09:16:30 ERROR unit.traefik/0.juju-log ingress:44: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 1199, in <module>
    main(TraefikIngressCharm, use_juju_for_storage=True)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 548, in main
    manager.run()
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 527, in run
    self._emit()
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 516, in _emit
    _emit_charm_event(self.charm, self.dispatcher.event_name)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 147, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/traefik_k8s/v2/ingress.py", line 461, in _handle_relation
    self.on.data_provided.emit(  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 675, in _handle_ingress_data_provided
    self._process_ingress_relation(event.relation)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 754, in _process_ingress_relation
    self._provide_ingress(relation, provider)  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 878, in _provide_ingress
    config = config_getter(relation)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "./src/charm.py", line 942, in _get_configs_per_app
    ipa.publish_url(relation, external_url)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/tempo_k8s/v1/charm_tracing.py", line 548, in wrapped_function
    return callable(*args, **kwargs)  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/traefik_k8s/v2/ingress.py", line 552, in publish_url
    IngressProviderAppData(ingress=ingress_url).dump(relation.data[self.app])  # type: ignore
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/pydantic/main.py", line 176, in __init__
    self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for IngressProviderAppData
ingress.url
  Input should be a valid URL, invalid IPv4 address [type=url_parsing, input_value='http://sdcore-nms.10.0.0.4/', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/url_parsing
unit-self-signed-certificates-0: 2024-11-19 09:16:30 DEBUG jujuc running hook tool "relation-list" for self-signed-certificates/0-certificates-relation-changed-0b9e87ce7834d07361adc929de957e94

It's unrelated. That's just Traefik. It's supposed to be fixed in the new release, but it's not yet in stable.

@patriciareinoso patriciareinoso merged commit 5aae648 into main Nov 19, 2024
15 checks passed
@patriciareinoso patriciareinoso deleted the TELCO-1408-add-tls-integration-nms branch November 19, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants