Codota Logo
NamespaceAction.push
Code IndexAdd Codota to your IDE (free)

How to use
push
method
in
org.csanchez.jenkins.plugins.kubernetes.pipeline.NamespaceAction

Best Java code snippets using org.csanchez.jenkins.plugins.kubernetes.pipeline.NamespaceAction.push (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: carlossg/jenkins-kubernetes-plugin

NamespaceAction.push(run, namespace);
return false;
origin: io.fabric8.pipeline/kubernetes-pipeline-arquillian-steps

@Override
public boolean start() throws Exception {
  TaskListener listener = getContext().get(TaskListener.class);
  NamespaceAction namespaceAction = new NamespaceAction(getContext().get(Run.class));
  sessionId = generateSessionId();
  namespace = generateNamespaceId(step.getName(), step.getPrefix(), sessionId);
  client = getKubernetesClient();
  isOpenshift = client.isAdaptable(OpenShiftClient.class);
  configuration = new DefaultConfigurationBuilder()
      .withNamespace(namespace)
      .withNamespaceLazyCreateEnabled(step.isNamespaceLazyCreateEnabled())
      .withNamespaceDestroyEnabled(step.isNamespaceDestroyEnabled())
      .withMasterUrl(client.getMasterUrl())
      .build();
  StreamLogger logger = new StreamLogger(listener.getLogger());
  LabelProvider labelProvider = new MapLabelProvider(step.getLabels());
  namespaceService = isOpenshift
      ? new OpenshiftNamespaceService.ImmutableOpenshiftNamespaceService(client, configuration, labelProvider, logger)
      : new DefaultNamespaceService.ImmutableNamespaceService(client, configuration, labelProvider, logger);
  if (!namespaceService.exists(namespace) && configuration.isNamespaceLazyCreateEnabled()) {
    namespaceService.create(namespace);
  }
  namespaceAction.push(namespace);
  getContext().newBodyInvoker().
      withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), new NamespaceExpander(namespace))).
      withCallback(new NamespaceDestructionCallback(namespace, configuration, namespaceService, namespaceAction)).
      start();
  return false;
}
origin: jenkinsci/kubernetes-pipeline-plugin

@Override
public boolean start() throws Exception {
  TaskListener listener = getContext().get(TaskListener.class);
  NamespaceAction namespaceAction = new NamespaceAction(getContext().get(Run.class));
  sessionId = generateSessionId();
  namespace = generateNamespaceId(step.getName(), step.getPrefix(), sessionId);
  client = getKubernetesClient();
  isOpenshift = client.isAdaptable(OpenShiftClient.class);
  configuration = new DefaultConfigurationBuilder()
      .withNamespace(namespace)
      .withNamespaceLazyCreateEnabled(step.isNamespaceLazyCreateEnabled())
      .withNamespaceDestroyEnabled(step.isNamespaceDestroyEnabled())
      .withMasterUrl(client.getMasterUrl())
      .build();
  StreamLogger logger = new StreamLogger(listener.getLogger());
  LabelProvider labelProvider = new MapLabelProvider(step.getLabels());
  namespaceService = isOpenshift
      ? new OpenshiftNamespaceService.ImmutableOpenshiftNamespaceService(client, configuration, labelProvider, logger)
      : new DefaultNamespaceService.ImmutableNamespaceService(client, configuration, labelProvider, logger);
  if (!namespaceService.exists(namespace) && configuration.isNamespaceLazyCreateEnabled()) {
    namespaceService.create(namespace);
  }
  namespaceAction.push(namespace);
  getContext().newBodyInvoker().
      withContext(EnvironmentExpander.merge(getContext().get(EnvironmentExpander.class), new NamespaceExpander(namespace))).
      withCallback(new NamespaceDestructionCallback(namespace, configuration, namespaceService, namespaceAction)).
      start();
  return false;
}
origin: carlossg/jenkins-kubernetes-plugin

@Test
/**
 * Step namespace should have priority over anything else.
 */
public void runWithStepOverriddenNamespace() throws Exception {
  String overriddenNamespace = testingNamespace + "-overridden-namespace";
  String stepNamespace = testingNamespace + "-overridden-namespace2";
  KubernetesClient client = cloud.connect();
  // Run in our own testing namespace
  if (client.namespaces().withName(stepNamespace).get() == null) {
    client.namespaces().createOrReplace(
        new NamespaceBuilder().withNewMetadata().withName(stepNamespace).endMetadata().build());
  }
  WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "stepOverriddenNamespace");
  p.setDefinition(new CpsFlowDefinition(loadPipelineScript("runWithStepOverriddenNamespace.groovy")
      .replace("OVERRIDDEN_NAMESPACE", stepNamespace), true));
  WorkflowRun b = p.scheduleBuild2(0).waitForStart();
  assertNotNull(b);
  NamespaceAction.push(b, overriddenNamespace);
  r.assertBuildStatusSuccess(r.waitForCompletion(b));
  r.assertLogContains(stepNamespace, b);
}
origin: carlossg/jenkins-kubernetes-plugin

@Test
public void runWithOverriddenNamespace() throws Exception {
  String overriddenNamespace = testingNamespace + "-overridden-namespace";
  KubernetesClient client = cloud.connect();
  // Run in our own testing namespace
  if (client.namespaces().withName(overriddenNamespace).get() == null) {
    client.namespaces().createOrReplace(
        new NamespaceBuilder().withNewMetadata().withName(overriddenNamespace).endMetadata().build());
  }
  WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "overriddenNamespace");
  p.setDefinition(new CpsFlowDefinition(loadPipelineScript("runWithOverriddenNamespace.groovy"), true));
  WorkflowRun b = p.scheduleBuild2(0).waitForStart();
  assertNotNull(b);
  NamespaceAction.push(b, overriddenNamespace);
  r.assertBuildStatusSuccess(r.waitForCompletion(b));
  r.assertLogContains(overriddenNamespace, b);
}
org.csanchez.jenkins.plugins.kubernetes.pipelineNamespaceActionpush

Popular methods of NamespaceAction

  • <init>
  • getNamespace
  • pop
  • setRun

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getApplicationContext (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • String (java.lang)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now