-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add EDS Support #591
Add EDS Support #591
Conversation
var result reconcile.Result | ||
var err error | ||
|
||
// Set DatadogAgent instance instance as the owner and controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Set DatadogAgent instance instance as the owner and controller | |
// Set DatadogAgent instance as the owner and controller |
return reconcile.Result{}, err | ||
} | ||
|
||
// From here the PodTemplateSpec should be ready, we can generate the hash that will be use to compare this extendeddaemonset with the current (if exist). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// From here the PodTemplateSpec should be ready, we can generate the hash that will be use to compare this extendeddaemonset with the current (if exist). | |
// From here the PodTemplateSpec should be ready, we can generate the hash that will be used to compare this extendeddaemonset with the current one (if it exists). |
} | ||
|
||
currentEDS := &edsv1alpha1.ExtendedDaemonSet{} | ||
alreadyExist := true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: alreadyExists
?
// check if same hash | ||
needUpdate := !comparison.IsSameSpecMD5Hash(hash, currentEDS.GetAnnotations()) | ||
if !needUpdate { | ||
// Even if the EDS is still the same, it's status might have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Even if the EDS is still the same, it's status might have | |
// Even if the EDS is still the same, its status might have |
now := metav1.NewTime(time.Now()) | ||
newStatus.Agent = datadoghqv2alpha1.UpdateExtendedDaemonSetStatus(currentEDS, newStatus.Agent, &now) | ||
|
||
// no need to update the EDS to stop here the process |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// no need to update the EDS to stop here the process | |
// Stop reconcile loop since EDS hasn't changed |
|
||
logger.Info("Updating ExtendedDaemonSet") | ||
|
||
// TODO: these parameter can be added to the override.PodTemplateSpec. (it exist in v1alpha) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: these parameter can be added to the override.PodTemplateSpec. (it exist in v1alpha) | |
// TODO: these parameters can be added to the override.PodTemplateSpec. (It exists in v1alpha1) |
} | ||
event := buildEventInfo(updateEDS.Name, updateEDS.Namespace, extendedDaemonSetKind, datadog.UpdateEvent) | ||
r.recordEvent(dda, event) | ||
updateStatusFunc(updateEDS, newStatus, now, metav1.ConditionTrue, "Extended_Daemonset_updated", "ExtendedDaemonSet updated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateStatusFunc(updateEDS, newStatus, now, metav1.ConditionTrue, "Extended_Daemonset_updated", "ExtendedDaemonSet updated") | |
updateStatusFunc(updateEDS, newStatus, now, metav1.ConditionTrue, "ExtendedDaemonSet_updated", "ExtendedDaemonSet updated") |
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some grammar suggestions, lgtm
What does this PR do?
Adds EDS support to v2 reconciler
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Describe your test plan
supportExtendedDaemonset
: example in helm templateskubectl label node <node> agent.datadoghq.com/component=agent agent.datadoghq.com/name=datadog