chore: build fix and generate display name

This commit is contained in:
fedorHub 2025-08-27 11:52:17 +02:00
parent 68723d5feb
commit 616858e46c
No known key found for this signature in database
GPG Key ID: 7FDE5B4177850E7D
3 changed files with 10 additions and 3 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@ -37,11 +37,15 @@ jobs:
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch,enable=true
type=ref,event=tag,enable=true
type=ref,event=tag
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha,format=short
- name: Build and push Docker image
uses: docker/build-push-action@v6

View File

@ -123,8 +123,11 @@ func (p *Peer) ApplyInterfaceDefaults(in *Interface) {
}
func (p *Peer) GenerateDisplayName(prefix string) {
if p.DisplayName != "" {
return
}
if prefix != "" {
prefix = fmt.Sprintf("%s ", strings.TrimSpace(prefix)) // add a space after the prefix
prefix = fmt.Sprintf("%s ", strings.TrimSpace(prefix))
}
p.DisplayName = fmt.Sprintf("%sPeer %s", prefix, internal.TruncateString(string(p.Identifier), 8))
}