Skip to content

Instantly share code, notes, and snippets.

View lordofthejars's full-sized avatar
🏠
Working from home

Alex Soto lordofthejars

🏠
Working from home
View GitHub Profile
FROM oracle/graalvm-ce:1.0.0-rc12 AS builder
ENV GRAALVM_HOME=/opt/graalvm-ce-1.0.0-rc12/
COPY . .
RUN ./mvnw package -Pnative
FROM registry.fedoraproject.org/fedora-minimal
WORKDIR /work/
@ExtendWith(OdoExecutorStubInjector.class)
public class OdoExecutorStubTest {
@Test
public void should_run_commands(OdoExecutorStub odoExecutorStub) {
// Given
final Odo odo = new Odo(odoExecutorStub);
@ExtendWith
({
OpenShiftConditionExtension.class, // Checks if there is an OpenShift cluster running
GitExtension.class, // Clones project to temporal directory
OpenShiftInjector.class // Injects OpeShift client to do assertions
})
@GitClone("https://github.com/openshift/nodejs-ex") // Project to clone
public class CreateDeployTest {
private final Odo odo = new Odo(new OdoConfiguration()); // Creates Odo instance
#
# Copyright 2016 Red Hat, Inc.
#
# Red Hat licenses this file to you under the Apache License, version
# 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
public class FindAUser implements Task{
private final int id;
public FindAUser(int id) {
this.id = id;
}
public static FindAUser withId(int id) {
return instrumented(FindAUser.class, id);
}
@RunWith(SerenityRunner.class)
public class WhenSecurityServiceNeedsUsersInformation {
private String theRestApiBaseUrl;
private EnvironmentVariables environmentVariables;
private Actor securityService;
@Before
public void configureBaseUrl() {
= My Code
:source-highlighter: highlightjs
== Callouts
[source, java]
.MyClass.java
----
public class MyClass { // <1>
public static void main(String[] args) { // <2>
func newPodForCR(cr *hellov1alpha1.Hello) *corev1.Pod {
msg := cr.Spec.Message
labels := map[string]string{
"app": cr.Name,
}
return &corev1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: cr.Name + "-pod",
Namespace: cr.Namespace,
Labels: labels,
apiVersion: hello.lordofthejars.com/v1alpha1
kind: Hello
metadata:
name: example-hello
spec:
message: Hello Alex
oc/kubectl create -f deploy/service_account.yaml
oc/kubectl create -f deploy/role.yaml
oc/kubectl create -f deploy/role_binding.yaml
oc/kubectl create -f deploy/operator.yaml