Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion operator/internal/handlers/internal/storage/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var (
errS3EndpointNoURL = errors.New("endpoint for S3 must be an HTTP or HTTPS URL")
errS3EndpointUnsupportedScheme = errors.New("scheme of S3 endpoint URL is unsupported")
errS3EndpointAWSInvalid = errors.New("endpoint for AWS S3 must include correct region")
errS3ForcePathStyleInvalid = errors.New("force_path_style must be true or false")

errGCPParseCredentialsFile = errors.New("gcp storage secret cannot be parsed from JSON content")
errGCPWrongCredentialSourceFile = errors.New("credential source in secret needs to point to token file")
Expand Down Expand Up @@ -414,10 +415,14 @@ func extractS3ConfigSecret(s *corev1.Secret, credentialMode lokiv1.CredentialMod
)

// Determine if we should use path style URLs for S3
// default to false if for non-AWS endpoints
// default to false for non-AWS endpoints
forcePathStyle := !strings.HasSuffix(string(endpoint), awsEndpointSuffix)
// Check if the user has specified force_path_style
if configForcePathStyle, ok := s.Data[storage.KeyAWSForcePathStyle]; ok {
strForcePathStyle := string(configForcePathStyle)
if strForcePathStyle != "true" && strForcePathStyle != "false" {
return nil, fmt.Errorf("%w: %s", errS3ForcePathStyleInvalid, storage.KeyAWSForcePathStyle)
}
forcePathStyle = string(configForcePathStyle) == "true"
}

Expand Down