当前位置: 首页>>代码示例>>Java>>正文


Java ObjectMeta.getName方法代码示例

本文整理汇总了Java中io.fabric8.kubernetes.api.model.ObjectMeta.getName方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectMeta.getName方法的具体用法?Java ObjectMeta.getName怎么用?Java ObjectMeta.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.fabric8.kubernetes.api.model.ObjectMeta的用法示例。


在下文中一共展示了ObjectMeta.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BuildCause

import io.fabric8.kubernetes.api.model.ObjectMeta; //导入方法依赖的package包/类
public BuildCause(Build build, String buildConfigUid) {
    this.buildConfigUid = buildConfigUid;
    if (build == null || build.getMetadata() == null) {
        return;
    }
    ObjectMeta meta = build.getMetadata();
    uid = meta.getUid();
    namespace = meta.getNamespace();
    name = meta.getName();

    if (build.getSpec() != null) {
        if (build.getSpec().getSource() != null
                && build.getSpec().getSource().getGit() != null) {
            GitBuildSource git = build.getSpec().getSource().getGit();
            gitUri = git.getUri();
        }

        if (build.getSpec().getRevision() != null
                && build.getSpec().getRevision().getGit() != null) {
            commit = build.getSpec().getRevision().getGit().getCommit();
        }
    }
}
 
开发者ID:jenkinsci,项目名称:openshift-sync-plugin,代码行数:24,代码来源:BuildCause.java

示例2: createPods

import io.fabric8.kubernetes.api.model.ObjectMeta; //导入方法依赖的package包/类
/**
 * Creates OpenShift pods and resolves machine servers based on routes and services.
 *
 * @param services created OpenShift services
 * @param routes created OpenShift routes
 * @throws InfrastructureException when any error occurs while creating OpenShift pods
 */
@VisibleForTesting
void createPods(List<Service> services, List<Route> routes) throws InfrastructureException {
  final ServerResolver serverResolver = ServerResolver.of(services, routes);
  final OpenShiftEnvironment environment = getContext().getEnvironment();
  final Map<String, InternalMachineConfig> machineConfigs = environment.getMachines();
  for (Pod toCreate : environment.getPods().values()) {
    final Pod createdPod = project.pods().create(toCreate);
    final ObjectMeta podMetadata = createdPod.getMetadata();
    for (Container container : createdPod.getSpec().getContainers()) {
      String machineName = Names.machineName(toCreate, container);
      OpenShiftMachine machine =
          new OpenShiftMachine(
              machineName,
              podMetadata.getName(),
              container.getName(),
              serverResolver.resolve(machineName),
              project,
              MachineStatus.STARTING,
              machineConfigs.get(machineName).getAttributes());
      machines.put(machine.getName(), machine);
      sendStartingEvent(machine.getName());
    }
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:32,代码来源:OpenShiftInternalRuntime.java

示例3: create

import io.fabric8.kubernetes.api.model.ObjectMeta; //导入方法依赖的package包/类
public static NamespaceName create(HasMetadata hasMetadata) {
    notNull(hasMetadata, "resource");
    ObjectMeta metadata = hasMetadata.getMetadata();
    notNull(metadata, "metadata");
    String name = metadata.getName();
    String namespace = metadata.getNamespace();
    notNull(name, "metadata.name");
    notNull(namespace, "metadata.namespace");
    return new NamespaceName(namespace, name);
}
 
开发者ID:jenkinsci,项目名称:openshift-sync-plugin,代码行数:11,代码来源:NamespaceName.java

示例4: getName

import io.fabric8.kubernetes.api.model.ObjectMeta; //导入方法依赖的package包/类
public static String getName(HasMetadata resource) {
	ObjectMeta metadata = resource.getMetadata();
	if (metadata != null) {
		return metadata.getName();
	}
	return null;
}
 
开发者ID:jenkinsci,项目名称:openshift-sync-plugin,代码行数:8,代码来源:OpenShiftUtils.java

示例5: validSecret

import io.fabric8.kubernetes.api.model.ObjectMeta; //导入方法依赖的package包/类
private boolean validSecret(Secret secret) {
    ObjectMeta metadata = secret.getMetadata();
    if (metadata != null) {
        String name = metadata.getName();
        String namespace = metadata.getNamespace();
        return name != null && !name.isEmpty() && namespace != null
                && !namespace.isEmpty();
    }
    return false;
}
 
开发者ID:jenkinsci,项目名称:openshift-sync-plugin,代码行数:11,代码来源:SecretWatcher.java

示例6: create

import io.fabric8.kubernetes.api.model.ObjectMeta; //导入方法依赖的package包/类
public static NamespaceName create(HasMetadata hasMetadata) {
    Objects.notNull(hasMetadata, "resource");
    ObjectMeta metadata = hasMetadata.getMetadata();
    Objects.notNull(metadata, "metadata");
    String name = metadata.getName();
    String namespace = metadata.getNamespace();
    Objects.notNull(name, "metadata.name");
    Objects.notNull(namespace, "metadata.namespace");
    return new NamespaceName(namespace, name);
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:11,代码来源:NamespaceName.java


注:本文中的io.fabric8.kubernetes.api.model.ObjectMeta.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。