本文整理了Java中io.cattle.platform.core.model.Instance.getSystem()
方法的一些代码示例,展示了Instance.getSystem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instance.getSystem()
方法的具体详情如下:
包路径:io.cattle.platform.core.model.Instance
类名称:Instance
方法名:getSystem
[英]Getter for cattle.instance.system
.
[中]cattle.instance.system
的Getter。
代码示例来源:origin: rancher/cattle
protected void setSystemLabel(Instance instance, Map<String, Object> labels) {
if(Boolean.TRUE.equals(instance.getSystem()) && !labels.containsKey(SystemLabels.LABEL_CONTAINER_SYSTEM)) {
labels.put(SystemLabels.LABEL_CONTAINER_SYSTEM, "true");
}
}
代码示例来源:origin: rancher/cattle
public static boolean isSystem(Instance instance) {
return instance.getSystem() || isRancherAgent(instance);
}
代码示例来源:origin: rancher/cattle
@Override
protected Object getAgentResource(ProcessState state, ProcessInstance process, Object dataResource) {
Instance instance = getInstance(state);
if (!isPod(instance)) {
return false;
}
Long accountId = instance.getAccountId();
List<Long> agentIds = agentInstanceDao.getAgentProvider(SystemLabels.LABEL_AGENT_SERVICE_LABELS_PROVIDER, accountId);
Long agentId = agentIds.size() == 0 ? null : agentIds.get(0);
if ((instance instanceof Instance) && (agentIds.contains(instance.getAgentId()) || instance.getSystem())) {
return null;
}
if (agentId == null) {
if (k8sRequired(instance)) {
throw new ExecutionException("Failed to find labels provider", instance);
} else {
return null;
}
}
return agentId;
}
代码示例来源:origin: rancher/cattle
@Override
public HandlerResult handle(ProcessState state, ProcessInstance process) {
Instance instance = (Instance)state.getResource();
if (!Boolean.TRUE.equals(instance.getSystem())) {
return null;
}
List<Long> agentIds = agentInstanceDao.getAgentProviderIgnoreHealth(SystemLabels.LABEL_AGENT_SERVICE_IPSEC,
instance.getAccountId());
for (long agentId : agentIds) {
ConfigUpdateRequest request = ConfigUpdateRequest.forResource(Agent.class, agentId);
ConfigUpdateItem item = request.addItem("psk");
item.setApply(true);
item.setIncrement(false);
statusManager.updateConfig(request);
}
return null;
}
代码示例来源:origin: rancher/cattle
this.uuid = instance.getUuid();
this.external_id = instance.getExternalId();
this.system = instance.getSystem();
Map<String, String> labels = DataAccessor.fields(instance).withKey(InstanceConstants.FIELD_LABELS)
.withDefault(Collections.EMPTY_MAP).as(Map.class);
代码示例来源:origin: rancher/cattle
@SuppressWarnings("unchecked")
private void callExternalSchedulerToReserve(AllocationAttempt attempt, AllocationCandidate candidate) {
List<Long> agentIds = getAgentResource(attempt.getAccountId(), attempt.getInstances());
if (agentIds.isEmpty() && !attempt.getInstances().get(0).getSystem() && allocatorDao.isSchedulerServiceEnabled(attempt.getAccountId())
&& allocatorDao.isScheulderIpsEnabled(attempt.getAccountId())) {
List<ResourceRequest> resourceRequests = gatherResourceRequests(attempt.getInstances(), attempt.getVolumes(), null);
代码示例来源:origin: rancher/cattle
setMemoryReservation(from.getMemoryReservation());
setMilliCpuReservation(from.getMilliCpuReservation());
setSystem(from.getSystem());
setServiceId(from.getServiceId());
setStackId(from.getStackId());
内容来源于网络,如有侵权,请联系作者删除!