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: allow insecure clusters #800

Merged

Conversation

filariow
Copy link
Contributor

No description provided.

Signed-off-by: Francesco Ilario <[email protected]>
@openshift-ci
Copy link

openshift-ci bot commented Sep 27, 2023

Hi @filariow. Thanks for your PR.

I'm waiting for a codeready-toolchain member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@alexeykazakov
Copy link
Contributor

/ok-to-test

@alexeykazakov
Copy link
Contributor

OK. It failed :(

    init.go:68: 
        	Error Trace:	/go/src/github.com/codeready-toolchain/toolchain-e2e/testsupport/init.go:68
        	            				/usr/local/go/src/sync/once.go:74
        	            				/usr/local/go/src/sync/once.go:65
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/testsupport/init.go:45
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/test/migration/setup/setup_migration_test.go:12
        	Error:      	Received unexpected error:
        	            	specifying a root certificates file with the insecure flag is not allowed
        	Test:       	TestSetupMigration
--- FAIL: TestSetupMigration (0.00s)

Copy link
Contributor

@dperaza4dustbit dperaza4dustbit left a comment

Choose a reason for hiding this comment

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

looks good but one sugestion

kubeconfig, err := clientcmd.NewDefaultClientConfig(*apiConfig, &clientcmd.ConfigOverrides{}).ClientConfig()
configOverrides := clientcmd.ConfigOverrides{
ClusterDefaults: api.Cluster{
InsecureSkipTLSVerify: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to make this an option we can pass make instead of hardcoding to true? What if we want to test security?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

It seems that disabling the TLSVerify doesn't work on openshift CI at least. If this configuration works on your cluster then maybe we could introduce an env variable to optionally turn it off?

Something like:

make test-e2e DISABLE_KUBE_CLIENT_TLS_VERIFY=true

and keep the tls verification on by default, as it is now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the review. I implemented this in 96535fb. Do you have any suggestion on a better place where to fetch the env variable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Extracting the config logic builder into a function is what I was thinking as well! 👍

Should we add few lines to document this new variable, maybe adding a know issues/workarounds section here: https://github.com/codeready-toolchain/toolchain-e2e/blob/master/CRC.adoc
reporting the tls failure and the workaround of using this env variable ?

If it's not specific to CRC maybe we could add this new section in the main README.

WDYT?

Copy link
Contributor Author

@filariow filariow Sep 29, 2023

Choose a reason for hiding this comment

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

I like the idea, let me work on this! 👍🏾
It's not related to CRC, so I'll go for the README change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mfrancisc I've added a note in the README's Running End-to-End Tests. WDYT?

Signed-off-by: Francesco Ilario <[email protected]>
@filariow
Copy link
Contributor Author

filariow commented Sep 28, 2023

OK. It failed :(

    init.go:68: 
        	Error Trace:	/go/src/github.com/codeready-toolchain/toolchain-e2e/testsupport/init.go:68
        	            				/usr/local/go/src/sync/once.go:74
        	            				/usr/local/go/src/sync/once.go:65
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/testsupport/init.go:45
        	            				/go/src/github.com/codeready-toolchain/toolchain-e2e/test/migration/setup/setup_migration_test.go:12
        	Error:      	Received unexpected error:
        	            	specifying a root certificates file with the insecure flag is not allowed
        	Test:       	TestSetupMigration
--- FAIL: TestSetupMigration (0.00s)

I was able to reproduce this error on CRC and pushed a new commit that worked on CRC so that we can see if it works also on Openshift CI

Signed-off-by: Francesco Ilario <[email protected]>
@mfrancisc
Copy link
Contributor

/ok-to-test

@mfrancisc
Copy link
Contributor

/retest

infra

Copy link
Contributor

@alexeykazakov alexeykazakov left a comment

Choose a reason for hiding this comment

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

Looks good! But please update the README as @mfrancisc suggested.

Signed-off-by: Francesco Ilario <[email protected]>
Copy link
Contributor

@mfrancisc mfrancisc left a comment

Choose a reason for hiding this comment

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

Looks good 👍

Thanks for addressing my comments.

@openshift-ci
Copy link

openshift-ci bot commented Sep 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, filariow, mfrancisc, rajivnathan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@filariow
Copy link
Contributor Author

Looks good 👍

Thanks for addressing my comments.

Thank you for your reviews. I pushed a new commit renaming the new function to a more coherent name.

README.adoc Outdated Show resolved Hide resolved
Co-authored-by: Baiju Muthukadan <[email protected]>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@alexeykazakov
Copy link
Contributor

/lgtm

@openshift-merge-robot openshift-merge-robot merged commit ff18cca into codeready-toolchain:master Sep 29, 2023
6 checks passed
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.

7 participants