Skip to content

fix bugs around ingress, tls, and dev-password#495

Merged
punkwalker merged 2 commits intocnoe-io:mainfrom
squidboylan:dev-pass-bug-fix
Mar 12, 2025
Merged

fix bugs around ingress, tls, and dev-password#495
punkwalker merged 2 commits intocnoe-io:mainfrom
squidboylan:dev-pass-bug-fix

Conversation

@squidboylan
Copy link
Copy Markdown
Contributor

@squidboylan squidboylan commented Mar 7, 2025

This PR fixes a few bugs around using the --ingress-host-name flag, --dev-password flag, and --use-path-routing flag. I initially wanted to separate these but decided they make sense to keep together since they're all a little bit interdependent.

Before this change using the --ingress-host-name flag would cause argo to fail to fetch repos from gitea due to missing SANs in the TLS cert. It also fixes a bug where we're hardcoding the domain for argocd and gitea to cnoe.localtest.me in the --dev-password codepath.

@squidboylan squidboylan marked this pull request as draft March 7, 2025 00:53
@squidboylan
Copy link
Copy Markdown
Contributor Author

Marking this as a draft, i think there's more bugs here and i wanna make sure I'm solving them right

@squidboylan squidboylan force-pushed the dev-pass-bug-fix branch 3 times, most recently from d259e7b to 1ff0ba3 Compare March 7, 2025 03:49
@squidboylan squidboylan changed the title fix bug when using both --host and --dev-password fix bugs around ingress, tls, and dev-password Mar 7, 2025
Signed-off-by: Caleb Boylan <calebboylan@gmail.com>
When using the --ingress-host-name flag we end up needing two separate
ingresses per service. This is because the cluster services will
continue to use the "host" domain to access other resources within the
cluster. In order to properly setup these extra ingresses we need to add
a SAN for the separate ingress host name.

Signed-off-by: Caleb Boylan <calebboylan@gmail.com>
@squidboylan squidboylan marked this pull request as ready for review March 7, 2025 04:22
@@ -157,7 +157,7 @@ func (r *LocalbuildReconciler) setGiteaToken(ctx context.Context, secret corev1.
// gitea URL reachable within the cluster with proper coredns config. Mainly for argocd
func giteaInternalBaseUrl(config v1alpha1.BuildCustomizationSpec) string {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This could be simplified a bit to just use the pkg/util/gitea.go GiteaBaseUrl function, not sure if we want that change in this PR though, it's already getting a bit bloated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this function is specific for returning in-cluster URL and I can see it is only used once. And the way this PR changes it's logic, it is identical to pkg/util/gitea.go/GiteaBaseUrl function. So we should use that and get rid of this function.

Copy link
Copy Markdown
Contributor

@punkwalker punkwalker left a comment

Choose a reason for hiding this comment

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

The changes LGTM. I am not sure how/if these changes will impact the current assumptions that we have made in configuration of various components. Let's see how e2e test perform on this PR.

@@ -157,7 +157,7 @@ func (r *LocalbuildReconciler) setGiteaToken(ctx context.Context, secret corev1.
// gitea URL reachable within the cluster with proper coredns config. Mainly for argocd
func giteaInternalBaseUrl(config v1alpha1.BuildCustomizationSpec) string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this function is specific for returning in-cluster URL and I can see it is only used once. And the way this PR changes it's logic, it is identical to pkg/util/gitea.go/GiteaBaseUrl function. So we should use that and get rid of this function.

@punkwalker
Copy link
Copy Markdown
Contributor

/e2e

@punkwalker
Copy link
Copy Markdown
Contributor

The changes LGTM. I am not sure how/if these changes will impact the current assumptions that we have made in configuration of various components. Let's see how e2e test perform on this PR.

So e2e completed successfully. So we can merge this if you are done with changes

@squidboylan
Copy link
Copy Markdown
Contributor Author

So e2e completed successfully. So we can merge this if you are done with changes

Let's merge this, I'll remove the duplicate function in a future PR, this PR is already getting larger than it should be.

@squidboylan squidboylan requested a review from punkwalker March 7, 2025 21:04
Copy link
Copy Markdown
Contributor

@punkwalker punkwalker left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@punkwalker punkwalker merged commit ff2ea44 into cnoe-io:main Mar 12, 2025
7 checks passed
cmoulliard pushed a commit to ch007m/fork-idpbuilder that referenced this pull request Mar 14, 2025
Signed-off-by: Caleb Boylan <calebboylan@gmail.com>
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.

2 participants