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

Use Hostname() to set --hosted-domain #597

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/ocm/create/idp/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func init() {
&args.googleHostedDomain,
"hosted-domain",
"",
"Google: Restrict users to a Google Apps domain.\n",
"Google: Restrict users to a Google Apps domain. Example: http://redhat.com (scheme required)\n",
)

// LDAP
Expand Down
4 changes: 2 additions & 2 deletions cmd/ocm/create/idp/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ func buildGoogleIdp(cluster *cmv1.Cluster, idpName string) (idpBuilder cmv1.Iden
ClientSecret(clientSecret)

if hostedDomain != "" {
_, err = url.ParseRequestURI(hostedDomain)
hostedDomainParsed, err := url.ParseRequestURI(hostedDomain)
if err != nil {
return idpBuilder, fmt.Errorf("Expected a valid Hosted Domain: %v", err)
}
// Set the hosted domain, if any
googleIDP = googleIDP.HostedDomain(hostedDomain)
googleIDP = googleIDP.HostedDomain(hostedDomainParsed.Hostname())
}

// Create new IDP with Google provider
Expand Down
Loading