Skip to content

Commit 4e45e80

Browse files
committed
Auth0 app change
1 parent 34c9f3e commit 4e45e80

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

internal/provider/cloudspace_resource.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (r *cloudspaceResource) Create(ctx context.Context, req resource.CreateRequ
123123
return
124124
}
125125
tflog.Info(ctx, "Created cloudspace", map[string]any{"name": cloudspace.ObjectMeta.Name})
126-
diags := steCloudspaceState(ctx, cloudspace, &data)
126+
diags := setCloudspaceState(ctx, cloudspace, &data)
127127
resp.Diagnostics.Append(diags...)
128128
if resp.Diagnostics.HasError() {
129129
return
@@ -162,7 +162,7 @@ func (r *cloudspaceResource) Read(ctx context.Context, req resource.ReadRequest,
162162
resp.Diagnostics.AddError("Failed to get cloudspace", err.Error())
163163
return
164164
}
165-
diags := steCloudspaceState(ctx, cloudspace, &data)
165+
diags := setCloudspaceState(ctx, cloudspace, &data)
166166
resp.Diagnostics.Append(diags...)
167167
if resp.Diagnostics.HasError() {
168168
return
@@ -220,7 +220,7 @@ func (r *cloudspaceResource) Update(ctx context.Context, req resource.UpdateRequ
220220
return
221221
}
222222
tflog.Info(ctx, "Updated cloudspace", map[string]any{"name": data.CloudspaceName.ValueString()})
223-
diags := steCloudspaceState(ctx, cloudspace, &data)
223+
diags := setCloudspaceState(ctx, cloudspace, &data)
224224
resp.Diagnostics.Append(diags...)
225225
if resp.Diagnostics.HasError() {
226226
return
@@ -276,7 +276,7 @@ func (r *cloudspaceResource) ImportState(ctx context.Context, req resource.Impor
276276
resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp)
277277
}
278278

279-
func steCloudspaceState(ctx context.Context, cloudspace *ngpcv1.CloudSpace, state *resource_cloudspace.CloudspaceModel) diag.Diagnostics {
279+
func setCloudspaceState(ctx context.Context, cloudspace *ngpcv1.CloudSpace, state *resource_cloudspace.CloudspaceModel) diag.Diagnostics {
280280
var diags diag.Diagnostics
281281
state.Id = types.StringValue(getIDFromObjectMeta(cloudspace.ObjectMeta))
282282
state.Region = types.StringValue(cloudspace.Spec.Region)

internal/provider/kubeconfig_data_source.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
ktypes "k8s.io/apimachinery/pkg/types"
2020
)
2121

22+
const auth0AppName = "NGPC UI"
23+
2224
//go:embed kubeconfig.yaml.tmpl
2325
var kubeconfigTemplate string
2426

@@ -119,13 +121,13 @@ func (d *kubeconfigDataSource) Read(ctx context.Context, req datasource.ReadRequ
119121
if auth0Client.Name == nil || auth0Client.ClientID == nil || auth0Client.Domain == nil {
120122
continue
121123
}
122-
if *auth0Client.Name == "NGPC CLI" {
124+
if *auth0Client.Name == auth0AppName {
123125
kubeconfigVars.OidcClientID = *auth0Client.ClientID
124126
kubeconfigVars.OidcIssuerURL = fmt.Sprintf("https://%s/", *auth0Client.Domain)
125127
}
126128
}
127129
if kubeconfigVars.OidcClientID == "" || kubeconfigVars.OidcIssuerURL == "" {
128-
resp.Diagnostics.AddError("Failed to get oidc client id or issuer url", "Please check if NGPC CLI client is created in Auth0")
130+
resp.Diagnostics.AddError("Failed to get oidc client id or issuer url", "Please check if client app is created in Auth0")
129131
return
130132
}
131133
kubeconfigVars.OrgID = os.Getenv("RXTSPOT_ORG_ID")

0 commit comments

Comments
 (0)