Skip to content

Commit

Permalink
Merge pull request #1142 from s1061123/fix/1130
Browse files Browse the repository at this point in the history
fix multus config file generation to avoid self-delegation
  • Loading branch information
dougbtv committed Aug 16, 2023
2 parents 8d8aa80 + 159f261 commit c5a0002
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/thin_entrypoint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,17 @@ func (o *Options) createMultusConfig() (string, error) {
return "", fmt.Errorf("cannot find master CNI config in %q: %v", o.MultusAutoconfigDir, err)
}

masterConfigPath := files[0]
masterConfigPath := ""
for _, filename := range files {
if !strings.HasPrefix(filepath.Base(filename), "00-multus.conf") {
masterConfigPath = filename
break
}
}
if masterConfigPath == "" {
return "", fmt.Errorf("cannot find valid master CNI config in %q", o.MultusAutoconfigDir)
}

masterConfigBytes, err := os.ReadFile(masterConfigPath)
if err != nil {
return "", fmt.Errorf("cannot read master CNI config file %q: %v", masterConfigPath, err)
Expand Down

0 comments on commit c5a0002

Please sign in to comment.