fix name and null pointer
All checks were successful
Build and Publish / build-release (push) Successful in 2m0s
All checks were successful
Build and Publish / build-release (push) Successful in 2m0s
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user