@Test void testWrapWithOpenShiftAPIGroupNameAndApiGroupDisabled() { OperationContext context = new OperationContext() .withConfig(new OpenShiftConfigBuilder() .withOpenshiftApiGroupsEnabled(false) .build()) .withApiGroupName("") .withApiGroupVersion("v1"); OperationContext result = OpenShiftOperation.wrap(context); assertNull(result.getApiGroupName()); assertEquals("v1", result.getApiGroupVersion()); }
static OperationContext wrap(OperationContext context) { OpenShiftConfig config = OpenShiftConfig.wrap(context.getConfig()); String oapiVersion = config.getOapiVersion(); if (Utils.isNotNullOrEmpty(context.getApiGroupName())) { return getOperationContextWithApiGroupName(config, context, oapiVersion); } else { String apiGroupUrl = URLUtils.join(config.getMasterUrl(), "oapi", oapiVersion); return context.withConfig(new OpenShiftConfigBuilder(config).withOpenShiftUrl(apiGroupUrl).build()).withApiGroupVersion(oapiVersion); } }
OpenShiftOperation extends HasMetadataOperation<T, L, D, R> { static OperationContext wrap(OperationContext context) { OpenShiftConfig config = OpenShiftConfig.wrap(context.getConfig()); String oapiVersion = config.getOapiVersion(); if (Utils.isNotNullOrEmpty(context.getApiGroupName())) { return getOperationContextWithApiGroupName(config, context, oapiVersion); } else { String apiGroupUrl = URLUtils.join(config.getMasterUrl(), "oapi", oapiVersion); return context.withConfig(new OpenShiftConfigBuilder(config).withOpenShiftUrl(apiGroupUrl).build()).withApiGroupVersion(oapiVersion); } } }
OpenShiftOperation extends HasMetadataOperation<T, L, D, R> { static OperationContext wrap(OperationContext context) { OpenShiftConfig config = OpenShiftConfig.wrap(context.getConfig()); String oapiVersion = config.getOapiVersion(); if (Utils.isNotNullOrEmpty(context.getApiGroupName())) { return getOperationContextWithApiGroupName(config, context, oapiVersion); } else { String apiGroupUrl = URLUtils.join(config.getMasterUrl(), "oapi", oapiVersion); return context.withConfig(new OpenShiftConfigBuilder(config).withOpenShiftUrl(apiGroupUrl).build()).withApiGroupVersion(oapiVersion); } } OpenShiftOperation(OperationContext ctx); }
OpenShiftOperation extends HasMetadataOperation<T, L, D, R> { static OperationContext wrap(OperationContext context) { OpenShiftConfig config = OpenShiftConfig.wrap(context.getConfig()); String oapiVersion = config.getOapiVersion(); if (Utils.isNotNullOrEmpty(context.getApiGroupName())) { return getOperationContextWithApiGroupName(config, context, oapiVersion); } else { String apiGroupUrl = URLUtils.join(config.getMasterUrl(), "oapi", oapiVersion); return context.withConfig(new OpenShiftConfigBuilder(config).withOpenShiftUrl(apiGroupUrl).build()).withApiGroupVersion(oapiVersion); } } OpenShiftOperation(OperationContext ctx); @Override OpenShiftConfig getConfig(); @Override URL getRootUrl(); @Override T waitUntilReady(long amount, TimeUnit timeUnit); }
OpenShiftOperation extends HasMetadataOperation<T, L, D, R> { static OperationContext wrap(OperationContext context) { OpenShiftConfig config = OpenShiftConfig.wrap(context.getConfig()); String oapiVersion = config.getOapiVersion(); if (Utils.isNotNullOrEmpty(context.getApiGroupName())) { return getOperationContextWithApiGroupName(config, context, oapiVersion); } else { String apiGroupUrl = URLUtils.join(config.getMasterUrl(), "oapi", oapiVersion); return context.withConfig(new OpenShiftConfigBuilder(config).withOpenShiftUrl(apiGroupUrl).build()).withApiGroupVersion(oapiVersion); } } OpenShiftOperation(OperationContext ctx); @Override OpenShiftConfig getConfig(); @Override URL getRootUrl(); @Override T waitUntilReady(long amount, TimeUnit timeUnit); static final String OPENSHIFT_APIGROUP_SUFFIX; }