Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Fix dex pod reload on config change #1040

Merged
merged 2 commits into from
Oct 1, 2020
Merged

Conversation

knrt10
Copy link
Member

@knrt10 knrt10 commented Oct 1, 2020

closes: #1039
Signed-off-by: knrt10 kautilya@kinvolk.io
Co-authored-by: Mateusz Gozdek mateusz@kinvolk.io

closes: #1039
Signed-off-by: knrt10 <kautilya@kinvolk.io>
Co-authored-by: Mateusz Gozdek <mateusz@kinvolk.io>
@knrt10 knrt10 requested review from surajssd and invidian October 1, 2020 07:07
Copy link
Member

@surajssd surajssd left a comment

Choose a reason for hiding this comment

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

Please write an e2e test to verify this behaviour.

@invidian
Copy link
Member

invidian commented Oct 1, 2020

Please write an e2e test to verify this behaviour.

This might be complex, as our e2e test suite do not have access to cluster configuration to modify it... What is your idea to test this @surajssd ?

@knrt10
Copy link
Member Author

knrt10 commented Oct 1, 2020

@invidian I had a talk with Suraj offline and I think this should be like this.

  • Wait for dex deployment
  • Get annotation checksum hash from pod template
  • Update config map via go-api
  • Get new annotation and compare with old.
  • If changed, this means it has restarted the pod

What do you think? I am little confused. Can we update it via client-go?

@invidian
Copy link
Member

invidian commented Oct 1, 2020

What do you think? I am little confused. Can we update it via client-go?

It can only be updated via Helm render, as it's Helm template which generates the checksum.

@surajssd
Copy link
Member

surajssd commented Oct 1, 2020

In that case we can have a render test locally, which verifies that the annotations change on each render.

@knrt10 knrt10 requested a review from surajssd October 1, 2020 10:05
@knrt10 knrt10 force-pushed the knrt10/fix-dex-config-reload branch from cfd9b44 to c2952ea Compare October 1, 2020 11:02
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Looks OK, though I think Fatalf should be used instead of Errorf, as most of the errors will cause further code to panic.

pkg/components/dex/component_test.go Outdated Show resolved Hide resolved
On every render helm template will generate the checksum which will be
different for unique config. Which in turn will regenerate pods for
deployment on config change.

Signed-off-by: knrt10 <kautilya@kinvolk.io>
@knrt10 knrt10 force-pushed the knrt10/fix-dex-config-reload branch from c2952ea to 405c204 Compare October 1, 2020 11:28
@knrt10 knrt10 requested a review from invidian October 1, 2020 11:29
Copy link
Member

@invidian invidian left a comment

Choose a reason for hiding this comment

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

Looks OK

@knrt10 knrt10 merged commit 6b1e7cb into master Oct 1, 2020
@knrt10 knrt10 deleted the knrt10/fix-dex-config-reload branch October 1, 2020 14:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dex does not pick up updated config
3 participants