Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ resources:
- group: source
kind: OCIRepository
version: v1
- group: source
kind: ExternalArtifact
version: v1
version: "2"
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.0

require (
github.com/fluxcd/pkg/apis/acl v0.9.0
github.com/fluxcd/pkg/apis/meta v1.20.0
github.com/fluxcd/pkg/apis/meta v1.21.0
k8s.io/apimachinery v0.34.0
sigs.k8s.io/controller-runtime v0.22.0
)
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fluxcd/pkg/apis/acl v0.9.0 h1:wBpgsKT+jcyZEcM//OmZr9RiF8klL3ebrDp2u2ThsnA=
github.com/fluxcd/pkg/apis/acl v0.9.0/go.mod h1:TttNS+gocsGLwnvmgVi3/Yscwqrjc17+vhgYfqkfrV4=
github.com/fluxcd/pkg/apis/meta v1.20.0 h1:l9h0kWoDZTcYV0WJkFMgDXq6Q4tSojrJ+bHpFJSsaW0=
github.com/fluxcd/pkg/apis/meta v1.20.0/go.mod h1:XUAEUgT4gkWDAEN79E141tmL+v4SV50tVZ/Ojpc/ueg=
github.com/fluxcd/pkg/apis/meta v1.21.0 h1:R+bN02chcs0HUmyVDQhqe/FHmYLjipVDMLnyYfNX850=
github.com/fluxcd/pkg/apis/meta v1.21.0/go.mod h1:XUAEUgT4gkWDAEN79E141tmL+v4SV50tVZ/Ojpc/ueg=
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
Expand Down
93 changes: 0 additions & 93 deletions api/v1/artifact_types.go

This file was deleted.

4 changes: 2 additions & 2 deletions api/v1/bucket_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type BucketStatus struct {

// Artifact represents the last successful Bucket reconciliation.
// +optional
Artifact *Artifact `json:"artifact,omitempty"`
Artifact *meta.Artifact `json:"artifact,omitempty"`

// ObservedIgnore is the observed exclusion patterns used for constructing
// the source artifact.
Expand Down Expand Up @@ -245,7 +245,7 @@ func (in *Bucket) GetRequeueAfter() time.Duration {
}

// GetArtifact returns the latest artifact from the source if present in the status sub-resource.
func (in *Bucket) GetArtifact() *Artifact {
func (in *Bucket) GetArtifact() *meta.Artifact {
return in.Status.Artifact
}

Expand Down
70 changes: 70 additions & 0 deletions api/v1/externalartifact_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
Copyright 2025 The Flux authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/fluxcd/pkg/apis/meta"
)

// ExternalArtifactSpec defines the desired state of ExternalArtifact
type ExternalArtifactSpec struct {
// SourceRef points to the Kubernetes custom resource for
// which the artifact is generated.
// +optional
SourceRef *meta.NamespacedObjectKindReference `json:"sourceRef,omitempty"`
}

// ExternalArtifactStatus defines the observed state of ExternalArtifact
type ExternalArtifactStatus struct {
// Artifact represents the output of an ExternalArtifact reconciliation.
// +optional
Artifact *meta.Artifact `json:"artifact,omitempty"`

// Conditions holds the conditions for the ExternalArtifact.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description=""
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].status",description=""
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[?(@.type==\"Ready\")].message",description=""
// +kubebuilder:printcolumn:name="Source",type="string",JSONPath=".spec.sourceRef.name",description=""

// ExternalArtifact is the Schema for the external artifacts API
type ExternalArtifact struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ExternalArtifactSpec `json:"spec,omitempty"`
Status ExternalArtifactStatus `json:"status,omitempty"`
}

// ExternalArtifactList contains a list of ExternalArtifact
// +kubebuilder:object:root=true
type ExternalArtifactList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ExternalArtifact `json:"items"`
}

func init() {
SchemeBuilder.Register(&ExternalArtifact{}, &ExternalArtifactList{})
}
6 changes: 3 additions & 3 deletions api/v1/gitrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,12 @@ type GitRepositoryStatus struct {

// Artifact represents the last successful GitRepository reconciliation.
// +optional
Artifact *Artifact `json:"artifact,omitempty"`
Artifact *meta.Artifact `json:"artifact,omitempty"`

// IncludedArtifacts contains a list of the last successfully included
// Artifacts as instructed by GitRepositorySpec.Include.
// +optional
IncludedArtifacts []*Artifact `json:"includedArtifacts,omitempty"`
IncludedArtifacts []*meta.Artifact `json:"includedArtifacts,omitempty"`

// ObservedIgnore is the observed exclusion patterns used for constructing
// the source artifact.
Expand Down Expand Up @@ -319,7 +319,7 @@ func (in GitRepository) GetRequeueAfter() time.Duration {

// GetArtifact returns the latest Artifact from the GitRepository if present in
// the status sub-resource.
func (in *GitRepository) GetArtifact() *Artifact {
func (in *GitRepository) GetArtifact() *meta.Artifact {
return in.Status.Artifact
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1/helmchart_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ type HelmChartStatus struct {

// Artifact represents the output of the last successful reconciliation.
// +optional
Artifact *Artifact `json:"artifact,omitempty"`
Artifact *meta.Artifact `json:"artifact,omitempty"`

meta.ReconcileRequestStatus `json:",inline"`
}
Expand Down Expand Up @@ -182,7 +182,7 @@ func (in HelmChart) GetRequeueAfter() time.Duration {

// GetArtifact returns the latest artifact from the source if present in the
// status sub-resource.
func (in *HelmChart) GetArtifact() *Artifact {
func (in *HelmChart) GetArtifact() *meta.Artifact {
return in.Status.Artifact
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1/helmrepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type HelmRepositoryStatus struct {

// Artifact represents the last successful HelmRepository reconciliation.
// +optional
Artifact *Artifact `json:"artifact,omitempty"`
Artifact *meta.Artifact `json:"artifact,omitempty"`

meta.ReconcileRequestStatus `json:",inline"`
}
Expand Down Expand Up @@ -191,7 +191,7 @@ func (in HelmRepository) GetTimeout() time.Duration {

// GetArtifact returns the latest artifact from the source if present in the
// status sub-resource.
func (in *HelmRepository) GetArtifact() *Artifact {
func (in *HelmRepository) GetArtifact() *meta.Artifact {
return in.Status.Artifact
}

Expand Down
4 changes: 2 additions & 2 deletions api/v1/ocirepository_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ type OCIRepositoryStatus struct {

// Artifact represents the output of the last successful OCI Repository sync.
// +optional
Artifact *Artifact `json:"artifact,omitempty"`
Artifact *meta.Artifact `json:"artifact,omitempty"`

// ObservedIgnore is the observed exclusion patterns used for constructing
// the source artifact.
Expand Down Expand Up @@ -241,7 +241,7 @@ func (in OCIRepository) GetRequeueAfter() time.Duration {

// GetArtifact returns the latest Artifact from the OCIRepository if present in
// the status sub-resource.
func (in *OCIRepository) GetArtifact() *Artifact {
func (in *OCIRepository) GetArtifact() *meta.Artifact {
return in.Status.Artifact
}

Expand Down
4 changes: 3 additions & 1 deletion api/v1/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import (
"time"

"k8s.io/apimachinery/pkg/runtime"

"github.com/fluxcd/pkg/apis/meta"
)

const (
Expand All @@ -41,5 +43,5 @@ type Source interface {
GetRequeueAfter() time.Duration
// GetArtifact returns the latest artifact from the source if present in
// the status sub-resource.
GetArtifact() *Artifact
GetArtifact() *meta.Artifact
}
Loading