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

rewrite charm to sidecar #78

Merged
merged 21 commits into from
May 17, 2023
Merged

rewrite charm to sidecar #78

merged 21 commits into from
May 17, 2023

Conversation

beliaev-maksim
Copy link
Member

@beliaev-maksim beliaev-maksim commented May 15, 2023

rewrite OIDC charm to sidecar instead of podspec

Note, there was fundamental issue (or indented feature?) that is changed now.

Before, _check_public_url was not called at all anywhere in the code. Which allowed execution without this config and made config optional

This rewrite enforces the config to be applied, otherwise unit will be in Blocked state

@beliaev-maksim beliaev-maksim requested a review from a team as a code owner May 15, 2023 16:14
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Outdated Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
src/charm.py Show resolved Hide resolved
@i-chvets
Copy link
Contributor

Integration tests pass locally:

$ tox -e integration
integration: install_deps> python -I -m pip install -r requirements-integration.txt
integration: commands[0]> pytest -v --tb native --asyncio-mode=auto /home/ichvets/cw/dev/oidc-gatekeeper-operator/tests/integration --log-cli-level=INFO -s
======================================================== test session starts =========================================================
platform linux -- Python 3.10.6, pytest-7.2.0, pluggy-1.0.0 -- /home/ichvets/cw/dev/oidc-gatekeeper-operator/.tox/integration/bin/python
cachedir: .tox/integration/.pytest_cache
rootdir: /home/ichvets/cw/dev/oidc-gatekeeper-operator, configfile: pyproject.toml
plugins: operator-0.22.0, anyio-3.6.2, asyncio-0.20.3
asyncio: mode=auto
collecting ... collected 4 items

tests/integration/test_charm.py::TestOIDCOperator::test_build 
----------------------------------------------------------- live log setup -----------------------------------------------------------
INFO     pytest_operator.plugin:plugin.py:625 Adding model uk8s:test-charm-19xa on cloud microk8s
----------------------------------------------------------- live log call ------------------------------------------------------------
INFO     pytest_operator.plugin:plugin.py:504 Using tmp_path: /home/ichvets/cw/dev/oidc-gatekeeper-operator/.tox/integration/tmp/pytest/test-charm-19xa0
INFO     pytest_operator.plugin:plugin.py:948 Building charm oidc-gatekeeper
INFO     pytest_operator.plugin:plugin.py:953 Built charm oidc-gatekeeper in 182.00s
PASSED
tests/integration/test_charm.py::TestOIDCOperator::test_deploy 
----------------------------------------------------------- live log call ------------------------------------------------------------
INFO     juju.model:model.py:1959 Deploying local:oidc-gatekeeper-0
INFO     juju.model:model.py:2582 Waiting for model:
  oidc-gatekeeper/0 [allocating] waiting: installing agent
INFO     juju.model:model.py:2582 Waiting for model:
  oidc-gatekeeper/0 [allocating] waiting: agent initializing
INFO     juju.model:model.py:2582 Waiting for model:
  oidc-gatekeeper/0 [idle] active: 
PASSED
tests/integration/test_charm.py::TestOIDCOperator::test_relations 
----------------------------------------------------------- live log call ------------------------------------------------------------
INFO     juju.model:model.py:1959 Deploying ch:amd64/focal/istio-pilot-63
INFO     juju.model:model.py:1959 Deploying ch:amd64/focal/dex-auth-224
INFO     juju.model:model.py:2582 Waiting for model:
  oidc-gatekeeper/0 [executing] active: 
  istio-pilot/0 [allocating] waiting: installing agent
  dex-auth/0 [allocating] waiting: installing agent
INFO     juju.model:model.py:2582 Waiting for model:
  istio-pilot/0 [allocating] waiting: installing agent
  dex-auth/0 [allocating] waiting: agent initializing
INFO     juju.model:model.py:2582 Waiting for model:
  istio-pilot/0 [allocating] waiting: agent initializing
  dex-auth/0 [executing] maintenance: installing charm software
INFO     juju.model:model.py:2582 Waiting for model:
  oidc-gatekeeper/0 [executing] waiting: List of oidc-client versions not found for apps: dex-auth
  istio-pilot/0 [executing] active: 
  dex-auth/0 [executing] maintenance: installing charm software
INFO     juju.model:model.py:2582 Waiting for model:
  oidc-gatekeeper/0 [idle] active: 
  istio-pilot/0 [idle] active: 
  dex-auth/0 [idle] active: 
PASSED

i-chvets
i-chvets previously approved these changes May 16, 2023
Copy link
Contributor

@i-chvets i-chvets left a comment

Choose a reason for hiding this comment

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

Approved.
ACK: CI is failing in Github runner, passes locally.

Copy link
Contributor

@i-chvets i-chvets left a comment

Choose a reason for hiding this comment

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

Approved.

@beliaev-maksim beliaev-maksim merged commit 08d6e21 into main May 17, 2023
@beliaev-maksim beliaev-maksim deleted the sidecar branch May 17, 2023 12:23
orfeas-k added a commit that referenced this pull request Sep 11, 2023
Block charm when `public_url` is not configured
Partial backport of #78
Closes #107
Closes #18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants