Skip to content

Commit 231bee7

Browse files
committed
rename types that were too generic
1 parent bfa868a commit 231bee7

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

config/v1/types_cluster_image_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type ClusterImagePolicySpec struct {
5252
// policy is a required field that contains configuration to allow scopes to be verified, and defines how
5353
// images not matching the verification policy will be treated.
5454
// +required
55-
Policy Policy `json:"policy"`
55+
Policy ImageSigstoreVerificationPolicy `json:"policy"`
5656
}
5757

5858
// +k8s:deepcopy-gen=true

config/v1/types_image_policy.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type ImagePolicySpec struct {
5151
// policy is a required field that contains configuration to allow scopes to be verified, and defines how
5252
// images not matching the verification policy will be treated.
5353
// +required
54-
Policy Policy `json:"policy"`
54+
Policy ImageSigstoreVerificationPolicy `json:"policy"`
5555
}
5656

5757
// +kubebuilder:validation:XValidation:rule="size(self.split('/')[0].split('.')) == 1 ? self.split('/')[0].split('.')[0].split(':')[0] == 'localhost' : true",message="invalid image scope format, scope must contain a fully qualified domain name or 'localhost'"
@@ -60,8 +60,8 @@ type ImagePolicySpec struct {
6060
// +kubebuilder:validation:MaxLength=512
6161
type ImageScope string
6262

63-
// Policy defines the verification policy for the items in the scopes list.
64-
type Policy struct {
63+
// ImageSigstoreVerificationPolicy defines the verification policy for the items in the scopes list.
64+
type ImageSigstoreVerificationPolicy struct {
6565
// rootOfTrust is a required field that defines the root of trust for verifying image signatures during retrieval.
6666
// This allows image consumers to specify policyType and corresponding configuration of the policy, matching how the policy was generated.
6767
// +required
@@ -89,18 +89,18 @@ type PolicyRootOfTrust struct {
8989
// publicKey defines the root of trust configuration based on a sigstore public key. Optionally include a Rekor public key for Rekor verification.
9090
// publicKey is required when policyType is PublicKey, and forbidden otherwise.
9191
// +optional
92-
PublicKey *PublicKey `json:"publicKey,omitempty"`
92+
PublicKey *ImagePolicyPublicKeyRootOfTrust `json:"publicKey,omitempty"`
9393
// fulcioCAWithRekor defines the root of trust configuration based on the Fulcio certificate and the Rekor public key.
9494
// fulcioCAWithRekor is required when policyType is FulcioCAWithRekor, and forbidden otherwise
9595
// For more information about Fulcio and Rekor, please refer to the document at:
9696
// https://github.com/sigstore/fulcio and https://github.com/sigstore/rekor
9797
// +optional
98-
FulcioCAWithRekor *FulcioCAWithRekor `json:"fulcioCAWithRekor,omitempty"`
98+
FulcioCAWithRekor *ImagePolicyFulcioCAWithRekorRootOfTrust `json:"fulcioCAWithRekor,omitempty"`
9999
// pki defines the root of trust configuration based on Bring Your Own Public Key Infrastructure (BYOPKI) Root CA(s) and corresponding intermediate certificates.
100100
// pki is required when policyType is PKI, and forbidden otherwise.
101101
// +optional
102102
// +openshift:enable:FeatureGate=SigstoreImageVerificationPKI
103-
PKI *PKI `json:"pki,omitempty"`
103+
PKI *ImagePolicyPKIRootOfTrust `json:"pki,omitempty"`
104104
}
105105

106106
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=PublicKey;FulcioCAWithRekor
@@ -113,8 +113,8 @@ const (
113113
PKIRootOfTrust PolicyType = "PKI"
114114
)
115115

116-
// PublicKey defines the root of trust based on a sigstore public key.
117-
type PublicKey struct {
116+
// ImagePolicyPublicKeyRootOfTrust defines the root of trust based on a sigstore public key.
117+
type ImagePolicyPublicKeyRootOfTrust struct {
118118
// keyData is a required field contains inline base64-encoded data for the PEM format public key.
119119
// keyData must be at most 8192 characters.
120120
// +required
@@ -132,8 +132,8 @@ type PublicKey struct {
132132
RekorKeyData []byte `json:"rekorKeyData,omitempty"`
133133
}
134134

135-
// FulcioCAWithRekor defines the root of trust based on the Fulcio certificate and the Rekor public key.
136-
type FulcioCAWithRekor struct {
135+
// ImagePolicyFulcioCAWithRekorRootOfTrust defines the root of trust based on the Fulcio certificate and the Rekor public key.
136+
type ImagePolicyFulcioCAWithRekorRootOfTrust struct {
137137
// fulcioCAData is a required field contains inline base64-encoded data for the PEM format fulcio CA.
138138
// fulcioCAData must be at most 8192 characters.
139139
// +required
@@ -172,8 +172,8 @@ type PolicyFulcioSubject struct {
172172
SignedEmail string `json:"signedEmail"`
173173
}
174174

175-
// PKI defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
176-
type PKI struct {
175+
// ImagePolicyPKIRootOfTrust defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
176+
type ImagePolicyPKIRootOfTrust struct {
177177
// caRootsData contains base64-encoded data of a certificate bundle PEM file, which contains one or more CA roots in the PEM format. The total length of the data must not exceed 8192 characters.
178178
// +required
179179
// +kubebuilder:validation:MaxLength=8192

config/v1alpha1/types_cluster_image_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type ClusterImagePolicySpec struct {
5151
// policy contains configuration to allow scopes to be verified, and defines how
5252
// images not matching the verification policy will be treated.
5353
// +required
54-
Policy Policy `json:"policy"`
54+
Policy ImageSigstoreVerificationPolicy `json:"policy"`
5555
}
5656

5757
// +k8s:deepcopy-gen=true

config/v1alpha1/types_image_policy.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type ImagePolicySpec struct {
5050
// policy contains configuration to allow scopes to be verified, and defines how
5151
// images not matching the verification policy will be treated.
5252
// +required
53-
Policy Policy `json:"policy"`
53+
Policy ImageSigstoreVerificationPolicy `json:"policy"`
5454
}
5555

5656
// +kubebuilder:validation:XValidation:rule="size(self.split('/')[0].split('.')) == 1 ? self.split('/')[0].split('.')[0].split(':')[0] == 'localhost' : true",message="invalid image scope format, scope must contain a fully qualified domain name or 'localhost'"
@@ -59,8 +59,8 @@ type ImagePolicySpec struct {
5959
// +kubebuilder:validation:MaxLength=512
6060
type ImageScope string
6161

62-
// Policy defines the verification policy for the items in the scopes list.
63-
type Policy struct {
62+
// ImageSigstoreVerificationPolicy defines the verification policy for the items in the scopes list.
63+
type ImageSigstoreVerificationPolicy struct {
6464
// rootOfTrust specifies the root of trust for the policy.
6565
// +required
6666
RootOfTrust PolicyRootOfTrust `json:"rootOfTrust"`
@@ -84,16 +84,16 @@ type PolicyRootOfTrust struct {
8484
PolicyType PolicyType `json:"policyType"`
8585
// publicKey defines the root of trust based on a sigstore public key.
8686
// +optional
87-
PublicKey *PublicKey `json:"publicKey,omitempty"`
87+
PublicKey *ImagePolicyPublicKeyRootOfTrust `json:"publicKey,omitempty"`
8888
// fulcioCAWithRekor defines the root of trust based on the Fulcio certificate and the Rekor public key.
8989
// For more information about Fulcio and Rekor, please refer to the document at:
9090
// https://github.com/sigstore/fulcio and https://github.com/sigstore/rekor
9191
// +optional
92-
FulcioCAWithRekor *FulcioCAWithRekor `json:"fulcioCAWithRekor,omitempty"`
92+
FulcioCAWithRekor *ImagePolicyFulcioCAWithRekorRootOfTrust `json:"fulcioCAWithRekor,omitempty"`
9393
// pki defines the root of trust based on Bring Your Own Public Key Infrastructure (BYOPKI) Root CA(s) and corresponding intermediate certificates.
9494
// +optional
9595
// +openshift:enable:FeatureGate=SigstoreImageVerificationPKI
96-
PKI *PKI `json:"pki,omitempty"`
96+
PKI *ImagePolicyPKIRootOfTrust `json:"pki,omitempty"`
9797
}
9898

9999
// +openshift:validation:FeatureGateAwareEnum:featureGate="",enum=PublicKey;FulcioCAWithRekor
@@ -106,8 +106,8 @@ const (
106106
PKIRootOfTrust PolicyType = "PKI"
107107
)
108108

109-
// PublicKey defines the root of trust based on a sigstore public key.
110-
type PublicKey struct {
109+
// ImagePolicyPublicKeyRootOfTrust defines the root of trust based on a sigstore public key.
110+
type ImagePolicyPublicKeyRootOfTrust struct {
111111
// keyData contains inline base64-encoded data for the PEM format public key.
112112
// KeyData must be at most 8192 characters.
113113
// +required
@@ -120,8 +120,8 @@ type PublicKey struct {
120120
RekorKeyData []byte `json:"rekorKeyData,omitempty"`
121121
}
122122

123-
// FulcioCAWithRekor defines the root of trust based on the Fulcio certificate and the Rekor public key.
124-
type FulcioCAWithRekor struct {
123+
// ImagePolicyFulcioCAWithRekorRootOfTrust defines the root of trust based on the Fulcio certificate and the Rekor public key.
124+
type ImagePolicyFulcioCAWithRekorRootOfTrust struct {
125125
// fulcioCAData contains inline base64-encoded data for the PEM format fulcio CA.
126126
// fulcioCAData must be at most 8192 characters.
127127
// +required
@@ -151,8 +151,8 @@ type PolicyFulcioSubject struct {
151151
SignedEmail string `json:"signedEmail"`
152152
}
153153

154-
// PKI defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
155-
type PKI struct {
154+
// ImagePolicyPKIRootOfTrust defines the root of trust based on Root CA(s) and corresponding intermediate certificates.
155+
type ImagePolicyPKIRootOfTrust struct {
156156
// caRootsData contains base64-encoded data of a certificate bundle PEM file, which contains one or more CA roots in the PEM format. The total length of the data must not exceed 8192 characters.
157157
// +required
158158
// +kubebuilder:validation:MaxLength=8192

0 commit comments

Comments
 (0)