fix name and null pointer
All checks were successful
Build and Publish / build-release (push) Successful in 2m0s

This commit is contained in:
2026-04-20 12:48:13 -05:00
parent 2074605dd9
commit a3a6208ab5
2 changed files with 3 additions and 5 deletions

View File

@@ -67,7 +67,7 @@ type OIDCAppStatus struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
Conditions []metav1.Condition `json:"conditions,omitempty"`
AppId *string `json:"appId"`
AppId *string `json:"appId,omitempty"`
ClientId *string `json:"clientId,omitempty"`
}

View File

@@ -144,8 +144,6 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl
return fmt.Errorf("Error listing OIDCApps: %v", err)
}
fmt.Println(appList.Applications)
if len(appList.Applications) > 0 {
appid = &appList.Applications[0].ApplicationId
clientid = &appList.Applications[0].GetOidcConfiguration().ClientId
@@ -154,7 +152,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl
if appid == nil {
resp, err := ztdClient.ApplicationServiceV2().CreateApplication(ctx,
&application.CreateApplicationRequest{
Name: wr.OIDCApp.Name,
Name: wr.OIDCApp.Spec.OIDCAppName,
ProjectId: *project.Status.ProjectId,
ApplicationType: &application.CreateApplicationRequest_OidcConfiguration{
OidcConfiguration: &application.CreateOIDCApplicationRequest{
@@ -192,7 +190,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl
Namespace: wr.OIDCApp.Namespace,
}
secretData := map[string][]byte{"clientSecret": []byte(resp.GetApiConfiguration().ClientSecret), "appId": []byte(resp.ApplicationId), "clientId": []byte(resp.GetOidcConfiguration().ClientId)}
secretData := map[string][]byte{"clientSecret": []byte(resp.GetOidcConfiguration().ClientSecret), "appId": []byte(resp.ApplicationId), "clientId": []byte(resp.GetOidcConfiguration().ClientId)}
secret, err := wr.Builder.BuildSecret(builder.SecretOpts{Immutable: false, Key: key, Data: secretData}, wr.OIDCApp)
if err != nil {
return fmt.Errorf("error building Secret: %v", err)