Hi, my name is Pierre

I am an open source software engineer at Red Hat. I work on Kubernetes and OpenStack.

I am a maintainer of Gophercloud, the Go SDK for OpenStack. I am also the author of openstack-resource-controller, an experimental Kubernetes operator for managing your OpenStack resources.

A presumably Asian traditional fisherman holds a peculiar fish cage using a hand and a foot, in balance with a foot on the edge of a canoe and one long stick plunged in the water.

How to hire a software engineer: a panellist's guide to the technical interview

Many candidates struggle to express their full potential during a technical interview. As the interviewer, your job is to let them shine. You will certainly look out for red flags, and your attention will naturally be drawn to their technical weak spots. But you’ll have to be intentional if you don’t want to overlook talent. Your job in a technical interview: prove that this very candidate is the best fit for the role....

March 5, 2024 · Pierre Prinetti
The screenshot of a Bash script.

Bash notes

My personal Bash styleguide. Headers The shebang tells our operating system what interpreter to use to execute the script. #!/usr/bin/env bash These options make the execution of our script more predictable: set -o errtrace set -o errexit set -o nounset set -o pipefail # or more concisely: set -Eeuo pipefail When a command in a script fails, the failure is ignored by default. With -E and -e, errors stop the execution of the script....

August 3, 2022 · Pierre Prinetti

Run in docker-compose, wait for the database

Do you use docker-compose to run your local development environment? Do you write your commands into a Makefile to protect your brain and your fingers from complex startup scripts? If so, then you know how painful it is to tell your service to wait for the database before starting. In a sane production environment, a service should always boot and patiently wait for the dependencies to become available, and signal their state through something like a readiness probe....

June 25, 2019 · Pierre Prinetti

A short introduction to AWS IAM, including Roles

IAM stands for Identity and Access Management. It is the service that lets you manage authentication and authorization within your AWS account. Authentication and Authorisation in AWS are based on six building blocks1: Account, User, Group, Policy, Action and Role. Everything I write here, and much more, can be found in the AWS documentation. This post is nothing more than a quick introduction to get you started with the basics....

June 22, 2019 · Pierre Prinetti

Credential Management API for passwords

Browsers let us save passwords and to retrieve them. This way, we can use strings too long and complex to be remembered. Some browsers, with or without the support of external password managers, generate new passwords for us and manage them seamlessly. However most of the time, everything regarding passwords is still based on the ability of the browser of guessing which input field contains a username, and which one contains a password....

January 10, 2019 · Pierre Prinetti

The Go 1.11 web service Dockerfile

Build with Modules, Ship from Scratch If you use dep, check out this post instead. Goals: The application executable is compiled inside a container, in order to boost reproducibility The resulting image must be as small as possible The application must run in a container as secure as possible: an unprivileged user in a minimal environment The application must be able to make HTTPS calls It is a multistage Dockerfile: the first throwaway stage is used for building, while the final image will only contain the compiled binary executable....

November 5, 2018 · Pierre Prinetti
A crash test dummy going to work in a van

Test-Driven Development in Go

In this video, Robert Martin uses Kotlin and JUnit to illustrate his Three Laws of TDD. But what about Go? Follow me and challenge the master! We will walk in his footsteps with the only help of Brad Fitzpatrick’s checkFunc pattern. The Three Laws You are not allowed to write any production code unless it is to make a failing unit test pass. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures....

July 9, 2018 · Pierre Prinetti

The Go Dockerfile

Build With Dep, Ship From Scratch For Go 1.11 modules, check this post instead. In a devops environment, pushing some code to the repository is not enough. You have to ship it. And the first step is often writing a Dockerfile. The goals: The code has to be compiled in a container, to boost the chances my build will be reproducible. Use dep for fetching the dependencies in case the vendor folder is not committed alongside with the code....

February 14, 2018 · Pierre Prinetti
A dark evening in Berlin. The river borders a small city park park where a distant human figure walks towards a yellow light in the background.

Event Sourcing in Go: the Event Handler

Recently, I have been working on an event-sourced application built around Command-Query Responsibility Segregation (CQRS). My job was to figure out how to implement a new command in Go. In order to act on a given object, we have to build the current state of that object out of the events that created and modified it. Here I want to show how I have come up with the applier interface to represent the Event logic....

February 3, 2018 · Pierre Prinetti
A bright red ship propeller in the foreground, steam pipes and machinery in the background.

A pattern for Go tests

I used to spend an unreasonable amount of time thinking about how to begin writing a test. I googled test patterns in Go. Many people seem to rely on external dependencies for assertions. And in fact, I understand that generic (aha!) functions like isNil(v interface{}) bool can initially bring speed to the development. But in the long run, I think that embracing the true strongly-typed nature of Go, instead of just searching for a way around it, is more rewarding....

January 28, 2018 · Pierre Prinetti