Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions server/application/service/participant_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions server/domain/service/participant_fate_upgrade_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down