Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ces commons lib #25

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- [#24] use ces-commons-lib for common errors and common types
- [#24] use retry-lib for retry mechanism

## [v0.5.0] - 2024-10-17
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ github = new GitHub(this, git)
changelog = new Changelog(this)
Docker docker = new Docker(this)
gpg = new Gpg(this, docker)
goVersion = "1.22.4"
goVersion = "1.23.1"

// Configuration of repository
repositoryOwner = "cloudogu"
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ARTIFACT_ID=k8s-registry-lib
VERSION=0.5.0
GOTAG?=1.22
MAKEFILES_VERSION=9.1.0
GOTAG?=1.23.1
MAKEFILES_VERSION=9.3.2
.DEFAULT_GOAL:=default
LINT_VERSION=v1.57.2

include build/make/variables.mk
include build/make/self-update.mk
Expand Down
2 changes: 1 addition & 1 deletion build/make/bats.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BATS_SUPPORT=$(BATS_LIBRARY_DIR)/bats-support
BATS_FILE=$(BATS_LIBRARY_DIR)/bats-file
BATS_BASE_IMAGE?=bats/bats
BATS_CUSTOM_IMAGE?=cloudogu/bats
BATS_TAG?=1.2.1
BATS_TAG?=1.11.0
BATS_DIR=build/make/bats
BATS_WORKDIR="${WORKDIR}"/"${BATS_DIR}"

Expand Down
4 changes: 3 additions & 1 deletion build/make/bats/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
ARG BATS_BASE_IMAGE
ARG BATS_TAG

FROM ${BATS_BASE_IMAGE}:${BATS_TAG}
FROM ${BATS_BASE_IMAGE:-bats/bats}:${BATS_TAG:-1.11.0}

# Make bash more findable by scripts and tests
RUN apk add make git bash
# suppress git "detected dubious ownership" error/warning for repos which are checked out later
RUN git config --global --add safe.directory /workspace
2 changes: 1 addition & 1 deletion build/make/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ADDITIONAL_LDFLAGS?=-extldflags -static
LDFLAGS?=-ldflags "$(ADDITIONAL_LDFLAGS) -X main.Version=$(VERSION) -X main.CommitID=$(COMMIT_ID)"
GOIMAGE?=golang
GOTAG?=1.22
GOTAG?=1.23
GOOS?=linux
GOARCH?=amd64
PRE_COMPILE?=
Expand Down
2 changes: 1 addition & 1 deletion build/make/k8s-dogu.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: k8s.cloudogu.com/v1
apiVersion: k8s.cloudogu.com/v2
kind: Dogu
metadata:
name: NAME
Expand Down
2 changes: 1 addition & 1 deletion build/make/k8s.mk
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ${K8S_RESOURCE_TEMP_FOLDER}:
##@ K8s - Docker

.PHONY: docker-build
docker-build: check-docker-credentials check-k8s-image-env-var ## Builds the docker image of the K8s app.
docker-build: check-docker-credentials check-k8s-image-env-var ${BINARY_YQ} ## Builds the docker image of the K8s app.
@echo "Building docker image $(IMAGE)..."
@DOCKER_BUILDKIT=1 docker build . -t $(IMAGE)

Expand Down
4 changes: 2 additions & 2 deletions build/make/static-analysis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

STATIC_ANALYSIS_DIR=$(TARGET_DIR)/static-analysis
GOIMAGE?=golang
GOTAG?=1.22
GOTAG?=1.23
CUSTOM_GO_MOUNT?=-v /tmp:/tmp

REVIEW_DOG=$(TMP_DIR)/bin/reviewdog
LINT=$(TMP_DIR)/bin/golangci-lint
LINT_VERSION?=v1.58.2
LINT_VERSION?=v1.61.0
# ignore tests and mocks
LINTFLAGS=--tests=false --exclude-files="^.*_mock.go$$" --exclude-files="^.*/mock.*.go$$" --timeout 10m --issues-exit-code 0
ADDITIONAL_LINTER=-E bodyclose -E containedctx -E contextcheck -E decorder -E dupl -E errname -E forcetypeassert -E funlen -E unparam
Expand Down
8 changes: 0 additions & 8 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ import (
"strings"
)

// SimpleDoguName represents a simple Dogu name as a string.
type SimpleDoguName string

// String returns the string representation of the SimpleDoguName.
func (s SimpleDoguName) String() string {
return string(s)
}

// Key represents a configuration key as a string.
type Key string

Expand Down
6 changes: 4 additions & 2 deletions config/doguConfig.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package config

import "github.com/cloudogu/ces-commons-lib/dogu"

// DoguConfig represents a Dogu-specific configuration.
type DoguConfig struct {
DoguName SimpleDoguName
DoguName dogu.SimpleName
Config
}

// CreateDoguConfig creates a new Dogu-specific configuration with the provided Dogu name and entries.
func CreateDoguConfig(dogu SimpleDoguName, e Entries) DoguConfig {
func CreateDoguConfig(dogu dogu.SimpleName, e Entries) DoguConfig {
return DoguConfig{
DoguName: dogu,
Config: CreateConfig(e),
Expand Down
3 changes: 2 additions & 1 deletion config/doguConfig_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package config

import (
"github.com/cloudogu/ces-commons-lib/dogu"
"github.com/stretchr/testify/assert"
"testing"
)

func TestCreateDoguConfig(t *testing.T) {
e := Entries{"key1": "value1"}
doguName := "test"
doguCfg := CreateDoguConfig(SimpleDoguName(doguName), e)
doguCfg := CreateDoguConfig(dogu.SimpleName(doguName), e)

if len(doguCfg.entries) != len(e) {
t.Errorf("expected data length %d, got %d", len(e), len(doguCfg.entries))
Expand Down
Loading