Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update v2 status #607

Merged
merged 3 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apis/datadoghq/v2alpha1/datadogagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,6 @@ type DatadogAgentStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:unservedversion
// +kubebuilder:resource:path=datadogagents,shortName=dd
// +kubebuilder:printcolumn:name="active",type="string",JSONPath=".status.conditions[?(@.type=='Active')].status"
// +kubebuilder:printcolumn:name="agent",type="string",JSONPath=".status.agent.status"
// +kubebuilder:printcolumn:name="cluster-agent",type="string",JSONPath=".status.clusterAgent.status"
// +kubebuilder:printcolumn:name="cluster-checks-runner",type="string",JSONPath=".status.clusterChecksRunner.status"
Expand Down
3 changes: 0 additions & 3 deletions config/crd/bases/v1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12663,9 +12663,6 @@ spec:
subresources:
status: {}
- additionalPrinterColumns:
- jsonPath: .status.conditions[?(@.type=='Active')].status
name: active
type: string
- jsonPath: .status.agent.status
name: agent
type: string
Expand Down
49 changes: 31 additions & 18 deletions config/crd/bases/v1beta1/datadoghq.com_datadogagents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,6 @@ metadata:
creationTimestamp: null
name: datadogagents.datadoghq.com
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=='Active')].status
name: active
type: string
- JSONPath: .status.agent.status
name: agent
type: string
- JSONPath: .status.clusterAgent.status
name: cluster-agent
type: string
- JSONPath: .status.clusterChecksRunner.status
name: cluster-checks-runner
type: string
- JSONPath: .metadata.creationTimestamp
name: age
type: date
group: datadoghq.com
names:
kind: DatadogAgent
Expand All @@ -36,7 +20,23 @@ spec:
status: {}
version: v1alpha1
versions:
- name: v1alpha1
- additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=='Active')].status
name: active
type: string
- JSONPath: .status.agent.status
name: agent
type: string
- JSONPath: .status.clusterAgent.status
name: cluster-agent
type: string
- JSONPath: .status.clusterChecksRunner.status
name: cluster-checks-runner
type: string
- JSONPath: .metadata.creationTimestamp
name: age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: DatadogAgent Deployment with Datadog Operator.
Expand Down Expand Up @@ -25566,7 +25566,20 @@ spec:
type: object
served: true
storage: true
- name: v2alpha1
- additionalPrinterColumns:
- JSONPath: .status.agent.status
name: agent
type: string
- JSONPath: .status.clusterAgent.status
name: cluster-agent
type: string
- JSONPath: .status.clusterChecksRunner.status
name: cluster-checks-runner
type: string
- JSONPath: .metadata.creationTimestamp
name: age
type: date
name: v2alpha1
schema:
openAPIV3Schema:
description: DatadogAgent Deployment with the Datadog Operator.
Expand Down
4 changes: 2 additions & 2 deletions controllers/datadogagent/controller_reconcile_v2_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ func (r *Reconciler) createOrUpdateDeployment(parentLogger logr.Logger, dda *dat
now := metav1.NewTime(time.Now())
err = kubernetes.UpdateFromObject(context.TODO(), r.client, updateDeployment, currentDeployment.ObjectMeta)
if err != nil {
updateStatusFunc(nil, newStatus, now, metav1.ConditionFalse, "CreateFailed", "Unable to Update Deployment")
updateStatusFunc(nil, newStatus, now, metav1.ConditionFalse, "UpdateFailed", "Unable to update Deployment")
celenechang marked this conversation as resolved.
Show resolved Hide resolved
return reconcile.Result{}, err
}
event := buildEventInfo(updateDeployment.Name, updateDeployment.Namespace, deploymentKind, datadog.UpdateEvent)
r.recordEvent(dda, event)
updateStatusFunc(updateDeployment, newStatus, now, metav1.ConditionTrue, "DeploymentUpdated", "Deployment updated")
updateStatusFunc(updateDeployment, newStatus, now, metav1.ConditionTrue, "UpdateSucceeded", "Deployment updated")
celenechang marked this conversation as resolved.
Show resolved Hide resolved
} else {
now := metav1.NewTime(time.Now())

Expand Down