-
Notifications
You must be signed in to change notification settings - Fork 104
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
[cleanup] move some common constants to v2alpha1 #1432
Conversation
KubeletAgentCAPath = "/var/run/host-kubelet-ca.crt" | ||
KubeletCAVolumeName = "kubelet-ca" | ||
APMHostPortName = "traceport" | ||
// APMHostPortHostPort = 8126 // Not used |
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.
i didn't remove these because i don't want to forget to check for consistency when moving these constants
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.
Not directly related to this PR, but as part of this cleanup, should we possibly delete
datadog-operator/internal/controller/datadogagent/controller_reconcile_v2.go
Lines 56 to 74 in f2b6fb8
// check it the resource was properly decoded in v2 | |
// if not it means it was a v1 | |
/*if apiequality.Semantic.DeepEqual(instance.Spec, datadoghqv2alpha1.DatadogAgentSpec{}) { | |
instanceV1 := &datadoghqv1alpha1.DatadogAgent{} | |
if err = r.client.Get(ctx, request.NamespacedName, instanceV1); err != nil { | |
if apierrors.IsNotFound(err) { | |
// Request object not found, could have been deleted after reconcile request. | |
// Owned objects are automatically garbage collected. For additional cleanup logic use finalizers. | |
// Return and don't requeue | |
return result, nil | |
} | |
// Error reading the object - requeue the request.starting metrics server | |
return result, err | |
} | |
if err = datadoghqv1alpha1.ConvertTo(instanceV1, instance); err != nil { | |
reqLogger.Error(err, "unable to convert to v2alpha1") | |
return result, err | |
} | |
}*/ |
datadog-operator/internal/controller/datadogagent/controller_reconcile_v2.go
Lines 80 to 86 in f2b6fb8
// TODO check if IsValideDatadogAgent function is needed for v2 | |
/* | |
if err = datadoghqv2alpha1.IsValidDatadogAgent(&instance.Spec); err != nil { | |
reqLogger.V(1).Info("Invalid spec", "error", err) | |
return r.updateStatusIfNeeded(reqLogger, instance, &instance.Status, result, err) | |
} | |
*/ |
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.
good catch, thanks
// ExtendedDaemonset defaulting | ||
DefaultRollingUpdateMaxUnavailable = "10%" | ||
DefaultUpdateStrategy = appsv1.RollingUpdateDaemonSetStrategyType | ||
DefaultRollingUpdateMaxPodSchedulerFailure = "10%" | ||
DefaultRollingUpdateMaxParallelPodCreation int32 = 250 | ||
DefaultRollingUpdateSlowStartIntervalDuration = 1 * time.Minute | ||
DefaultRollingUpdateSlowStartAdditiveIncrease = "5" | ||
DefaultReconcileFrequency = 10 * time.Second |
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.
👏 Good catch, these were only used in Agent default v1alpha1
What does this PR do?
Move a subset of constants out of api/datadoghq/common/const.go and into api/datadoghq/v2alpha1/const.go
Motivation
Cleanup
Additional Notes
Anything else we should know when reviewing?
Minimum Agent Versions
Are there minimum versions of the Datadog Agent and/or Cluster Agent required?
Describe your test plan
The change is noop. Make sure the operator builds and runs as expected.
Checklist
bug
,enhancement
,refactoring
,documentation
,tooling
, and/ordependencies
qa/skip-qa
label