Try fix issuer

[ZITADOPER-1]
This commit is contained in:
Haim Kortovich
2024-05-08 16:55:23 -05:00
parent 5603d4449f
commit 666200ead9

View File

@@ -362,7 +362,7 @@ func (r *ZitadelClusterReconciler) reconcileDefaultInstance(ctx context.Context,
} }
ztdClient, err := system.NewClient(GetIssuer(zitadel), GetAPI(zitadel), system.JWTProfileFromKey([]byte(privateKeyData), masterkey.OwnerName), system.WithInsecure()) ztdClient, err := system.NewClient(GetIssuer(zitadel), GetAPI(zitadel), system.JWTProfileFromKey([]byte(privateKeyData), masterkey.OwnerName), system.WithInsecure())
if err != nil { if err != nil {
return ctrl.Result{}, err return ctrl.Result{}, fmt.Errorf("Error creating sytem client: %v", err)
} }
defer ztdClient.Connection.Close() defer ztdClient.Connection.Close()
@@ -426,11 +426,7 @@ func (r *ZitadelClusterReconciler) reconcileDefaultInstance(ctx context.Context,
} }
func GetIssuer(zitadel *zitadelv1alpha1.ZitadelCluster) string { func GetIssuer(zitadel *zitadelv1alpha1.ZitadelCluster) string {
scheme := "http" return "k8s-operator"
if zitadel.Spec.ExternalSecure {
scheme = "https"
}
return fmt.Sprintf("%s://%s:%d", scheme, zitadel.Spec.Host, zitadel.Spec.ExternalPort)
} }
func GetAPI(zitadel *zitadelv1alpha1.ZitadelCluster) string { func GetAPI(zitadel *zitadelv1alpha1.ZitadelCluster) string {