@@ -23,6 +23,17 @@ import (
2323// Important: Run "make" to regenerate code after modifying this file
2424// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2525
26+ // WorkloadType defines the type of workload that can be patched
27+ // +kubebuilder:validation:Enum=Deployment;StatefulSet
28+ type WorkloadType string
29+
30+ const (
31+ // WorkloadTypeDeployment represents a Kubernetes Deployment
32+ WorkloadTypeDeployment WorkloadType = "Deployment"
33+ // WorkloadTypeStatefulSet represents a Kubernetes StatefulSet
34+ WorkloadTypeStatefulSet WorkloadType = "StatefulSet"
35+ )
36+
2637type InitContainer struct {
2738 // Name of the volume that will be added to pod
2839 SharedVolumeName string `json:"sharedVolumeName"`
@@ -38,8 +49,17 @@ type LightrunJavaAgentSpec struct {
3849 ContainerSelector []string `json:"containerSelector"`
3950 InitContainer InitContainer `json:"initContainer"`
4051
41- //Name of the Deployment that will be patched
42- DeploymentName string `json:"deploymentName"`
52+ // Name of the Deployment that will be patched. Deprecated, use WorkloadName and WorkloadType instead
53+ // +optional
54+ DeploymentName string `json:"deploymentName,omitempty"`
55+
56+ // Name of the Workload that will be patched. workload can be either Deployment or StatefulSet e.g. my-deployment, my-statefulset
57+ // +optional
58+ WorkloadName string `json:"workloadName,omitempty"`
59+
60+ // Type of the workload that will be patched supported values are Deployment, StatefulSet
61+ // +optional
62+ WorkloadType WorkloadType `json:"workloadType,omitempty"`
4363
4464 //Name of the Secret in the same namespace contains lightrun key and conmpany id
4565 SecretName string `json:"secretName"`
@@ -76,14 +96,16 @@ type LightrunJavaAgentSpec struct {
7696type LightrunJavaAgentStatus struct {
7797 LastScheduleTime * metav1.Time `json:"lastScheduleTime,omitempty"`
7898 Conditions []metav1.Condition `json:"conditions,omitempty"`
99+ WorkloadStatus string `json:"workloadStatus,omitempty"`
79100 DeploymentStatus string `json:"deploymentStatus,omitempty"`
80101}
81102
82103//+kubebuilder:object:root=true
83104//+kubebuilder:subresource:status
84105//+kubebuilder:resource:shortName=lrja
85- //+kubebuilder:printcolumn:priority=0,name=Deployment,type=string,JSONPath=".spec.deploymentName",description="Deployment name",format=""
86- //+kubebuilder:printcolumn:priority=0,name="Status",type=string,JSONPath=".status.deploymentStatus",description="Status of Deployment Reconciliation",format=""
106+ //+kubebuilder:printcolumn:priority=0,name=Workload,type=string,JSONPath=".spec.workloadName",description="Workload name",format=""
107+ //+kubebuilder:printcolumn:priority=0,name=Type,type=string,JSONPath=".spec.workloadType",description="Workload type",format=""
108+ //+kubebuilder:printcolumn:priority=0,name="Status",type=string,JSONPath=".status.workloadStatus",description="Status of Workload Reconciliation",format=""
87109//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
88110
89111// LightrunJavaAgent is the Schema for the lightrunjavaagents API
0 commit comments