diff --git a/server/application/service/participant_service.go b/server/application/service/participant_service.go index fcd258b..f396dca 100644 --- a/server/application/service/participant_service.go +++ b/server/application/service/participant_service.go @@ -355,6 +355,12 @@ func (app *ParticipantApp) getFATEClusterUpgradeableVersionList(ClusterUUID stri return "", nil, err } participant := participantInstance.(*entity.ParticipantFATE) + + //Check whether it is a cluster managed by fedlcm, a cluster not managed by fedlcm cannot be upgraded + if !participant.IsManaged { + return "", nil, errors.New("The cluster not managed by FedLCM cannot be upgraded.") + } + instance, err := app.ChartRepo.GetByUUID(participant.ChartUUID) if err != nil { ClusterChartVersion = utils.GetChartVersionFromDeploymentYAML(participant.DeploymentYAML) diff --git a/server/domain/service/participant_fate_upgrade_service.go b/server/domain/service/participant_fate_upgrade_service.go index 828c69a..f029189 100644 --- a/server/domain/service/participant_fate_upgrade_service.go +++ b/server/domain/service/participant_fate_upgrade_service.go @@ -49,6 +49,11 @@ func (s *ParticipantFATEService) UpgradeExchange(req *ParticipantFATEExchangeUpg } exchange := participantInstance.(*entity.ParticipantFATE) + //Check whether it is a cluster managed by fedlcm, a cluster not managed by fedlcm cannot be upgraded + if !exchange.IsManaged { + return nil, nil, errors.New("The cluster not managed by FedLCM cannot be upgraded.") + } + if err := s.EndpointService.TestKubeFATE(exchange.EndpointUUID); err != nil { return nil, nil, err } @@ -196,6 +201,11 @@ func (s *ParticipantFATEService) UpgradeCluster(req *ParticipantFATEClusterUpgra } cluster := participantInstance.(*entity.ParticipantFATE) + //Check whether it is a cluster managed by fedlcm, a cluster not managed by fedlcm cannot be upgraded + if !exchange.IsManaged { + return nil, nil, errors.New("The cluster not managed by FedLCM cannot be upgraded.") + } + if err := s.EndpointService.TestKubeFATE(cluster.EndpointUUID); err != nil { return nil, nil, err }