Skip to content

Commit 6925261

Browse files
authored
Cleanup IPAM usage in the util package (#177)
* Cleanup IPAM usage in the util package IPAM was planned to be used in SMF. Specially it was useful when multiple SMF instances need to acquire IP address and this module helps to avoid the duplicate assignment. But long term having IP address allocation at UPF is best strategy as it helps in distributing ip address assigmne to multiple endpoints and this reduces the burden at SMF. This is first step in simplifying the implementation. Signed-off-by: Ajay Lotan Thakur <[email protected]> * Remove dbtestApp as its not used Keeping code simple - way to success ! Signed-off-by: Ajay Lotan Thakur <[email protected]> --------- Signed-off-by: Ajay Lotan Thakur <[email protected]>
1 parent 23c472a commit 6925261

File tree

25 files changed

+3
-2101
lines changed

25 files changed

+3
-2101
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,10 @@
55
version: 2
66
updates:
77

8-
- package-ecosystem: "docker"
9-
directory: "/mongoapi/dbtestapp/"
10-
schedule:
11-
interval: "weekly"
12-
day: "wednesday"
13-
time: "21:00"
14-
timezone: "America/Los_Angeles"
15-
168
- package-ecosystem: "gomod"
179
directory: "/"
1810
schedule:
1911
interval: "weekly"
2012
day: "wednesday"
2113
time: "21:00"
2214
timezone: "America/Los_Angeles"
23-
24-
- package-ecosystem: "gomod"
25-
directory: "/mongoapi/dbtestapp"
26-
schedule:
27-
interval: "weekly"
28-
day: "wednesday"
29-
time: "21:00"
30-
timezone: "America/Los_Angeles"

.github/workflows/main.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ jobs:
1515
with:
1616
branch_name: ${{ github.ref }}
1717

18-
build-dbtestapp:
19-
uses: omec-project/.github/.github/workflows/build.yml@main
20-
with:
21-
branch_name: ${{ github.ref }}
22-
build_directory: mongoapi/dbtestapp
23-
24-
docker-build-dbtestapp:
25-
uses: omec-project/.github/.github/workflows/docker-build.yml@main
26-
with:
27-
branch_name: ${{ github.ref }}
28-
build_directory: mongoapi/dbtestapp
29-
3018
static-analysis:
3119
uses: omec-project/.github/.github/workflows/static-analysis.yml@main
3220
with:
@@ -37,12 +25,6 @@ jobs:
3725
with:
3826
branch_name: ${{ github.ref }}
3927

40-
# lint-dbtestapp:
41-
# uses: omec-project/.github/.github/workflows/lint.yml@main
42-
# with:
43-
# branch_name: ${{ github.ref }}
44-
# build_directory: ./mongoapi/dbtestapp
45-
4628
license-check:
4729
uses: omec-project/.github/.github/workflows/license-check.yml@main
4830
with:

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.2-dev
1+
1.5.0

drsm/api.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ type DrsmInterface interface {
4242
AllocateInt32ID() (int32, error)
4343
ReleaseInt32ID(id int32) error
4444
FindOwnerInt32ID(id int32) (*PodId, error)
45-
AcquireIp(pool string) (string, error)
46-
ReleaseIp(pool, ip string) error
47-
CreateIpPool(poolName string, ipPool string) error
48-
DeleteIpPool(poolName string) error
4945
DeletePod(string)
5046
}
5147

@@ -125,29 +121,3 @@ func (d *Drsm) FindOwnerInt32ID(id int32) (*PodId, error) {
125121
logger.DrsmLog.Errorf("failed to find POD owner for Id - %v ", id)
126122
return nil, fmt.Errorf("unknown Id")
127123
}
128-
129-
func (d *Drsm) AcquireIp(pool string) (string, error) {
130-
if d.mode == ResourceDemux {
131-
logger.DrsmLog.Errorln("demux mode can not allocate Ip")
132-
return "", fmt.Errorf("demux mode does not allow Resource allocation")
133-
}
134-
return d.acquireIp(pool)
135-
}
136-
137-
func (d *Drsm) ReleaseIp(pool, ip string) error {
138-
if d.mode == ResourceDemux {
139-
logger.DrsmLog.Errorln("demux mode can not Release Resource")
140-
return fmt.Errorf("demux mode does not allow Resource Release")
141-
}
142-
return d.releaseIp(pool, ip)
143-
}
144-
145-
func (d *Drsm) CreateIpPool(poolName string, ipPool string) error {
146-
err := d.initIpPool(poolName, ipPool)
147-
return err
148-
}
149-
150-
func (d *Drsm) DeleteIpPool(poolName string) error {
151-
err := d.deleteIpPool(poolName)
152-
return err
153-
}

drsm/drsm.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99

1010
"github.com/omec-project/util/logger"
1111
MongoDBLibrary "github.com/omec-project/util/mongoapi"
12-
ipam "github.com/thakurajayL/go-ipam"
1312
"go.mongodb.org/mongo-driver/bson"
1413
)
1514

@@ -54,8 +53,6 @@ type Drsm struct {
5453
scanChunks map[int32]*chunk
5554
chunkIdRange int32
5655
resourceValidCb func(int32) bool
57-
ipModule ipam.Ipamer
58-
prefix map[string]*ipam.Prefix
5956
mongo *MongoDBLibrary.MongoClient
6057
globalChunkTblMutex sync.Mutex
6158
}
@@ -85,7 +82,6 @@ func (d *Drsm) ConstuctDrsm(opt *Options) {
8582
d.podDown = make(chan string, 10)
8683
d.scanChunks = make(map[int32]*chunk)
8784
d.globalChunkTblMutex = sync.Mutex{}
88-
d.initIpam(opt)
8985

9086
// connect to DB
9187
d.mongo, _ = MongoDBLibrary.NewMongoClient(d.db.Url, d.db.Name)

drsm/ipam.go

Lines changed: 0 additions & 92 deletions
This file was deleted.

go.mod

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,51 @@ require (
1010
github.com/pkg/errors v0.9.1
1111
github.com/smartystreets/goconvey v1.8.1
1212
github.com/stretchr/testify v1.10.0
13-
github.com/thakurajayL/go-ipam v0.0.5-dev
1413
go.mongodb.org/mongo-driver v1.17.4
1514
go.uber.org/zap v1.27.0
1615
golang.org/x/crypto v0.40.0
1716
golang.org/x/net v0.42.0
1817
)
1918

2019
require (
21-
github.com/avast/retry-go/v4 v4.1.0 // indirect
2220
github.com/bytedance/sonic v1.11.6 // indirect
2321
github.com/bytedance/sonic/loader v0.1.1 // indirect
24-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
2522
github.com/cloudwego/base64x v0.1.4 // indirect
2623
github.com/cloudwego/iasm v0.2.0 // indirect
27-
github.com/coreos/go-semver v0.3.0 // indirect
28-
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
2924
github.com/davecgh/go-spew v1.1.1 // indirect
30-
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
3125
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
3226
github.com/gin-contrib/sse v0.1.0 // indirect
3327
github.com/go-playground/locales v0.14.1 // indirect
3428
github.com/go-playground/universal-translator v0.18.1 // indirect
3529
github.com/go-playground/validator/v10 v10.20.0 // indirect
36-
github.com/go-redis/redis/v8 v8.11.5 // indirect
3730
github.com/goccy/go-json v0.10.2 // indirect
38-
github.com/gogo/protobuf v1.3.2 // indirect
39-
github.com/golang/protobuf v1.5.3 // indirect
4031
github.com/golang/snappy v0.0.4 // indirect
4132
github.com/gopherjs/gopherjs v1.17.2 // indirect
42-
github.com/jmoiron/sqlx v1.3.5 // indirect
4333
github.com/json-iterator/go v1.1.12 // indirect
4434
github.com/jtolds/gls v4.20.0+incompatible // indirect
4535
github.com/klauspost/compress v1.16.7 // indirect
4636
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
37+
github.com/kr/pretty v0.1.0 // indirect
4738
github.com/leodido/go-urn v1.4.0 // indirect
48-
github.com/lib/pq v1.10.6 // indirect
4939
github.com/mattn/go-isatty v0.0.20 // indirect
5040
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5141
github.com/modern-go/reflect2 v1.0.2 // indirect
5242
github.com/montanaflynn/stats v0.7.1 // indirect
5343
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
5444
github.com/pmezard/go-difflib v1.0.0 // indirect
55-
github.com/sirupsen/logrus v1.9.3 // indirect
5645
github.com/smarty/assertions v1.15.0 // indirect
5746
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
5847
github.com/ugorji/go/codec v1.2.12 // indirect
5948
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
6049
github.com/xdg-go/scram v1.1.2 // indirect
6150
github.com/xdg-go/stringprep v1.0.4 // indirect
6251
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
63-
go.etcd.io/etcd/api/v3 v3.5.4 // indirect
64-
go.etcd.io/etcd/client/pkg/v3 v3.5.4 // indirect
65-
go.etcd.io/etcd/client/v3 v3.5.4 // indirect
6652
go.uber.org/multierr v1.10.0 // indirect
67-
go4.org/intern v0.0.0-20220617035311-6925f38cc365 // indirect
68-
go4.org/unsafe/assume-no-moving-gc v0.0.0-20220617031537-928513b29760 // indirect
6953
golang.org/x/arch v0.8.0 // indirect
7054
golang.org/x/sync v0.16.0 // indirect
7155
golang.org/x/sys v0.34.0 // indirect
7256
golang.org/x/text v0.27.0 // indirect
73-
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
74-
google.golang.org/grpc v1.56.3 // indirect
7557
google.golang.org/protobuf v1.34.1 // indirect
58+
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
7659
gopkg.in/yaml.v3 v3.0.1 // indirect
77-
inet.af/netaddr v0.0.0-20220811202034-502d2d690317 // indirect
7860
)

0 commit comments

Comments
 (0)