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

DDA w/operator component cleanups and improvements #1251

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions components/datadog/apps/dda/datadogagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ func K8sAppDefinition(e config.Env, kubeProvider *kubernetes.Provider, namespace
}

ddaRef, err := componentskube.NewKubernetesObjRef(e, baseName, namespace, "DatadogAgent", pulumi.String("").ToStringOutput(), pulumi.String("datadoghq.com/v2alpha1").ToStringOutput(), map[string]string{"app": baseName})
if err != nil {
return nil, nil, err
}

return k8sComponent, ddaRef, nil
}
Expand Down
2 changes: 1 addition & 1 deletion components/datadog/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// OperatorOutput is used to import the Operator component
type OperatorOutput struct {
type OperatorOutput struct { // nolint:revive, We want to keep the name as <Component>Output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the lint error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was getting this lint error:

Error: components/datadog/operator/component.go:11:6: exported: type name will be used as operator.OperatorOutput by other packages, and that stutters; consider calling this Output (revive)
  type OperatorOutput struct {

components.JSONImporter
Operator compkubernetes.KubernetesObjectRef `json:"operator"`
}
Expand Down
4 changes: 2 additions & 2 deletions components/kubernetes/kubernetes_object_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/DataDog/test-infra-definitions/components"
)

type KubernetesObjRefOutput struct {
type KubernetesObjRefOutput struct { // nolint:revive, We want to keep the name as <Component>Output
components.JSONImporter

Namespace string `json:"namespace"`
Expand All @@ -18,7 +18,7 @@ type KubernetesObjRefOutput struct {
LabelSelectors map[string]string `json:"labelSelectors"`
}

type KubernetesObjectRef struct {
type KubernetesObjectRef struct { // nolint:revive, We want to keep the name as <Component>Output
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ question
What is revive complaining about here? The comment seems to be a copy paste from above that does not fit here

pulumi.ResourceState
components.Component

Expand Down