1 /* 2 Copyright 2023 The Flux authors 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package v1 18 19 import ( 20 "time" 21 22 "k8s.io/apimachinery/pkg/runtime" 23 ) 24 25 const ( 26 // SourceIndexKey is the key used for indexing objects based on their 27 // referenced Source. 28 SourceIndexKey string = ".metadata.source" 29 ) 30 31 // Source interface must be supported by all API types. 32 // Source is the interface that provides generic access to the Artifact and 33 // interval. It must be supported by all kinds of the source.toolkit.fluxcd.io 34 // API group. 35 // 36 // +k8s:deepcopy-gen=false 37 type Source interface { 38 runtime.Object 39 // GetRequeueAfter returns the duration after which the source must be 40 // reconciled again. 41 GetRequeueAfter() time.Duration 42 // GetArtifact returns the latest artifact from the source if present in 43 // the status sub-resource. 44 GetArtifact() *Artifact 45 } 46