diff --git a/api/go.mod b/api/go.mod index bf580aee3..7f7390402 100644 --- a/api/go.mod +++ b/api/go.mod @@ -5,7 +5,8 @@ go 1.26.0 require ( github.com/fluxcd/pkg/apis/acl v0.11.0 github.com/fluxcd/pkg/apis/meta v1.32.0 - k8s.io/apimachinery v0.37.0 + k8s.io/apiextensions-apiserver v0.37.1 + k8s.io/apimachinery v0.37.1 ) require ( diff --git a/api/go.sum b/api/go.sum index 930b4c31d..b25fba04f 100644 --- a/api/go.sum +++ b/api/go.sum @@ -46,8 +46,10 @@ gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.37.0 h1:Np2AbDtf8x6RDHiD8T9LbKJ9gaegeVNa8yNm5FuGKm0= -k8s.io/apimachinery v0.37.0/go.mod h1:RN3nhprFSCxOi5Selxd7oMTXOe/c+ZbcE7Im+TS2zkE= +k8s.io/apiextensions-apiserver v0.37.1 h1:7fIQG8eThDSTVYBWg/DOpI8v5wYfKCo0N8/TDMjj+zY= +k8s.io/apiextensions-apiserver v0.37.1/go.mod h1:1Q3ujWwHgnhBoGsdmGORflwK1sDFmuaqH1OsMDWk2Gs= +k8s.io/apimachinery v0.37.1 h1:hGCYyvKHCwtwMitj2vU4vYx0Z16N9GyZk9BBnz0wDAE= +k8s.io/apimachinery v0.37.1/go.mod h1:jF84AyUi/IRIXRot5f+lm6MpxoWI+F1XgjaMmwCdTFw= k8s.io/klog/v2 v2.140.0 h1:Tf+J3AH7xnUzZyVVXhTgGhEKnFqye14aadWv7bzXdzc= k8s.io/klog/v2 v2.140.0/go.mod h1:o+/RWfJ6PwpnFn7OyAG3QnO47BFsymfEfrz6XyYSSp0= k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad h1:oXImqH8mQNk7PmvzKhmN3ddJoY6OnyM225MXwGHPm0A= diff --git a/api/v1/externalartifact_types.go b/api/v1/externalartifact_types.go index 1acda5645..dcc116793 100644 --- a/api/v1/externalartifact_types.go +++ b/api/v1/externalartifact_types.go @@ -19,6 +19,7 @@ package v1 import ( "time" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/fluxcd/pkg/apis/meta" @@ -44,6 +45,12 @@ type ExternalArtifactStatus struct { // Conditions holds the conditions for the ExternalArtifact. // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` + + // ExportedInputs holds a map of structured data optionally extracted from the source resource. + // It may be used, for example, by downstream consumers such as templating engines like + // ResourceSet to consume these inputs for implementing templating logic. + // +optional + ExportedInputs map[string]*apiextensionsv1.JSON `json:"exportedInputs,omitempty"` } // GetConditions returns the status conditions of the object. diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index 3c9ea2a60..2ecc0eb7b 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -23,6 +23,7 @@ package v1 import ( "github.com/fluxcd/pkg/apis/acl" "github.com/fluxcd/pkg/apis/meta" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -284,6 +285,22 @@ func (in *ExternalArtifactStatus) DeepCopyInto(out *ExternalArtifactStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.ExportedInputs != nil { + in, out := &in.ExportedInputs, &out.ExportedInputs + *out = make(map[string]*apiextensionsv1.JSON, len(*in)) + for key, val := range *in { + var outVal *apiextensionsv1.JSON + if val == nil { + (*out)[key] = nil + } else { + inVal := (*in)[key] + in, out := &inVal, &outVal + *out = new(apiextensionsv1.JSON) + (*in).DeepCopyInto(*out) + } + (*out)[key] = outVal + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalArtifactStatus. diff --git a/config/crd/bases/source.toolkit.fluxcd.io_externalartifacts.yaml b/config/crd/bases/source.toolkit.fluxcd.io_externalartifacts.yaml index 499cf5280..dcc2ddae2 100644 --- a/config/crd/bases/source.toolkit.fluxcd.io_externalartifacts.yaml +++ b/config/crd/bases/source.toolkit.fluxcd.io_externalartifacts.yaml @@ -190,6 +190,14 @@ spec: - type type: object type: array + exportedInputs: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: |- + ExportedInputs holds a map of structured data optionally extracted from the source resource. + It may be used, for example, by downstream consumers such as templating engines like + ResourceSet to consume these inputs for implementing templating logic. + type: object type: object type: object served: true diff --git a/docs/api/v1/source.md b/docs/api/v1/source.md index de7f9a566..3fe0791b0 100644 --- a/docs/api/v1/source.md +++ b/docs/api/v1/source.md @@ -1918,6 +1918,20 @@ github.com/fluxcd/pkg/apis/meta.Artifact
Conditions holds the conditions for the ExternalArtifact.
+exportedInputsExportedInputs holds a map of structured data optionally extracted from the source resource. +It may be used, for example, by downstream consumers such as templating engines like +ResourceSet to consume these inputs for implementing templating logic.
+