Release URBM 2026.06.15.r012
This commit is contained in:
@@ -26,7 +26,6 @@ func ValidateConfig(c Config) error {
|
||||
repos[repo.ID] = repo
|
||||
}
|
||||
jobs := make(map[string]struct{}, len(c.Jobs))
|
||||
repositoryOwners := make(map[string]string, len(c.Jobs))
|
||||
for _, job := range c.Jobs {
|
||||
if err := ValidateJob(job); err != nil {
|
||||
return fmt.Errorf("job %q: %w", job.ID, err)
|
||||
@@ -38,10 +37,6 @@ func ValidateConfig(c Config) error {
|
||||
if _, exists := repos[job.RepositoryID]; !exists {
|
||||
return fmt.Errorf("job %q references unknown repository %q", job.ID, job.RepositoryID)
|
||||
}
|
||||
if owner, exists := repositoryOwners[job.RepositoryID]; exists {
|
||||
return fmt.Errorf("repository %q is already assigned to job %q", job.RepositoryID, owner)
|
||||
}
|
||||
repositoryOwners[job.RepositoryID] = job.ID
|
||||
}
|
||||
notifications := make(map[string]struct{}, len(c.Notifications))
|
||||
for _, target := range c.Notifications {
|
||||
|
||||
@@ -46,15 +46,15 @@ func TestRepositoryIsolation(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRepositoryCannotBeSharedByJobs(t *testing.T) {
|
||||
func TestRepositoryCanBeSharedByJobs(t *testing.T) {
|
||||
c := DefaultConfig()
|
||||
c.Repositories = []Repository{{SchemaVersion: 1, ID: "repo", Name: "Local", Type: RepositoryLocal, Location: "/tmp/repo", PasswordRef: "password"}}
|
||||
base := Job{SchemaVersion: 1, Name: "Flash", Type: JobFlash, RepositoryID: "repo", Consistency: Consistency{Mode: "live"}, Compression: "auto"}
|
||||
base := Job{SchemaVersion: 1, Name: "Flash", Type: JobFlash, RepositoryID: "repo", Consistency: Consistency{Mode: "live"}, Compression: "auto", Retention: Retention{KeepWithinDays: 30}}
|
||||
first, second := base, base
|
||||
first.ID, second.ID = "first", "second"
|
||||
c.Jobs = []Job{first, second}
|
||||
if err := ValidateConfig(c); err == nil {
|
||||
t.Fatal("shared repository accepted")
|
||||
if err := ValidateConfig(c); err != nil {
|
||||
t.Fatalf("shared repository rejected: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user