Journey from Testing into Software Development

Hello, Dear Reader! Settle in for a long one this time. I would like to write about my journey from being a Tester back in 2004 to being a software engineer today ( 2024 ). A mere 20 year long journey. I’m going to write down how I got this far, what it took, the sacrifices, fears, doubts and all the things in between. Let’s get started. The early days Around 2002, I became a student for a two year long certificate study for a position called Software Programmer. It was a paid course. My mother paid for the two years, it was the cheapest options at that time in Hungary. The school, SZAMALK, was 80km from where I lived, so I had to travel everyday. The bus ride took about 1.5 hours that I mostly managed to sleep through. Then school until 2pm-ish and then travel back home. Another 1.5 hours. I woke up at 5AM to get to school on time. It was quite rough. I mostly slept through my classes. ...

May 23, 2024 · 17 min · hannibal

crd-to-yaml now supports HTML as an output format

Hello! Just wanted to give an update to my crd-to-sample-yaml tool. It, now, supports creating a standalone HTML output. Why, you may ask? Well, now you can host the generated content as a static page on your website. That’s pretty handy. Here is a sample output: Go and get it while it’s hot in version v0.4.0. That’s all. Thanks for reading!

May 9, 2024 · 1 min · hannibal

Generic dig for map key using typed parameters

Generic dig for map key using typed parameters Hello! I was fiddling with a way of getting out values from a map that is of format map[string]any. But I wanted my type safety as well. This was coming from digging out keys from a Metadata field. The metadata was in a JSON format. This is what I came up with: / FetchValueFromMetadata fetches a key from a metadata if it exists. It will recursively look in // embedded values as well. Must be a unique key, otherwise it will just return the first // occurrence. func FetchValueFromMetadata[T any](key string, data *apiextensionsv1.JSON, def T) (t T, _ error) { if data == nil { return def, nil } m := map[string]any{} if err := json.Unmarshal(data.Raw, &m); err != nil { return t, fmt.Errorf("failed to parse JSON raw data: %w", err) } v, err := dig[T](key, m) if err != nil { if errors.Is(err, errKeyNotFound) { return def, nil } } return v, nil } func dig[T any](key string, data map[string]any) (t T, _ error) { if v, ok := data[key]; ok { c, k := v.(T) if !k { return t, fmt.Errorf("failed to convert value to the desired type; was: %T", v) } return c, nil } for _, v := range data { if ty, ok := v.(map[string]any); ok { return dig[T](key, ty) } } return t, errKeyNotFound } The interesting part is the dig method and the type assert to the desired part. Calling this with something like: ...

February 27, 2024 · 2 min · hannibal

CRD to YAML as WASM website

CRD to YAML as WASM website A while ago, I wrote about Generating Sample YAML files from CRDs. It’s a tool I created that lives here. It has a front-end service as well for convenience. I wrote it in a traditional client-server manner. It’s running from a Docker Swarm container. But, as I was thinking about it, nothing in this service requires interaction with a server. It gets some user input, processes it, and has some output. I could have written it in plain Javascript. But, since I don’t know JavaScript, or don’t know it well enough, and I do know GO, and I wanted to become more familiar with WASM, this was the perfect learning opportunity. ...

December 1, 2023 · 5 min · hannibal

Self-Signed locally trusted certificates with cert-manager

Self-Signed locally trusted certificates with cert-manager We are going to discuss how to set up a Kubernetes environment where components can run using HTTPS without pain. Premise Usually, people either generate certificates outside the cluster using either openssl, or mkcert, then mount them in or use those as seeds for further generation. This poses a number of problems during testing and distribution of these certificates. And then, switching to production, it proves that local certs will either no longer work or pose even more problems in getting them properly distributed again. ...

October 25, 2023 · 9 min · hannibal

Diff check and Manifest generation in GitHub Actions

Diff check and manifest generation GitHub Actions For Go projects it’s crucial that you don’t forget to run go mod tidy from time to time. Combine that with a project that includes Kubernetes controllers and the other thing people tend to forget is running make manifest && make generate. To check for these I added a small GitHub action that looks like this: name: Check for diff after manifest and generated targets on: pull_request: {} jobs: diff-check-manifests: name: Check for diff runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: fetch-depth: 0 - name: Make manifests && generate run: | make manifests && make generate - name: Setup Go uses: actions/setup-go@v3 with: go-version-file: '${{ github.workspace }}/go.mod' - name: Restore Go cache uses: actions/cache@v3 with: path: /home/runner/work/_temp/_github_home/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: go mod tidy run: | go mod tidy - name: Check for diff run: | git diff --exit-code --shortstat Small but effective and saved my behind a couple times now. ...

August 11, 2023 · 1 min · hannibal

Digital and Analog notes together

Digital and analog notes together This fight is as old as time itself. Okay, maybe not that old. But as soon as viable digital note-taking tools appeared it was on. Since then, many solutions that live together have appeared. PKM tools like Second Brain running hand-in-hand with Zettelkasten or BuJo have opened my eyes to combining them in a way that makes the outcome more powerful than each alone would be. I’m going to write down a day of mine using these methods together and show you my journey. ...

July 28, 2023 · 7 min · hannibal

How to add a self-signed certificate to the GitHub action runner

Adding a certificate to a GitHub runner Imagine having a project where you have a server that you would like to run with TLS. Let’s say, you want to run a Docker registry in a cluster using TLS. You need the generated certificate’s root certificate in the trust store of the GitHub action runner. This is simple with mkcert. The action is simple: name: tests on: pull_request: paths-ignore: - 'CODE_OF_CONDUCT.md' - 'README.md' - 'Contributing.md' workflow_call: push: branches: - main permissions: contents: read # for actions/checkout to fetch code jobs: run-test-suite: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v3 with: go-version-file: '${{ github.workspace }}/go.mod' - name: Restore Go cache uses: actions/cache@v3 with: path: /home/runner/work/_temp/_github_home/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - name: Run e2e run: make e2e This is nothing fancy. The fancy thing is coming from the make e2e part. ...

July 4, 2023 · 4 min · hannibal

Comments are back

Well, the previous post was a lie ( or rather a copy and paste error ).

May 11, 2023 · 1 min · hannibal

Test comments

Hello dear reader. I switched to a new theme that has Dark Mode. I’m hoping nothing changed regarding the RSS functionality. I removed the comments because I rarely used them. Also disabled any sort of tracking. Enjoy, Gergely.

May 11, 2023 · 1 min · hannibal