You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1beta2/imagepolicy_types.go
+95-6Lines changed: 95 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
Copyright 2022 The Flux authors
2
+
Copyright 2023 The Flux authors
3
3
4
4
Licensed under the Apache License, Version 2.0 (the "License");
5
5
you may not use this file except in compliance with the License.
@@ -17,17 +17,21 @@ limitations under the License.
17
17
package v1beta2
18
18
19
19
import (
20
+
"time"
21
+
20
22
"github.com/fluxcd/pkg/apis/meta"
21
23
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
22
24
)
23
25
24
26
constImagePolicyKind="ImagePolicy"
25
27
26
28
// Deprecated: Use ImageFinalizer.
27
-
constImagePolicyFinalizer="finalizers.fluxcd.io"
29
+
constImagePolicyFinalizer=ImageFinalizer
28
30
29
31
// ImagePolicySpec defines the parameters for calculating the
30
32
// ImagePolicy.
33
+
// +kubebuilder:validation:XValidation:rule="!has(self.interval) || (has(self.digestReflectionPolicy) && self.digestReflectionPolicy == 'Always')", message="spec.interval is only accepted when spec.digestReflectionPolicy is set to 'Always'"
34
+
// +kubebuilder:validation:XValidation:rule="has(self.interval) || !has(self.digestReflectionPolicy) || self.digestReflectionPolicy != 'Always'", message="spec.interval must be set when spec.digestReflectionPolicy is set to 'Always'"
31
35
typeImagePolicySpecstruct {
32
36
// ImageRepositoryRef points at the object specifying the image
33
37
// being scanned
@@ -42,8 +46,46 @@ type ImagePolicySpec struct {
42
46
// ordered and compared.
43
47
// +optional
44
48
FilterTags*TagFilter`json:"filterTags,omitempty"`
49
+
// DigestReflectionPolicy governs the setting of the `.status.latestRef.digest` field.
50
+
//
51
+
// Never: The digest field will always be set to the empty string.
52
+
//
53
+
// IfNotPresent: The digest field will be set to the digest of the elected
54
+
// latest image if the field is empty and the image did not change.
55
+
//
56
+
// Always: The digest field will always be set to the digest of the elected
0 commit comments