本文整理汇总了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();
}
}
}
示例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());
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}