add apiapps
All checks were successful
Build and Publish / build-release (push) Successful in 3m53s

This commit is contained in:
2026-05-04 13:32:59 -05:00
parent 4605cf9f65
commit 15bc5b2125
12 changed files with 381 additions and 337 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"`
}