Skip to content

Commit

Permalink
Merge pull request #93 from gardener/enh/conditions
Browse files Browse the repository at this point in the history
Added status.conditions attribute and condition type `Ready` for certificates
  • Loading branch information
mandelsoft authored Sep 20, 2021
2 parents 14b3be9 + 56841f4 commit 35ae366
Show file tree
Hide file tree
Showing 14 changed files with 739 additions and 804 deletions.
128 changes: 110 additions & 18 deletions charts/cert-management/templates/crds-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
controller-gen.kubebuilder.io/version: v0.4.1
labels:
helm.sh/chart: {{ include "cert-management.chart" . }}
app.kubernetes.io/name: {{ include "cert-management.name" . }}
Expand Down Expand Up @@ -270,10 +270,14 @@ spec:
description: Certificate is the certificate CR.
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
Expand All @@ -285,26 +289,33 @@ spec:
maxLength: 64
type: string
csr:
description: CSR is the alternative way to provide CN,DNSNames and other information.
description: CSR is the alternative way to provide CN,DNSNames and
other information.
format: byte
type: string
dnsNames:
description: DNSNames are the optional additional domain names of the certificate.
description: DNSNames are the optional additional domain names of
the certificate.
items:
type: string
type: array
ensureRenewedAfter:
description: EnsureRenewedAfter specifies a time stamp in the past. Renewing is only triggered if certificate notBefore date is before this date.
description: EnsureRenewedAfter specifies a time stamp in the past.
Renewing is only triggered if certificate notBefore date is before
this date.
format: date-time
type: string
issuerRef:
description: IssuerRef is the reference of the issuer to use.
properties:
name:
description: Name is the name of the issuer (in the configured issuer namespace on default cluster or namespace on target cluster as given).
description: Name is the name of the issuer (in the configured
issuer namespace on default cluster or namespace on target cluster
as given).
type: string
namespace:
description: Namespace is the namespace of the issuer, only needed if issuer is defined on target cluster
description: Namespace is the namespace of the issuer, only needed
if issuer is defined on target cluster
type: string
required:
- name
Expand All @@ -313,31 +324,38 @@ spec:
description: Renew triggers a renewal if set to true
type: boolean
secretName:
description: SecretName is the name of the secret object to use for storing the certificate.
description: SecretName is the name of the secret object to use for
storing the certificate.
type: string
secretRef:
description: SecretRef is the reference of the secret object to use for storing the certificate.
description: SecretRef is the reference of the secret object to use
for storing the certificate.
properties:
name:
description: Name is unique within a namespace to reference a secret resource.
description: Name is unique within a namespace to reference a
secret resource.
type: string
namespace:
description: Namespace defines the space within which the secret name must be unique.
description: Namespace defines the space within which the secret
name must be unique.
type: string
type: object
type: object
status:
description: CertificateStatus is the status of the certificate request.
properties:
backoff:
description: BackOff contains the state to back off failed certificate requests
description: BackOff contains the state to back off failed certificate
requests
properties:
observedGeneration:
description: ObservedGeneration is the observed generation the BackOffState is assigned to
description: ObservedGeneration is the observed generation the
BackOffState is assigned to
format: int64
type: integer
recheckAfter:
description: RetryAfter is the timestamp this cert request is not retried before.
description: RetryAfter is the timestamp this cert request is
not retried before.
format: date-time
type: string
recheckInterval:
Expand All @@ -350,6 +368,77 @@ spec:
commonName:
description: CommonName is the current CN.
type: string
conditions:
description: List of status conditions to indicate the status of certificates.
Known condition types are `Ready`.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
type FooStatus struct{ // Represents the observations of a
foo's current state. // Known .status.conditions.type are:
\"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type
\ // +patchStrategy=merge // +listType=map // +listMapKey=type
\ Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`
\n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating
details about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers
of specific condition types may define expected values and
meanings for this field, and whether the values are considered
a guaranteed API. The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
dnsNames:
description: DNSNames are the current domain names.
items:
Expand All @@ -362,7 +451,8 @@ spec:
description: IssuerRef is the used issuer.
properties:
cluster:
description: Cluster is the cluster name of the issuer ('default' or 'target'). optional because of backwards compatibility
description: Cluster is the cluster name of the issuer ('default'
or 'target'). optional because of backwards compatibility
type: string
name:
description: Name is the name of the issuer.
Expand All @@ -375,14 +465,16 @@ spec:
- namespace
type: object
lastPendingTimestamp:
description: LastPendingTimestamp contains the start timestamp of the last pending status.
description: LastPendingTimestamp contains the start timestamp of
the last pending status.
format: date-time
type: string
message:
description: Message is the status or error message.
type: string
observedGeneration:
description: ObservedGeneration is the observed generation of the spec.
description: ObservedGeneration is the observed generation of the
spec.
format: int64
type: integer
state:
Expand Down
83 changes: 79 additions & 4 deletions charts/cert-management/templates/crds-v1beta1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.9
controller-gen.kubebuilder.io/version: v0.4.1
labels:
helm.sh/chart: {{ include "cert-management.chart" . }}
app.kubernetes.io/name: {{ include "cert-management.name" . }}
Expand Down Expand Up @@ -315,10 +315,13 @@ spec:
description: IssuerRef is the reference of the issuer to use.
properties:
name:
description: Name is the name of the issuer (in the configured issuer namespace on default cluster or namespace on target cluster as given).
description: Name is the name of the issuer (in the configured issuer
namespace on default cluster or namespace on target cluster as
given).
type: string
namespace:
description: Namespace is the namespace of the issuer, only needed if issuer is defined on target cluster
description: Namespace is the namespace of the issuer, only needed
if issuer is defined on target cluster
type: string
required:
- name
Expand Down Expand Up @@ -371,6 +374,77 @@ spec:
commonName:
description: CommonName is the current CN.
type: string
conditions:
description: List of status conditions to indicate the status of certificates.
Known condition types are `Ready`.
items:
description: "Condition contains details for one aspect of the current
state of this API Resource. --- This struct is intended for direct
use as an array at the field path .status.conditions. For example,
type FooStatus struct{ // Represents the observations of a foo's
current state. // Known .status.conditions.type are: \"Available\",
\"Progressing\", and \"Degraded\" // +patchMergeKey=type //
+patchStrategy=merge // +listType=map // +listMapKey=type
\ Conditions []metav1.Condition `json:\"conditions,omitempty\"
patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`
\n // other fields }"
properties:
lastTransitionTime:
description: lastTransitionTime is the last time the condition
transitioned from one status to another. This should be when
the underlying condition changed. If that is not known, then
using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: message is a human readable message indicating details
about the transition. This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: observedGeneration represents the .metadata.generation
that the condition was set based upon. For instance, if .metadata.generation
is currently 12, but the .status.conditions[x].observedGeneration
is 9, the condition is out of date with respect to the current
state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: reason contains a programmatic identifier indicating
the reason for the condition's last transition. Producers of
specific condition types may define expected values and meanings
for this field, and whether the values are considered a guaranteed
API. The value should be a CamelCase string. This field may
not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
--- Many .condition.type values are consistent across resources
like Available, but because arbitrary conditions can be useful
(see .node.status.conditions), the ability to deconflict is
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
dnsNames:
description: DNSNames are the current domain names.
items:
Expand All @@ -383,7 +457,8 @@ spec:
description: IssuerRef is the used issuer.
properties:
cluster:
description: Cluster is the cluster name of the issuer ('default' or 'target'). optional because of backwards compatibility
description: Cluster is the cluster name of the issuer ('default'
or 'target'). optional because of backwards compatibility
type: string
name:
description: Name is the name of the issuer.
Expand Down
Loading

0 comments on commit 35ae366

Please sign in to comment.