2 Copyright 2019 Intel Corporation.
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software
8 distributed under the License is distributed on an "AS IS" BASIS,
9 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 See the License for the specific language governing permissions and
11 limitations under the License.
17 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21 //Initial indicates the initial status of CollectdPlugin
23 //Created indicates the status of CollectdPlugin after first reconcile
25 //Enabled indicates the status of CollectdPlugin after all the pods are reloaded
29 //Deprecated state when a plugin with same name is created. Old plugin gets deprecated and deleted eventually.
30 Deprecated = "Deprecated"
33 // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
34 // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
36 // CollectdPluginSpec defines the desired state of CollectdPlugin
37 // +k8s:openapi-gen=true
38 type CollectdPluginSpec struct {
39 // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
40 // Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
41 // Add custom validation using kubebuilder tags: https://book.kubebuilder.io/beyond_basics/generating_crd.html
42 PluginName string `json:"pluginName"`
43 PluginConf string `json:"pluginConf"`
46 // CollectdPluginStatus defines the observed state of CollectdPlugin
47 // +k8s:openapi-gen=true
48 type CollectdPluginStatus struct {
49 // CollectdAgents are the collectd pods in the Daemonset
50 // Status can be one of "", Created, Deleting, Applied, Deprecated
51 CollectdAgents []string `json:"collectdAgents,omitempty"`
52 Status string `json:"status"`
55 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
57 // CollectdPlugin is the Schema for the collectdplugins API
58 // +k8s:openapi-gen=true
59 // +kubebuilder:subresource:status
60 type CollectdPlugin struct {
61 metav1.TypeMeta `json:",inline"`
62 metav1.ObjectMeta `json:"metadata,omitempty"`
64 Spec CollectdPluginSpec `json:"spec,omitempty"`
65 Status CollectdPluginStatus `json:"status,omitempty"`
68 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
70 // CollectdPluginList contains a list of CollectdPlugin
71 type CollectdPluginList struct {
72 metav1.TypeMeta `json:",inline"`
73 metav1.ListMeta `json:"metadata,omitempty"`
74 Items []CollectdPlugin `json:"items"`
78 SchemeBuilder.Register(&CollectdPlugin{}, &CollectdPluginList{})