This commit is contained in:
@@ -32,6 +32,7 @@ type APIAppSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
// Important: Run "make" to regenerate code after modifying this file
|
||||
ProjectRef ProjectRef `json:"projectRef"`
|
||||
APIAppName string `json:"apiAppName"`
|
||||
// +kubebuilder:validation:Enum=API_AUTH_METHOD_TYPE_BASIC;API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT
|
||||
AuthMethodType string `json:"authMethodType"`
|
||||
}
|
||||
@@ -43,12 +44,9 @@ type APIAppStatus struct {
|
||||
// +optional
|
||||
// +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
|
||||
Conditions []metav1.Condition `json:"conditions,omitempty"`
|
||||
// +kubebuilder:default=""
|
||||
AppId string `json:"appId"`
|
||||
// +kubebuilder:default=""
|
||||
KeyId string `json:"keyId"`
|
||||
// +kubebuilder:default=""
|
||||
ClientId string `json:"clientId"`
|
||||
AppId *string `json:"appId,omitempty"`
|
||||
ClientId *string `json:"clientId,omitempty"`
|
||||
KeyId *string `json:"keyId,omitempty"`
|
||||
}
|
||||
|
||||
func (d *APIAppStatus) SetCondition(condition metav1.Condition) {
|
||||
@@ -120,6 +118,14 @@ func (d *APIApp) Project(ctx context.Context, refresolver *RefResolver) (*Resolv
|
||||
return refresolver.ResolveProject(ctx, &d.Spec.ProjectRef, d.Namespace)
|
||||
}
|
||||
|
||||
func (d *APIApp) ClientSecretName() string {
|
||||
return d.Name + "-client-secret"
|
||||
}
|
||||
|
||||
func (d *APIApp) PrivateKeySecretName() string {
|
||||
return d.Name + "-privatekey-secret"
|
||||
}
|
||||
|
||||
//+kubebuilder:object:root=true
|
||||
|
||||
// APIAppList contains a list of APIApp
|
||||
|
||||
@@ -18,7 +18,6 @@ package v1alpha1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
@@ -97,7 +96,6 @@ func (d *Project) IsReady() bool {
|
||||
}
|
||||
|
||||
func (d *Project) ConnectionRef(ctx context.Context, refresolver *RefResolver) (*ConnectionRef, error) {
|
||||
fmt.Println(d.Spec.OrganizationRef)
|
||||
// Check if using direct Zitadel ID reference
|
||||
if d.Spec.OrganizationRef.ID != "" {
|
||||
return &d.Spec.OrganizationRef.ConnectionRef, nil
|
||||
|
||||
@@ -27,11 +27,11 @@ type OrganizationRef struct {
|
||||
// +kubebuilder:validation:XValidation:rule="has(self.name) || has(self.id)",message="must provide either k8s object reference (name) or zitadel ID reference (id)"
|
||||
// +kubebuilder:validation:XValidation:rule="!has(self.id) || has(self.connectionRef.name)",message="zitadel ID reference requires connectionRef.name"
|
||||
type ProjectRef struct {
|
||||
ObjectReference corev1.ObjectReference `json:",inline"`
|
||||
ID string `json:"id,omitempty"`
|
||||
ConnectionRef ConnectionRef `json:"connectionRef,omitempty"`
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
ID string `json:"id,omitempty"`
|
||||
ConnectionRef ConnectionRef `json:"connectionRef,omitempty"`
|
||||
}
|
||||
|
||||
type ActionRef struct {
|
||||
ObjectReference corev1.ObjectReference `json:",inline"`
|
||||
corev1.ObjectReference `json:",inline"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user