Skip to content

Commit

Permalink
refactor(operator): use stack client for stargate
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed May 22, 2023
1 parent 71aaaac commit aad12da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
3 changes: 0 additions & 3 deletions components/operator/apis/stack/v1beta3/stack_types.go
Expand Up @@ -94,9 +94,6 @@ type StackAuthSpec struct {

type StackStargateConfig struct {
StargateServerURL string `json:"stargateServerURL"`
AuthClientID string `json:"authClientId"`
AuthClientSecret string `json:"authClientSecret"`
AuthIssuerURL string `json:"authIssuerURL"`
}

// StackSpec defines the desired state of Stack
Expand Down
Expand Up @@ -1927,18 +1927,9 @@ spec:
type: string
stargate:
properties:
authClientId:
type: string
authClientSecret:
type: string
authIssuerURL:
type: string
stargateServerURL:
type: string
required:
- authClientId
- authClientSecret
- authIssuerURL
- stargateServerURL
type: object
versions:
Expand Down
6 changes: 3 additions & 3 deletions components/operator/internal/handlers/handler_stargate.go
Expand Up @@ -19,9 +19,9 @@ func init() {
modules.Env("STACK_ID", stackID),
modules.Env("STARGATE_SERVER_URL", resolveContext.Stack.Spec.Stargate.StargateServerURL),
modules.Env("GATEWAY_URL", "http://gateway:"+strconv.Itoa(int(resolveContext.RegisteredModules["gateway"].Module.Services(resolveContext.Context)[0].Port))),
modules.Env("STARGATE_AUTH_CLIENT_ID", resolveContext.Stack.Spec.Stargate.AuthClientID),
modules.Env("STARGATE_AUTH_CLIENT_SECRET", resolveContext.Stack.Spec.Stargate.AuthClientSecret),
modules.Env("STARGATE_AUTH_ISSUER_URL", resolveContext.Stack.Spec.Stargate.AuthIssuerURL),
modules.Env("STARGATE_AUTH_CLIENT_ID", resolveContext.Stack.Spec.Auth.DelegatedOIDCServer.ClientID),
modules.Env("STARGATE_AUTH_CLIENT_SECRET", resolveContext.Stack.Spec.Auth.DelegatedOIDCServer.ClientSecret),
modules.Env("STARGATE_AUTH_ISSUER_URL", resolveContext.Stack.Spec.Auth.DelegatedOIDCServer.Issuer),
)
}
modules.Register("stargate", modules.Module{
Expand Down

0 comments on commit aad12da

Please sign in to comment.