Skip to content

Commit

Permalink
Add oidc issuerURL and clientID to kluster spec (#880)
Browse files Browse the repository at this point in the history
  • Loading branch information
jknipper committed Feb 22, 2024
1 parent be93bd5 commit 1f09842
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 4 deletions.
46 changes: 46 additions & 0 deletions pkg/api/models/kluster_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions pkg/api/models/o_id_c.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions pkg/api/spec/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 16 additions & 4 deletions pkg/util/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ type etcdBackupValues struct {
}

type apiValues struct {
ApiserverHost string `yaml:"apiserverHost,omitempty" json:"apiserverHost,omitempty"`
WormholeHost string `yaml:"wormholeHost,omitempty" json:"wormholeHost,omitempty"`
CORSAllowedOrigins string `yaml:"corsAllowedOrigins,omitempty" json:"corsAllowedOrigins,omitempty"`
SNICertSecret string `yaml:"sniCertSecret,omitempty" json:"sniCertSecret,omitempty"`
ApiserverHost string `yaml:"apiserverHost,omitempty" json:"apiserverHost,omitempty"`
WormholeHost string `yaml:"wormholeHost,omitempty" json:"wormholeHost,omitempty"`
CORSAllowedOrigins string `yaml:"corsAllowedOrigins,omitempty" json:"corsAllowedOrigins,omitempty"`
SNICertSecret string `yaml:"sniCertSecret,omitempty" json:"sniCertSecret,omitempty"`
OIDC oidcValues `yaml:"oidc,omitempty" json:"oidc,omitempty"`
}

type versionValues struct {
Expand All @@ -83,6 +84,11 @@ type dexValues struct {
Connectors dexConnectors `yaml:"connectors,omitempty" json:"connectors,omitempty"`
}

type oidcValues struct {
IssuerURL string `yaml:"issuerURL,omitempty" json:"issuerURL,omitempty"`
ClientID string `yaml:"clientID,omitempty" json:"clientID,omitempty"`
}

type dexConnectors struct {
Keystone dexKeystoneConnector `yaml:"keystone" json:"keystone"`
LDAP dexLDAPConnector `yaml:"ldap" json:"ldap"`
Expand Down Expand Up @@ -230,6 +236,12 @@ func KlusterToHelmValues(kluster *v1.Kluster, secret *v1.Secret, kubernetesVersi
UseOctavia: true,
}
}
if kluster.Spec.Oidc != nil {
values.Api.OIDC = oidcValues{
IssuerURL: kluster.Spec.Oidc.IssuerURL,
ClientID: kluster.Spec.Oidc.ClientID,
}
}

result, err := yaml.Marshal(values)
if err != nil {
Expand Down
10 changes: 10 additions & 0 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,16 @@ definitions:
default: false
seedKubeadm:
type: boolean
oidc:
$ref: '#/definitions/OIDC'
OIDC:
type: object
x-nullable: true
properties:
issuerURL:
type: string
clientID:
type: string
OpenstackSpec:
type: object
x-nullable: false
Expand Down

0 comments on commit 1f09842

Please sign in to comment.