Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3532 from stevekuznetsov/skuznets/backport-revoca…
…tion OCPBUGS-29303: release-4.15: revocation controller backport
- Loading branch information
Showing
118 changed files
with
36,857 additions
and
1,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
api/certificates/v1alpha1/certificaterevocationrequest_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +genclient | ||
// +kubebuilder:resource:path=certificaterevocationrequests,shortName=crr;crrs,scope=Namespaced | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:storageversion | ||
|
||
// CertificateRevocationRequest defines the desired state of CertificateRevocationRequest. | ||
// A request denotes the user's desire to revoke a signer certificate of the class indicated in spec. | ||
type CertificateRevocationRequest struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec CertificateRevocationRequestSpec `json:"spec,omitempty"` | ||
Status CertificateRevocationRequestStatus `json:"status,omitempty"` | ||
} | ||
|
||
// CertificateRevocationRequestSpec defines the desired state of CertificateRevocationRequest | ||
type CertificateRevocationRequestSpec struct { | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:Enum=customer-break-glass | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="signerClass is immutable" | ||
|
||
// SignerClass identifies the class of signer to revoke. All the active signing CAs for the | ||
// signer class will be revoked. | ||
SignerClass string `json:"signerClass"` | ||
} | ||
|
||
const ( | ||
SignerClassValidType string = "SignerClassValid" | ||
SignerClassUnknownReason string = "SignerClassUnknown" | ||
|
||
RootCertificatesRegeneratedType string = "RootCertificatesRegenerated" | ||
RootCertificatesStaleReason string = "RootCertificatesStale" | ||
|
||
LeafCertificatesRegeneratedType string = "LeafCertificatesRegenerated" | ||
LeafCertificatesStaleReason string = "LeafCertificatesStale" | ||
|
||
NewCertificatesTrustedType = "NewCertificatesTrusted" | ||
PreviousCertificatesRevokedType = "PreviousCertificatesRevoked" | ||
) | ||
|
||
// CertificateRevocationRequestStatus defines the observed state of CertificateRevocationRequest | ||
type CertificateRevocationRequestStatus struct { | ||
// +optional | ||
|
||
// RevocationTimestamp is the cut-off time for signing CAs to be revoked. All certificates that | ||
// are valid before this time will be revoked; all re-generated certificates will not be valid | ||
// at or before this time. | ||
RevocationTimestamp *metav1.Time `json:"revocationTimestamp,omitempty"` | ||
|
||
// +optional | ||
|
||
// PreviousSigner stores a reference to the previous signer certificate. We require | ||
// storing this data to ensure that we can validate that the old signer is no longer | ||
// valid before considering revocation complete. | ||
PreviousSigner *corev1.LocalObjectReference `json:"previousSigner,omitempty"` | ||
|
||
// +optional | ||
// +listType=map | ||
// +listMapKey=type | ||
// +patchMergeKey=type | ||
// +patchStrategy=merge | ||
|
||
// Conditions contain details about the various aspects of certificate revocation. | ||
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// CertificateRevocationRequestList contains a list of CertificateRevocationRequest. | ||
type CertificateRevocationRequestList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []CertificateRevocationRequest `json:"items"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.