Skip to content

Instantly share code, notes, and snippets.

View anchialas's full-sized avatar

Adi König anchialas

View GitHub Profile

I had a bit of trouble figuring out how to use bitnami's sealed secrets with helm

Here's a definition of done to help you see what I was trying to achieve.

Definition of done

  • Single secret available for a release in a namespace, listing all secret variables
  • Regular helm workflow, with no extra kubeseal commands for developers
  • Encrypted secrets clearly visible in git
  • Sealedsecret managed by helm

Question

What is the difference between

[Service Provider Interface (SPI)][1] and [Application Programming Interface (API)][2]?

Answer

  • the API is the kind of classes/interfaces/methods/... that you call and work to achieve an aim, and
  • the SPI is the kind of classes/interfaces/methods/... that you extend and implement to achieve a goal.
def projectName = "foo/bar" // may be a multibranch pipeline project
def buildNr = 98
org.jenkinsci.plugins.workflow.job.WorkflowRun run =
Jenkins.instance.getItemByFullName(projectName).getBuildByNumber(buildNr)
run.@result = hudson.model.Result.SUCCESS
@anchialas
anchialas / git.migrate
Created November 7, 2016 07:08 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@anchialas
anchialas / CustomerResource.java
Created January 22, 2016 10:45
HTTP 301 (Moved Permanently) between JAX-RS Resources (Methods)
@Path("/customer")
@Produces(MediaType.APPLICATION_JSON)
public class CustomerResource {
@PUT
@Path("{id}/matchXYZ")
@Consumes(MediaType.APPLICATION_JSON)
@Deprecated
public Response matchChNr(@PathParam("id") long customerId,
@QueryParam("matchedBy") String matchedBy,
@anchialas
anchialas / EsId.java
Last active August 29, 2015 14:23 — forked from strokine/EsId.java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface EsId {
}
# Check if today is Sunday, if commit is not a pull request, if git repo is official, and if branch is master. If checks pass, run Sonar reports
- "[[ $(date +%u) -gt 5 ]] && [[ $TRAVIS_PULL_REQUEST == false ]] && [[ $TRAVIS_REPO_SLUG == RepoOrg/RepoName ]] && [[ $TRAVIS_BRANCH == master ]] && mvn sonar:sonar"
@anchialas
anchialas / CustomerTransformer.java
Last active August 29, 2015 14:22
Camel: Extract Transform Load (ETL) Example
// src/main/java/org/apache/camel/example/etl
@Converter
public final class CustomerTransformer {
private static final Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class);
private CustomerTransformer() {
}
/**
* A transformation method to convert a person document into a customer entity