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

Bypass FQDN resolution in darwin tests #1296

Merged
merged 2 commits into from
Oct 23, 2023
Merged

Conversation

c-kruse
Copy link
Contributor

@c-kruse c-kruse commented Oct 23, 2023

Adds a hack to work around issue #1295

@c-kruse c-kruse requested a review from a team as a code owner October 23, 2023 19:11
@github-actions github-actions bot added the go label Oct 23, 2023
Copy link
Collaborator

@echlebek echlebek left a comment

Choose a reason for hiding this comment

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

dirty

@@ -986,10 +986,13 @@ func addClientCredentials(req *http.Request, credentials accessCredentials) {
req.Header.Add("Authorization", authHeaderValue)
}

// TODO(ck): hostname allows the darwin tests to bypass fqdn.
var hostname = fqdn.FqdnHostname

// getHostname returns the host name consistently with the resource detection processor's defaults
// TODO: try to dynamically extract this from the resource processor in the pipeline
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to do what this comment says? i.e extract the hostname from the resource processor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I'd be surprised if extensions had a way to get processor state like that. I also doubt that'd be a productive way to go at least as far as tests are concerned. (i.e. setting up an entire pipeline with the resource detection processor configured to not use os instead of dns.)

Side note, I wager that processor has the same issue (when configured with dns)

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that solution would assume that we'd be using the resource processor in the pipeline like below.

service:
  extensions:
    - sumologic
  pipelines:
    logs:
      receivers: 
        - tcplog
      processors:
        - resource

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rnishtala-sumo you okay with kicking this can down the road? Maybe noting that option in #1295

Copy link
Contributor

Choose a reason for hiding this comment

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

yes thats fine

@c-kruse c-kruse enabled auto-merge (squash) October 23, 2023 21:39
@c-kruse c-kruse merged commit 6e31f8c into main Oct 23, 2023
27 checks passed
@c-kruse c-kruse deleted the ck/bypass-fqdn-in-tests branch October 23, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants