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
|
// +optional
|
||||||
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
|
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
|
||||||
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
||||||
AppId *string `json:"appId"`
|
AppId *string `json:"appId,omitempty"`
|
||||||
ClientId *string `json:"clientId,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)
|
return fmt.Errorf("Error listing OIDCApps: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(appList.Applications)
|
|
||||||
|
|
||||||
if len(appList.Applications) > 0 {
|
if len(appList.Applications) > 0 {
|
||||||
appid = &appList.Applications[0].ApplicationId
|
appid = &appList.Applications[0].ApplicationId
|
||||||
clientid = &appList.Applications[0].GetOidcConfiguration().ClientId
|
clientid = &appList.Applications[0].GetOidcConfiguration().ClientId
|
||||||
@@ -154,7 +152,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl
|
|||||||
if appid == nil {
|
if appid == nil {
|
||||||
resp, err := ztdClient.ApplicationServiceV2().CreateApplication(ctx,
|
resp, err := ztdClient.ApplicationServiceV2().CreateApplication(ctx,
|
||||||
&application.CreateApplicationRequest{
|
&application.CreateApplicationRequest{
|
||||||
Name: wr.OIDCApp.Name,
|
Name: wr.OIDCApp.Spec.OIDCAppName,
|
||||||
ProjectId: *project.Status.ProjectId,
|
ProjectId: *project.Status.ProjectId,
|
||||||
ApplicationType: &application.CreateApplicationRequest_OidcConfiguration{
|
ApplicationType: &application.CreateApplicationRequest_OidcConfiguration{
|
||||||
OidcConfiguration: &application.CreateOIDCApplicationRequest{
|
OidcConfiguration: &application.CreateOIDCApplicationRequest{
|
||||||
@@ -192,7 +190,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl
|
|||||||
Namespace: wr.OIDCApp.Namespace,
|
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)
|
secret, err := wr.Builder.BuildSecret(builder.SecretOpts{Immutable: false, Key: key, Data: secretData}, wr.OIDCApp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error building Secret: %v", err)
|
return fmt.Errorf("error building Secret: %v", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user