2 * ============LICENSE_START=======================================================
3 * oom-certservice-k8s-external-provider
4 * ================================================================================
5 * Copyright (c) 2019 Smallstep Labs, Inc.
6 * Modifications copyright (C) 2020 Nokia. All rights reserved.
7 * ================================================================================
8 * This source code was copied from the following git repository:
9 * https://github.com/smallstep/step-issuer
10 * The source code was modified for usage in the ONAP project.
11 * ================================================================================
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
16 * http://www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 * ============LICENSE_END=========================================================
29 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
33 SchemeBuilder.Register(&CertServiceIssuer{}, &CertServiceIssuerList{})
36 // CertServiceIssuerSpec defines the desired state of CertServiceIssuer
37 type CertServiceIssuerSpec struct {
38 // URL is the base URL for the CertService certificates instance.
39 URL string `json:"url"`
41 // KeyRef is a reference to a Secret containing the provisioner
42 // password used to decrypt the provisioner private key.
43 KeyRef SecretKeySelector `json:"keyRef"`
46 // CertServiceIssuerStatus defines the observed state of CertServiceIssuer
47 type CertServiceIssuerStatus struct {
48 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
49 // Important: Run "make" to regenerate code after modifying this file
52 Conditions []CertServiceIssuerCondition `json:"conditions,omitempty"`
55 // +kubebuilder:object:root=true
57 // CertServiceIssuer is the Schema for the certserviceissuers API
58 // +kubebuilder:subresource:status
59 type CertServiceIssuer struct {
60 metav1.TypeMeta `json:",inline"`
61 metav1.ObjectMeta `json:"metadata,omitempty"`
63 Spec CertServiceIssuerSpec `json:"spec,omitempty"`
64 Status CertServiceIssuerStatus `json:"status,omitempty"`
67 // +kubebuilder:object:root=true
69 // CertServiceIssuerList contains a list of CertServiceIssuer
70 type CertServiceIssuerList struct {
71 metav1.TypeMeta `json:",inline"`
72 metav1.ListMeta `json:"metadata,omitempty"`
73 Items []CertServiceIssuer `json:"items"`
76 // SecretKeySelector contains the reference to a secret.
77 type SecretKeySelector struct {
78 // The name of the secret in the pod's namespace to select from.
79 Name string `json:"name"`
81 // The key of the secret to select from. Must be a valid secret key.
83 Key string `json:"key,omitempty"`
86 // ConditionType represents a CertServiceIssuer condition type.
87 // +kubebuilder:validation:Enum=Ready
88 type ConditionType string
91 // ConditionReady indicates that a CertServiceIssuer is ready for use.
92 ConditionReady ConditionType = "Ready"
95 // ConditionStatus represents a condition's status.
96 // +kubebuilder:validation:Enum=True;False;Unknown
97 type ConditionStatus string
99 // These are valid condition statuses. "ConditionTrue" means a resource is in
100 // the condition; "ConditionFalse" means a resource is not in the condition;
101 // "ConditionUnknown" means kubernetes can't decide if a resource is in the
102 // condition or not. In the future, we could add other intermediate
103 // conditions, e.g. ConditionDegraded.
105 // ConditionTrue represents the fact that a given condition is true
106 ConditionTrue ConditionStatus = "True"
108 // ConditionFalse represents the fact that a given condition is false
109 ConditionFalse ConditionStatus = "False"
111 // ConditionUnknown represents the fact that a given condition is unknown
112 ConditionUnknown ConditionStatus = "Unknown"
115 // CertServiceIssuerCondition contains condition information for the CertService issuer.
116 type CertServiceIssuerCondition struct {
117 // Type of the condition, currently ('Ready').
118 Type ConditionType `json:"type"`
120 // Status of the condition, one of ('True', 'False', 'Unknown').
121 // +kubebuilder:validation:Enum=True;False;Unknown
122 Status ConditionStatus `json:"status"`
124 // LastTransitionTime is the timestamp corresponding to the last status
125 // change of this condition.
127 LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
129 // Reason is a brief machine readable explanation for the condition's last
132 Reason string `json:"reason,omitempty"`
134 // Message is a human readable description of the details of the last
135 // transition, complementing reason.
137 Message string `json:"message,omitempty"`