fix: 优化K8S资源池校验方式
--bug=1013662 --user=刘瑞斌 【系统设置】系统升级k8s测试资源池node信息丢失 https://www.tapd.cn/55049933/s/1168325
This commit is contained in:
parent
66f6d25ce4
commit
e32c2a4bd4
|
@ -195,12 +195,6 @@ public class TestResourcePoolService {
|
|||
return nodeResourcePoolService.validate(testResourcePool);
|
||||
}
|
||||
|
||||
private void deleteTestResource(String testResourcePoolId) {
|
||||
TestResourceExample testResourceExample = new TestResourceExample();
|
||||
testResourceExample.createCriteria().andTestResourcePoolIdEqualTo(testResourcePoolId);
|
||||
testResourceMapper.deleteByExample(testResourceExample);
|
||||
}
|
||||
|
||||
public TestResourcePool getResourcePool(String resourcePoolId) {
|
||||
return testResourcePoolMapper.selectByPrimaryKey(resourcePoolId);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
@ -17,29 +16,10 @@ public class TestResourceService {
|
|||
@Resource
|
||||
private TestResourceMapper testResourceMapper;
|
||||
|
||||
public TestResource addTestResource(TestResource testResource) {
|
||||
testResource.setId(UUID.randomUUID().toString());
|
||||
testResource.setStatus("1");
|
||||
testResource.setCreateTime(System.currentTimeMillis());
|
||||
testResource.setUpdateTime(System.currentTimeMillis());
|
||||
testResourceMapper.insertSelective(testResource);
|
||||
return testResource;
|
||||
}
|
||||
|
||||
public List<TestResource> getTestResourceList(String testResourcePoolId) {
|
||||
TestResourceExample testResourceExample = new TestResourceExample();
|
||||
testResourceExample.createCriteria().andTestResourcePoolIdEqualTo(testResourcePoolId);
|
||||
List<TestResource> testResources = testResourceMapper.selectByExampleWithBLOBs(testResourceExample);
|
||||
return testResources;
|
||||
}
|
||||
|
||||
public void deleteTestResource(String testResourceId) {
|
||||
testResourceMapper.deleteByPrimaryKey(testResourceId);
|
||||
}
|
||||
|
||||
public void updateTestResource(TestResource testResource) {
|
||||
testResource.setUpdateTime(System.currentTimeMillis());
|
||||
testResourceMapper.updateByPrimaryKeySelective(testResource);
|
||||
return testResourceMapper.selectByExampleWithBLOBs(testResourceExample);
|
||||
}
|
||||
|
||||
public List<TestResource> getResourcesByPoolId(String resourcePoolId) {
|
||||
|
|
Loading…
Reference in New Issue