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

Add support for GLP IAM role and workspace to gltform #117

Merged
merged 1 commit into from
May 30, 2024
Merged
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
14 changes: 10 additions & 4 deletions pkg/gltform/gltform.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) Copyright 2021-2023 Hewlett Packard Enterprise Development LP
// (C) Copyright 2021-2024 Hewlett Packard Enterprise Development LP

package gltform

Expand All @@ -20,6 +20,10 @@ type Gljwt struct {
ProjectID string `yaml:"project_id"`
// RestURL - the URL to be used for metal, at present it refers to a Quake portal URL
RestURL string `yaml:"rest_url"`
// GLPWorkspace - the workspace to be used for GLP
GLPWorkspace string `yaml:"glp_workspace,omitempty"`
// GLPRole - the role to be used for GLP
GLPRole string `yaml:"glp_role,omitempty"`
// TODO remove this entry once we've switched quake-client over to using this package
// Token - the GL IAM token
Token string `yaml:"access_token,omitempty"`
Expand Down Expand Up @@ -47,9 +51,11 @@ func GetGLConfig() (gljwt *Gljwt, err error) {
func WriteGLConfig(d map[string]interface{}) error {
config := &Gljwt{
// If space_name isn't present, we'll just write out ""
SpaceName: d["space_name"].(string),
ProjectID: d["project_id"].(string),
RestURL: d["rest_url"].(string),
SpaceName: d["space_name"].(string),
ProjectID: d["project_id"].(string),
RestURL: d["rest_url"].(string),
GLPRole: d["glp_role"].(string),
GLPWorkspace: d["glp_workspace"].(string),
}

// Marshal config
Expand Down
Loading