Skip to content

Commit

Permalink
Rename CRD name f5ipam to ipam (F5Networks#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
agupta49 authored Aug 16, 2021
1 parent 8996c27 commit e393384
Show file tree
Hide file tree
Showing 27 changed files with 425 additions and 421 deletions.
2 changes: 1 addition & 1 deletion docs/config_examples/crd/Install/clusterrole.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rules:
resources: ["virtualservers","virtualservers/status", "tlsprofiles", "transportservers", "ingresslinks", "externaldnss"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: ["fic.f5.com"]
resources: ["f5ipams", "f5ipams/status"]
resources: ["ipams", "ipams/status"]
verbs: ["get", "list", "watch", "update", "create", "patch", "delete"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/F5Networks/k8s-bigip-ctlr
go 1.16

require (
github.com/F5Networks/f5-ipam-controller v0.1.5-0.20210720135810-3c6cbe8409ee
github.com/F5Networks/f5-ipam-controller v0.1.5-0.20210813064837-de4b96f0e82c
github.com/f5devcentral/go-bigip/f5teem v0.0.0-20210621162944-38d486e26398
github.com/f5devcentral/mockhttpclient v0.0.0-20210630101009-cc12e8b81051
github.com/google/uuid v1.1.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/F5Networks/f5-ipam-controller v0.1.5-0.20210720135810-3c6cbe8409ee h1:947cypdheqtEGN6Wt4M59Laj57xZiEk0k1b3dPHfi8o=
github.com/F5Networks/f5-ipam-controller v0.1.5-0.20210720135810-3c6cbe8409ee/go.mod h1:T6GmYytrreXO0ShD3skIJIx05pe8rdxSIlAnk0clnWQ=
github.com/F5Networks/f5-ipam-controller v0.1.5-0.20210813064837-de4b96f0e82c h1:lt8hUudhw5TPz7Pi0DTmoF7cVx3AMb/2uRt0NfxO6eo=
github.com/F5Networks/f5-ipam-controller v0.1.5-0.20210813064837-de4b96f0e82c/go.mod h1:JZILK1dcnuPgk+WAuCctXSUqvY5+vFRXlaYDb/ehMQw=
github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ rules:
apiGroups:
- fic.f5.com
resources:
- f5ipams
- f5ipams/status
- ipams
- ipams/status
- verbs:
- get
- list
Expand Down
6 changes: 3 additions & 3 deletions pkg/crmanager/crManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ func (crMgr *CRManager) createIPAMResource() error {
}

crName := frameIPAMResourceName(crMgr.Agent.BIGIPURL)
f5ipam := &ficV1.F5IPAM{
f5ipam := &ficV1.IPAM{
ObjectMeta: metaV1.ObjectMeta{
Name: crName,
Namespace: IPAMNamespace,
},
Spec: ficV1.F5IPAMSpec{
Spec: ficV1.IPAMSpec{
HostSpecs: make([]*ficV1.HostSpec, 0),
},
Status: ficV1.F5IPAMStatus{
Status: ficV1.IPAMStatus{
IPStatus: make([]*ficV1.IPSpec, 0),
},
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/crmanager/informers.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (crMgr *CRManager) getEventHandlerForIPAM() *cache.ResourceEventHandlerFunc
}

func (crMgr *CRManager) enqueueIPAM(obj interface{}) {
ipamObj := obj.(*ficV1.F5IPAM)
ipamObj := obj.(*ficV1.IPAM)

if ipamObj.Namespace+"/"+ipamObj.Name != crMgr.ipamCR {
return
Expand All @@ -291,8 +291,8 @@ func (crMgr *CRManager) enqueueIPAM(obj interface{}) {
}

func (crMgr *CRManager) enqueueUpdatedIPAM(oldObj, newObj interface{}) {
oldIpam := oldObj.(*ficV1.F5IPAM)
curIpam := newObj.(*ficV1.F5IPAM)
oldIpam := oldObj.(*ficV1.IPAM)
curIpam := newObj.(*ficV1.IPAM)

if curIpam.Namespace+"/"+curIpam.Name != crMgr.ipamCR {
return
Expand All @@ -314,7 +314,7 @@ func (crMgr *CRManager) enqueueUpdatedIPAM(oldObj, newObj interface{}) {
}

func (crMgr *CRManager) enqueueDeletedIPAM(obj interface{}) {
ipamObj := obj.(*ficV1.F5IPAM)
ipamObj := obj.(*ficV1.IPAM)

if ipamObj.Namespace+"/"+ipamObj.Name != crMgr.ipamCR {
return
Expand Down
8 changes: 4 additions & 4 deletions pkg/crmanager/informers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ var _ = Describe("Informers Tests", func() {
ipam := test.NewIPAM(
"SampleIPAM",
namespace,
ficV1.F5IPAMSpec{
ficV1.IPAMSpec{
HostSpecs: []*ficV1.HostSpec{hostSpec},
},
ficV1.F5IPAMStatus{},
ficV1.IPAMStatus{},
)
mockCRM.enqueueIPAM(ipam)
key, quit := mockCRM.rscQueue.Get()
Expand All @@ -327,10 +327,10 @@ var _ = Describe("Informers Tests", func() {
newIPAM := test.NewIPAM(
"SampleIPAM",
namespace,
ficV1.F5IPAMSpec{
ficV1.IPAMSpec{
HostSpecs: []*ficV1.HostSpec{hostSpec},
},
ficV1.F5IPAMStatus{
ficV1.IPAMStatus{
IPStatus: []*ficV1.IPSpec{ipSpec},
},
)
Expand Down
10 changes: 5 additions & 5 deletions pkg/crmanager/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (crMgr *CRManager) processResource() bool {
edns := rKey.rsc.(*cisapiv1.ExternalDNS)
crMgr.processExternalDNS(edns, rKey.rscDelete)
case IPAM:
ipam := rKey.rsc.(*ficV1.F5IPAM)
ipam := rKey.rsc.(*ficV1.IPAM)
virtuals := crMgr.getVirtualServersForIPAM(ipam)
for _, vs := range virtuals {
err := crMgr.processVirtualServers(vs, false)
Expand Down Expand Up @@ -830,7 +830,7 @@ func getIPAMLabel(virtuals []*cisapiv1.VirtualServer) string {
return ""
}

func (crMgr *CRManager) getIPAMCR() *ficV1.F5IPAM {
func (crMgr *CRManager) getIPAMCR() *ficV1.IPAM {
cr := strings.Split(crMgr.ipamCR, "/")
if len(cr) != 2 {
log.Errorf("[ipam] error while retrieving IPAM namespace and name.")
Expand Down Expand Up @@ -1404,7 +1404,7 @@ func (crMgr *CRManager) getAllServicesFromMonitoredNamespaces() []*v1.Service {
}

// Get List of VirtualServers associated with the IPAM resource
func (crMgr *CRManager) getVirtualServersForIPAM(ipam *ficV1.F5IPAM) []*cisapiv1.VirtualServer {
func (crMgr *CRManager) getVirtualServersForIPAM(ipam *ficV1.IPAM) []*cisapiv1.VirtualServer {
log.Debug("[ipam] sync ipam starting...")
var allVS, vss []*cisapiv1.VirtualServer
allVS = crMgr.getAllVSFromMonitoredNamespaces()
Expand All @@ -1420,7 +1420,7 @@ func (crMgr *CRManager) getVirtualServersForIPAM(ipam *ficV1.F5IPAM) []*cisapiv1
}

// Get List of TransportServers associated with the IPAM resource
func (crMgr *CRManager) getTransportServersForIPAM(ipam *ficV1.F5IPAM) []*cisapiv1.TransportServer {
func (crMgr *CRManager) getTransportServersForIPAM(ipam *ficV1.IPAM) []*cisapiv1.TransportServer {
var allTS, tss []*cisapiv1.TransportServer
allTS = crMgr.getAllTSFromMonitoredNamespaces()
for _, status := range ipam.Status.IPStatus {
Expand All @@ -1435,7 +1435,7 @@ func (crMgr *CRManager) getTransportServersForIPAM(ipam *ficV1.F5IPAM) []*cisapi
return tss
}

func (crMgr *CRManager) syncAndGetServicesForIPAM(ipam *ficV1.F5IPAM) []*v1.Service {
func (crMgr *CRManager) syncAndGetServicesForIPAM(ipam *ficV1.IPAM) []*v1.Service {

allServices := crMgr.getAllServicesFromMonitoredNamespaces()
if allServices == nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/test/crd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func NewExternalDNS(name, namespace string, spec cisapiv1.ExternalDNSSpec) *cisa
}
}

func NewIPAM(name, namespace string, spec ficV1.F5IPAMSpec, status ficV1.F5IPAMStatus) *ficV1.F5IPAM {
return &ficV1.F5IPAM{
func NewIPAM(name, namespace string, spec ficV1.IPAMSpec, status ficV1.IPAMStatus) *ficV1.IPAM {
return &ficV1.IPAM{
TypeMeta: metav1.TypeMeta{
Kind: "IPAM",
APIVersion: "v1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e393384

Please sign in to comment.