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=========================================================
31 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
35 SchemeBuilder.Register(&CertServiceIssuer{}, &CertServiceIssuerList{})
38 // CertServiceIssuerSpec defines the desired state of CertServiceIssuer
39 type CertServiceIssuerSpec struct {
40 // URL is the base URL for the CertService certificates instance.
41 URL string `json:"url"`
43 // KeyRef is a reference to a Secret containing the provisioner
44 // password used to decrypt the provisioner private key.
45 KeyRef SecretKeySelector `json:"keyRef"`
48 // CertServiceIssuerStatus defines the observed state of CertServiceIssuer
49 type CertServiceIssuerStatus struct {
50 // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
51 // Important: Run "make" to regenerate code after modifying this file
54 Conditions []CertServiceIssuerCondition `json:"conditions,omitempty"`
57 // +kubebuilder:object:root=true
59 // CertServiceIssuer is the Schema for the certserviceissuers API
60 // +kubebuilder:subresource:status
61 type CertServiceIssuer struct {
62 metav1.TypeMeta `json:",inline"`
63 metav1.ObjectMeta `json:"metadata,omitempty"`
65 Spec CertServiceIssuerSpec `json:"spec,omitempty"`
66 Status CertServiceIssuerStatus `json:"status,omitempty"`
69 // +kubebuilder:object:root=true
71 // CertServiceIssuerList contains a list of CertServiceIssuer
72 type CertServiceIssuerList struct {
73 metav1.TypeMeta `json:",inline"`
74 metav1.ListMeta `json:"metadata,omitempty"`
75 Items []CertServiceIssuer `json:"items"`
78 // SecretKeySelector contains the reference to a secret.
79 type SecretKeySelector struct {
80 // The name of the secret in the pod's namespace to select from.
81 Name string `json:"name"`
83 // The key of the secret to select from. Must be a valid secret key.
85 Key string `json:"key,omitempty"`
88 // ConditionType represents a CertServiceIssuer condition type.
89 // +kubebuilder:validation:Enum=Ready
90 type ConditionType string
93 // ConditionReady indicates that a CertServiceIssuer is ready for use.
94 ConditionReady ConditionType = "Ready"
97 // ConditionStatus represents a condition's status.
98 // +kubebuilder:validation:Enum=True;False;Unknown
99 type ConditionStatus string
101 // These are valid condition statuses. "ConditionTrue" means a resource is in
102 // the condition; "ConditionFalse" means a resource is not in the condition;
103 // "ConditionUnknown" means kubernetes can't decide if a resource is in the
104 // condition or not. In the future, we could add other intermediate
105 // conditions, e.g. ConditionDegraded.
107 // ConditionTrue represents the fact that a given condition is true
108 ConditionTrue ConditionStatus = "True"
110 // ConditionFalse represents the fact that a given condition is false
111 ConditionFalse ConditionStatus = "False"
113 // ConditionUnknown represents the fact that a given condition is unknown
114 ConditionUnknown ConditionStatus = "Unknown"
117 // CertServiceIssuerCondition contains condition information for the CertService issuer.
118 type CertServiceIssuerCondition struct {
119 // Type of the condition, currently ('Ready').
120 Type ConditionType `json:"type"`
122 // Status of the condition, one of ('True', 'False', 'Unknown').
123 // +kubebuilder:validation:Enum=True;False;Unknown
124 Status ConditionStatus `json:"status"`
126 // LastTransitionTime is the timestamp corresponding to the last status
127 // change of this condition.
129 LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"`
131 // Reason is a brief machine readable explanation for the condition's last
134 Reason string `json:"reason,omitempty"`
136 // Message is a human readable description of the details of the last
137 // transition, complementing reason.
139 Message string `json:"message,omitempty"`