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

Replace the --lets-encrypt flag with --insecure-skip-tls-verify flag #1093

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

metlos
Copy link
Contributor

@metlos metlos commented Jan 13, 2025

This is to update toolchain-e2e to the new flag in ksctl.

See kubesaw/ksctl#95.

make/test.mk Outdated
Comment on lines 40 to 41
else
TLS_VERIFY_PARAM := --insecure-skip-tls-verify=true
Copy link
Contributor

Choose a reason for hiding this comment

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

should we disable tls verification by default when running the tests "locally" ? Or should we document this and let the user decide ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

correct me if I'm wrong, if the flag is not specified, then it would use whatever is in the client's kubeconfig. The flag should be used only if you want to override (for some specific reason) the information in kubeconfig.

This means that the default behavior shouldn't use the flag at all, only if requested explicitly via a variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 I thought the same, but maybe I've missed something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to keep the same behavior as there was with the --lets-encrypt flag. The main reason being that I'm not fully sure about the consequences of relying on the contents of the kubeconfig.

If the intended behavior should change, I'm fine with it though. As far as I looked we ALWAYS set the --lets-encrypt=false in all environments (e.g. CI or default when running locally) - I haven't found a place where we'd set IS_OSD=true anywhere.

To keep this behavior, we'd need to set --insecure-skip-tls-verify=false only when IS_OSD=true and we should be explicit about it.

I don't know what the kubeconfig looks like in the CI (whether it explicitly sets the insecure-skip-tls-verify or whether the connection to the clusters in the CI doesn't require it) so I didn't want to risk wreaking havoc in all our CI jobs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I haven't found a place where we'd set IS_OSD=true anywhere.

that was used for local dev use-cases. Some teams/developers had OSD cluster for the local dev (instead of a pure OCP)

To keep this behavior, we'd need to set --insecure-skip-tls-verify=false only when IS_OSD=true and we should be explicit about it.

if it's OSD and you (as an admin) execute the register-member command, then you don't have this field defined in your kubeconfig, nor the cert as the OSD cluster uses let's encrypt cert which is a well-know one.

I don't know what the kubeconfig looks like in the CI (whether it explicitly sets the insecure-skip-tls-verify or whether the connection to the clusters in the CI doesn't require it)

does it matter? if the kubeconfig has insecure-skip-tls-verify defined, then the command copies it, if not, then it should have the self-sign certificate, which should be copied as well.

Let's do what we wanted to do and what was the reason for these changes - rely on the content of the kubeconfig if not explicitly defined otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I discovered we already have DISABLE_KUBE_CLIENT_TLS_VERIFY to have this behavior for the kubeclient used in the tests. I think we can use this also to specify whether to use --insecure-skip-tls-verify=true for the ksctl. I've updated the make files to do this.

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 the additional changes.

@metlos
Copy link
Contributor Author

metlos commented Jan 16, 2025

/retest

Copy link

openshift-ci bot commented Jan 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fbm3307, metlos, mfrancisc

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:
  • OWNERS [fbm3307,metlos,mfrancisc]

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

@metlos metlos merged commit 57551c2 into codeready-toolchain:master Jan 17, 2025
8 of 9 checks passed
@metlos metlos deleted the remove-lets-encrypt-flag branch January 17, 2025 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants