Skip to content

Commit e7e750d

Browse files
authored
Merge pull request #1581 from dgageot/alias-url
Support aliases to urls
2 parents dc6a502 + 50e603f commit e7e750d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pkg/config/resolve.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ func ResolveSources(agentsPath string) (Sources, error) {
109109
// Resolve resolves an agent file reference (local file, URL, or OCI image) to a source
110110
// For OCI references, always checks remote for updates but falls back to local cache if offline
111111
func Resolve(agentFilename string) (Source, error) {
112-
// Handle URL references first (before resolve() which converts to absolute path)
113-
if IsURLReference(agentFilename) {
114-
return NewURLSource(agentFilename), nil
115-
}
116-
117112
resolvedPath, err := resolve(agentFilename)
118113
if err != nil {
119114
if IsOCIReference(agentFilename) {
@@ -125,9 +120,15 @@ func Resolve(agentFilename string) (Source, error) {
125120
if resolvedPath == "default" {
126121
return NewBytesSource(resolvedPath, defaultAgent), nil
127122
}
123+
124+
if IsURLReference(resolvedPath) {
125+
return NewURLSource(resolvedPath), nil
126+
}
127+
128128
if isLocalFile(resolvedPath) {
129129
return NewFileSource(resolvedPath), nil
130130
}
131+
131132
return NewOCISource(resolvedPath), nil
132133
}
133134

0 commit comments

Comments
 (0)