Commit b72e5396 authored by barnett's avatar barnett
Browse files

fix service cluster ip repeat bug

parent 7a9d2476
Showing with 2 additions and 3 deletions
+2 -3
......@@ -113,7 +113,6 @@ func (s *upgradeController) upgradeService(newapp v1.AppService) {
for _, new := range newService {
if nowConfig, ok := nowServiceMaps[new.Name]; ok {
new.UID = nowConfig.UID
new.Spec.ClusterIP = nowConfig.Spec.ClusterIP
new.ResourceVersion = nowConfig.ResourceVersion
newc, err := s.manager.client.CoreV1().Services(nowApp.TenantID).Update(new)
if err != nil {
......@@ -123,11 +122,11 @@ func (s *upgradeController) upgradeService(newapp v1.AppService) {
nowServiceMaps[new.Name] = nil
logrus.Debugf("update service %s for service %s", new.Name, newapp.ServiceID)
} else {
newc, err := s.manager.client.CoreV1().Services(nowApp.TenantID).Create(new)
err := CreateKubeService(s.manager.client, nowApp.TenantID, new)
if err != nil {
logrus.Errorf("update service failure %s", err.Error())
}
nowApp.SetService(newc)
nowApp.SetService(new)
logrus.Debugf("create service %s for service %s", new.Name, newapp.ServiceID)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment