Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.12 backports 2023-04-26 #25138

Merged
merged 2 commits into from Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 0 additions & 7 deletions jenkinsfiles/kubernetes-upstream.Jenkinsfile
Expand Up @@ -39,7 +39,6 @@ pipeline {
stage('Checkout') {
steps {
sh 'env'
Status("PENDING", "${env.JOB_NAME}")
checkout scm
sh 'mkdir -p ${PROJ_PATH}'
sh 'ls -A | grep -v src | xargs mv -t ${PROJ_PATH}'
Expand Down Expand Up @@ -129,11 +128,5 @@ pipeline {
cleanWs()
sh '/usr/local/bin/cleanup || true'
}
success {
Status("SUCCESS", "$JOB_BASE_NAME")
}
failure {
Status("FAILURE", "$JOB_BASE_NAME")
}
}
}
15 changes: 15 additions & 0 deletions pkg/bgp/speaker/pod_cidr.go
Expand Up @@ -27,12 +27,27 @@ type CidrSlice []string
// If a cidr cannot be parsed it is omitted from the array of Advertisements
// returned an an error is logged.
func (cs CidrSlice) ToAdvertisements() []*metallbbgp.Advertisement {
var (
l = log.WithFields(logrus.Fields{
"component": "CidrSlice.ToAdvertisements",
})
)

adverts := make([]*metallbbgp.Advertisement, 0, len(cs))
for _, c := range cs {
parsed, err := cidr.ParseCIDR(c)
if err != nil {
continue
}

// only advertise ipv4 addresses
if parsed.IP.To4() == nil {
// log error and continue
l.WithField("advertisement", parsed.IP.String()).
Error("cannot advertise non-v4 prefix")
continue
}

adverts = append(adverts, &metallbbgp.Advertisement{
Prefix: parsed.IPNet,
})
Expand Down