1
0
mirror of synced 2026-02-13 13:06:56 +00:00

Fix panic on reconcile with source of ExternalArtifact kind

Signed-off-by: Matheus Pimenta <matheuscscp@gmail.com>
This commit is contained in:
Matheus Pimenta
2025-11-17 13:28:22 +00:00
parent e95da82f5a
commit 69feb7214a
4 changed files with 47 additions and 33 deletions

View File

@@ -18,7 +18,6 @@ package main
import (
"github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1"
sourcev1 "github.com/fluxcd/source-controller/api/v1"
@@ -62,8 +61,8 @@ func (obj kustomizationAdapter) reconcileSource() bool {
return rksArgs.syncKsWithSource
}
func (obj kustomizationAdapter) getSource() (reconcileSource, types.NamespacedName) {
var cmd reconcileCommand
func (obj kustomizationAdapter) getSource() (reconcileSource, sourceReference) {
var cmd reconcileSource
switch obj.Spec.SourceRef.Kind {
case sourcev1.OCIRepositoryKind:
cmd = reconcileCommand{
@@ -82,9 +81,10 @@ func (obj kustomizationAdapter) getSource() (reconcileSource, types.NamespacedNa
}
}
return cmd, types.NamespacedName{
Name: obj.Spec.SourceRef.Name,
Namespace: obj.Spec.SourceRef.Namespace,
return cmd, sourceReference{
kind: obj.Spec.SourceRef.Kind,
name: obj.Spec.SourceRef.Name,
namespace: obj.Spec.SourceRef.Namespace,
}
}