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

fix(persistence): set postgres ssl config to string Fixes #1866 #1867

Merged
merged 2 commits into from
Mar 17, 2020
Merged

fix(persistence): set postgres ssl config to string Fixes #1866 #1867

merged 2 commits into from
Mar 17, 2020

Conversation

AntoineDao
Copy link
Contributor

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234". Why? for the release notes.
  • I've signed the CLA and required builds are green.

Fixes #1866

workflow/util/util_test.go Outdated Show resolved Hide resolved
workflow/util/util_test.go Outdated Show resolved Hide resolved
@simster7
Copy link
Member

simster7 commented Dec 17, 2019

It seems like you used an old branch to make these changes, causing a lot of conflicts and old commits to be included. Can you redo your changes on a new branch that is checked out from a fresh pull of master? After you can force push the changes to this branch or open a new PR with the new branch.

@AntoineDao
Copy link
Contributor Author

I tested this on our cluster using sslMode: require and it worked as expected. Sorry for the initially faulty PR that made it into release v2.4.3... Should've read the pq docs a bit more before making changes 🤓

@alexec alexec self-assigned this Dec 19, 2019
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

As discussed, please keep support for SSL and introduce SSLMode.

@AntoineDao AntoineDao changed the title fix(persistence): set postgres ssl config to string fix(persistence): set postgres ssl config to string Fixes #1866 Dec 19, 2019
@AntoineDao
Copy link
Contributor Author

AntoineDao commented Mar 17, 2020

As discussed the following changes enable the following behavior:

  • Enable the use of SSL between database and argo controller through ssl boolean toggle
  • Specify the the SSL connection behavior through the sslMode string

Here are some example values if you were using an Argo helm chart

argo:
  controller:
    persistence:
        ssl: true
        sslMode: "verify-full"

According to the pq code docs I could find the following values are supported for sslMode:

  • disable - No SSL
  • require - Always SSL (skip verification)
  • verify-ca - Always SSL (verify that the certificate presented by the server was signed by a trusted CA)
  • verify-full - Always SSL (verify that the certification presented by the server was signed by a trusted CA and the server host name matches the one in the certificate)

@AntoineDao AntoineDao requested a review from alexec March 17, 2020 02:02
@AntoineDao
Copy link
Contributor Author

Server suite tests are failing. Something about a PodLogsNotFound test which is supposed to return 404 but returns 200. Not sure how the changes I've made could have impacted that...

--- FAIL: TestArgoServerSuite (15.60s)
    --- PASS: TestArgoServerSuite/TestArchivedWorkflowService (7.88s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListDoesNotExist (0.02s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListEquals (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListDoubleEquals (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListIn (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListNotEquals (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListNotIn (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListExists (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListGreaterThan0 (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListGreaterThan1 (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListLessThan1 (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListLessThan2 (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/ListWithLimitAndOffset (0.01s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/Get (0.02s)
        --- PASS: TestArgoServerSuite/TestArchivedWorkflowService/Delete (0.02s)
    --- PASS: TestArgoServerSuite/TestArtifactServer (0.06s)
    --- PASS: TestArgoServerSuite/TestCookieAuth (0.03s)
    --- PASS: TestArgoServerSuite/TestCreateWorkflowDryRun (0.04s)
    --- PASS: TestArgoServerSuite/TestCronWorkflowService (0.69s)
    --- PASS: TestArgoServerSuite/TestInfo (0.39s)
    --- PASS: TestArgoServerSuite/TestLintWorkflow (0.40s)
    --- PASS: TestArgoServerSuite/TestPermission (0.40s)
    --- PASS: TestArgoServerSuite/TestUnauthorized (0.40s)
    --- PASS: TestArgoServerSuite/TestWorkflowService (0.40s)
    --- FAIL: TestArgoServerSuite/TestWorkflowServiceStream (4.77s)
        --- PASS: TestArgoServerSuite/TestWorkflowServiceStream/Watch (4.00s)
        --- PASS: TestArgoServerSuite/TestWorkflowServiceStream/PodLogs (0.07s)
        --- FAIL: TestArgoServerSuite/TestWorkflowServiceStream/PodLogsNotFound (0.02s)
            argo_server_test.go:811: 
                	Error Trace:	argo_server_test.go:811
                	            				suite.go:76
                	Error:      	Not equal: 
                	            	expected: 404
                	            	actual  : 200
                	Test:       	TestArgoServerSuite/TestWorkflowServiceStream/PodLogsNotFound
    --- PASS: TestArgoServerSuite/TestWorkflowTemplateService (0.09s)

@alexec
Copy link
Contributor

alexec commented Mar 17, 2020

@AntoineDao lets try updating your branch...

@codecov
Copy link

codecov bot commented Mar 17, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@2205c0e). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1867   +/-   ##
=========================================
  Coverage          ?   11.69%           
=========================================
  Files             ?       72           
  Lines             ?    28894           
  Branches          ?        0           
=========================================
  Hits              ?     3378           
  Misses            ?    25072           
  Partials          ?      444
Impacted Files Coverage Δ
workflow/config/config.go 33.33% <ø> (ø)
persist/sqldb/sqldb.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2205c0e...ad70a4d. Read the comment docs.

@alexec alexec merged commit 6cb79e4 into argoproj:master Mar 17, 2020
@alexec
Copy link
Contributor

alexec commented Mar 17, 2020

:shipit:

@alexec alexec added this to the v2.7 milestone Mar 17, 2020
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.

Argo Database Persistence SSL does not work
4 participants