Skip to content

HTTP/HTTPS file target generates errors and does not work #1431

Closed

Description

@Synehan

Describe the bug
When using file target with http (or https) path, Cloudprober return an error

Cloudprober Version
v0.14.5

To Reproduce
Steps to reproduce the behavior:

  1. Create a probe with file_target target and an http endpoint.
probe {
    name: "all-endpoints"
    type: HTTP

    additional_label {
        key: "cluster"
        value: "@target.label.dc@"
    }

    targets {
        file_targets {
            file_path: "https://raw.githubusercontent.com/cloudprober/cloudprober/refs/heads/main/examples/targets/file/targets.textpb"
            re_eval_sec: 300
        }
    }
}
  1. Launch cloudprober et look at the logs.
level=ERROR source=internal/rds/file/file.go:257 msg="file(https://raw.githubusercontent.com/cloudprober/cloudprober/refs/heads/main/examples/targets/file/targets.textpb): error while reading file: Get \"raw.githubusercontent.com/cloudprober/cloudprober/refs/heads/main/examples/targets/file/targets.textpb\": unsupported protocol scheme \"\"" system=cloudprober probe=all-endpoints

Additional context
Problem is caused by the strip of the schema for all file remote file type (s3/gcs/http/https). This ok for gcs and s3 as the result is use as the objectPath but http does not work. The golang lib net/http need the scheme to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions