Skip to content

Commit

Permalink
Merge pull request #13 from canonical/tls-lib-upgrade
Browse files Browse the repository at this point in the history
TLS lib upgrade
  • Loading branch information
Mehdi-Bendriss authored Nov 4, 2022
2 parents daa9dbb + 3da2cb0 commit a625f8b
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 67 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,7 +19,7 @@ jobs:

unit-test:
name: Unit tests
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -30,7 +30,7 @@ jobs:

integration-test-lxd-charm:
name: Integration tests for the charm (lxd)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -49,7 +49,7 @@ jobs:
integration-test-lxd-tls:
name: Integration tests for TLS (lxd)
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@ on:
- main

jobs:
# lib-check:
# name: Check libraries
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
lib-check:
name: Check libraries
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check libs
uses: canonical/charming-actions/[email protected]
with:
credentials: "${{ secrets.CHARMHUB_TOKEN }}" # FIXME: current token will expire in 2023-07-04
github-token: "${{ secrets.GITHUB_TOKEN }}"
ci-tests:
uses: ./.github/workflows/ci.yaml

release-to-charmhub:
name: Release to CharmHub
needs:
# - lib-check
- lib-check
- ci-tests
runs-on: ubuntu-22.04
steps:
Expand Down
6 changes: 3 additions & 3 deletions lib/charms/opensearch/v0/opensearch_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import logging
import re
import socket
from typing import Dict, Optional, Tuple
from typing import Dict, List, Optional, Tuple

from charms.opensearch.v0.constants_tls import TLS_RELATION, CertType
from charms.opensearch.v0.helper_databag import Scope
Expand Down Expand Up @@ -199,14 +199,14 @@ def _request_certificate(
if self.charm.model.get_relation(TLS_RELATION):
self.certs.request_certificate_creation(certificate_signing_request=csr)

def _get_sans(self, cert_type: CertType) -> dict:
def _get_sans(self, cert_type: CertType) -> Dict[str, List[str]]:
"""Create a list of OID/IP/DNS names for an OpenSearch unit.
Returns:
A list representing the hostnames of the OpenSearch unit.
or None if admin cert_type, because that cert is not tied to a specific host.
"""
sans = {"sans_oid": "1.2.3.4.5.5"} # required for node discovery
sans = {"sans_oid": ["1.2.3.4.5.5"]} # required for node discovery
if cert_type == CertType.APP_ADMIN:
return sans

Expand Down
Loading

0 comments on commit a625f8b

Please sign in to comment.