@@ -36,7 +36,7 @@ func (s *Service) GetOrCreateFloatingIP(eventObject runtime.Object, openStackClu
36
36
var fpCreateOpts floatingips.CreateOpts
37
37
38
38
if ip != "" {
39
- fp , err = s .checkIfFloatingIPExists (ip )
39
+ fp , err = s .GetFloatingIP (ip )
40
40
if err != nil {
41
41
return nil , err
42
42
}
@@ -70,7 +70,7 @@ func (s *Service) GetOrCreateFloatingIP(eventObject runtime.Object, openStackClu
70
70
return fp , nil
71
71
}
72
72
73
- func (s * Service ) checkIfFloatingIPExists (ip string ) (* floatingips.FloatingIP , error ) {
73
+ func (s * Service ) GetFloatingIP (ip string ) (* floatingips.FloatingIP , error ) {
74
74
fpList , err := s .client .ListFloatingIP (floatingips.ListOpts {FloatingIP : ip })
75
75
if err != nil {
76
76
return nil , err
@@ -93,7 +93,7 @@ func (s *Service) GetFloatingIPByPortID(portID string) (*floatingips.FloatingIP,
93
93
}
94
94
95
95
func (s * Service ) DeleteFloatingIP (eventObject runtime.Object , ip string ) error {
96
- fip , err := s .checkIfFloatingIPExists (ip )
96
+ fip , err := s .GetFloatingIP (ip )
97
97
if err != nil {
98
98
return err
99
99
}
@@ -147,7 +147,7 @@ func (s *Service) AssociateFloatingIP(eventObject runtime.Object, fp *floatingip
147
147
}
148
148
149
149
func (s * Service ) DisassociateFloatingIP (eventObject runtime.Object , ip string ) error {
150
- fip , err := s .checkIfFloatingIPExists (ip )
150
+ fip , err := s .GetFloatingIP (ip )
151
151
if err != nil {
152
152
return err
153
153
}
0 commit comments