From ddef17cf678d00cecd6643e7ce67c0738cd1d56d Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sat, 2 May 2015 21:47:53 -0700 Subject: [PATCH] networking: load only *.conf files All files found in UserNetPath that don't match the suffix '.conf' will be ignored as a network configuration file. Fixes #859. --- networking/podenv.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/networking/podenv.go b/networking/podenv.go index af5e92f..d9cb170 100644 --- a/networking/podenv.go +++ b/networking/podenv.go @@ -25,6 +25,7 @@ import ( "path" "path/filepath" "sort" + "strings" "github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/cni/pkg/plugin" "github.com/coreos/rkt/Godeps/_workspace/src/github.com/appc/spec/schema/types" @@ -218,6 +219,11 @@ func loadUserNets() ([]activeNet, error) { for _, filename := range files { filepath := path.Join(UserNetPath, filename) + + if !strings.HasSuffix(filepath, ".conf") { + continue + } + n, err := loadNet(filepath) if err != nil { return nil, err