@@ -697,7 +697,7 @@ type serviceManager struct {
697
697
698
698
var _ servicecommon.ServiceManager = & serviceManager {}
699
699
700
- func (m * serviceManager ) CleanupServices (a provision.App , deployedVersion appTypes. AppVersion , preserveOldVersions bool ) error {
700
+ func (m * serviceManager ) CleanupServices (a provision.App , deployedVersion int , preserveOldVersions bool ) error {
701
701
depGroups , err := deploymentsDataForApp (m .client , a )
702
702
if err != nil {
703
703
return err
@@ -715,7 +715,7 @@ func (m *serviceManager) CleanupServices(a provision.App, deployedVersion appTyp
715
715
multiErrors := tsuruErrors .NewMultiError ()
716
716
for _ , depsData := range depGroups .versioned {
717
717
for _ , depData := range depsData {
718
- toKeep := depData .replicas > 0 && (preserveOldVersions || depData .version == deployedVersion . Version () )
718
+ toKeep := depData .replicas > 0 && (preserveOldVersions || depData .version == deployedVersion )
719
719
720
720
if toKeep {
721
721
processInUse [depData .process ] = struct {}{}
@@ -759,21 +759,21 @@ func (m *serviceManager) CleanupServices(a provision.App, deployedVersion appTyp
759
759
return multiErrors .ToError ()
760
760
}
761
761
762
- func (m * serviceManager ) RemoveService (a provision.App , process string , version appTypes. AppVersion ) error {
762
+ func (m * serviceManager ) RemoveService (a provision.App , process string , versionNumber int ) error {
763
763
multiErrors := tsuruErrors .NewMultiError ()
764
- err := cleanupDeployment (m .client , a , process , version )
764
+ err := cleanupDeployment (m .client , a , process , versionNumber )
765
765
if err != nil && ! k8sErrors .IsNotFound (err ) {
766
766
multiErrors .Add (err )
767
767
}
768
- err = cleanupServices (m .client , a , process , version )
768
+ err = cleanupServices (m .client , a , process , versionNumber )
769
769
if err != nil {
770
770
multiErrors .Add (err )
771
771
}
772
772
return multiErrors .ToError ()
773
773
}
774
774
775
- func (m * serviceManager ) CurrentLabels (a provision.App , process string , version appTypes. AppVersion ) (* provision.LabelSet , error ) {
776
- dep , err := deploymentForVersion (m .client , a , process , version )
775
+ func (m * serviceManager ) CurrentLabels (a provision.App , process string , versionNumber int ) (* provision.LabelSet , error ) {
776
+ dep , err := deploymentForVersion (m .client , a , process , versionNumber )
777
777
if err != nil {
778
778
if k8sErrors .IsNotFound (err ) {
779
779
return nil , nil
@@ -1210,7 +1210,7 @@ func (m *serviceManager) ensureServices(a provision.App, process string, labels,
1210
1210
}
1211
1211
1212
1212
if len (svcPorts ) == 0 {
1213
- err = cleanupServices (m .client , a , process , version )
1213
+ err = cleanupServices (m .client , a , process , version . Version () )
1214
1214
if err != nil {
1215
1215
return err
1216
1216
}
0 commit comments