Skip to content

Commit

Permalink
Fix license heander
Browse files Browse the repository at this point in the history
  • Loading branch information
zarvd committed Oct 3, 2024
1 parent 5b783ae commit 919239c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
20 changes: 20 additions & 0 deletions pkg/provider/loadbalancer/iputil/internal/prefix.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package internal

import (
"net/netip"
)

// ListAddresses returns all IP addresses contained within the given prefixes.
// Note: This function is not optimized for large address ranges.
// It may consume significant memory and perform poorly when listing
// a large number of addresses. Use with caution on large prefixes.
func ListAddresses(prefixes ...netip.Prefix) []netip.Addr {
var rv []netip.Addr
for _, p := range prefixes {
Expand Down
16 changes: 16 additions & 0 deletions pkg/provider/loadbalancer/iputil/internal/prefix_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package internal

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/provider/loadbalancer/iputil/internal/prefixtree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ import (
"fmt"
"math"
"net/netip"
"sigs.k8s.io/cloud-provider-azure/pkg/provider/loadbalancer/fnutil"
"sort"
"testing"

"github.com/stretchr/testify/assert"

"sigs.k8s.io/cloud-provider-azure/pkg/provider/loadbalancer/fnutil"
)

func Test_bitAt(t *testing.T) {
Expand Down

0 comments on commit 919239c

Please sign in to comment.