Skip to content

Commit

Permalink
Merge branch 'release/v2.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
kahoona77 authored and cesmarvin committed Aug 2, 2024
2 parents 1f9afd8 + 89baa5d commit 34056aa
Show file tree
Hide file tree
Showing 78 changed files with 2,686 additions and 2,030 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v2.0.0] - 2024-08-02
**Breaking Change ahead**
### Removed
- [#94] Remove internal ETCD

### Changed
- [#94] Add k8s-registry lib in version 0.2.0 to use config maps for configuration instead of the etcd.
- This change requires all other installed components to use the configmaps or otherwise the setup won't succeed

## [v1.0.1] - 2024-06-18
### Changed
- [#92] The setup doesn't delete its own helm secret anymore. With this behaviour terraform state mechanism is able to recognize if a setup was already applied in a cluster.
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21.1 AS builder
FROM golang:1.22.5 AS builder

WORKDIR /workspace

Expand Down Expand Up @@ -30,7 +30,7 @@ RUN make compile-generic
FROM gcr.io/distroless/static:nonroot
LABEL maintainer="[email protected]" \
NAME="k8s-ces-setup" \
VERSION="1.0.1"
VERSION="2.0.0"

WORKDIR /

Expand Down
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ node('docker') {
k3d.configureSetupImage(cessetupImageName)
k3d.configureComponents(["k8s-dogu-operator" : ["version": "latest", "helmRepositoryNamespace": "k8s"],
"k8s-dogu-operator-crd": ["version": "latest", "helmRepositoryNamespace": "k8s"],
"k8s-etcd" : ["version": "latest", "helmRepositoryNamespace": "k8s"],
])
k3d.configureComponentOperatorVersion("latest")
}
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set these to the desired values
ARTIFACT_ID=k8s-ces-setup
VERSION=1.0.1
VERSION=2.0.0

GOTAG?=1.22
MAKEFILES_VERSION=9.0.5
Expand Down Expand Up @@ -158,10 +158,6 @@ k8s-clean: ## Cleans all resources deployed by the setup
.PHONY: build-setup
build-setup: ${SRC} compile ## Builds the setup Go binary.

.PHONY: setup-etcd-port-forward
setup-etcd-port-forward:
kubectl port-forward etcd-0 4001:2379 &

.PHONY: run
run: ## Run a setup from your host.
go run ./main.go
17 changes: 0 additions & 17 deletions app/cesregistry/etcd.go

This file was deleted.

4 changes: 0 additions & 4 deletions app/context/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ type Config struct {
ComponentOperatorChart string `json:"component_operator_chart" yaml:"component_operator_chart"`
// Components sets the List of Components that should be installed by the setup
Components map[string]ComponentAttributes `json:"components" yaml:"components"`
// EtcdServerResourceURL sets the K8s resource URL which controls the installation of the etcd server into the current cluster.
EtcdClientImageRepo string `json:"etcd_client_image_repo" yaml:"etcd_client_image_repo"`
// KeyProvider sets the key provider used to encrypt etcd values
KeyProvider string `json:"key_provider" yaml:"key_provider"`
// ResourcePatches contains json patches for kubernetes resources to be applied on certain phases of the setup process.
ResourcePatches []patch.ResourcePatch `json:"resource_patches" yaml:"resource_patches"`
}
Expand Down
5 changes: 1 addition & 4 deletions app/context/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ func TestReadConfig(t *testing.T) {
assert.Equal(t, "ecosystem", c.TargetNamespace)
assert.Equal(t, "k8s/k8s-component-operator-crd:0.0.2", c.ComponentOperatorCrdChart)
assert.Equal(t, "k8s/k8s-component-operator:0.0.2", c.ComponentOperatorChart)
assert.Len(t, c.Components, 3)
assert.Equal(t, "1.2.3", c.Components["k8s-etcd"].Version)
assert.Equal(t, "k8s", c.Components["k8s-etcd"].HelmRepositoryNamespace)
assert.Len(t, c.Components, 2)
assert.Equal(t, "0.0.1", c.Components["k8s-dogu-operator"].Version)
assert.Equal(t, "k8s", c.Components["k8s-dogu-operator"].HelmRepositoryNamespace)
assert.Equal(t, "latest", c.Components["k8s-service-discovery"].Version)
assert.Equal(t, "k8s", c.Components["k8s-service-discovery"].HelmRepositoryNamespace)
assert.Equal(t, "https://etcdc.yaml", c.EtcdClientImageRepo)
assert.Equal(t, logrus.DebugLevel, *c.LogLevel)
})

Expand Down
5 changes: 0 additions & 5 deletions app/context/setupContext.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ func (scb *SetupContextBuilder) NewSetupContext(ctx context.Context, clientSet k

config.TargetNamespace = targetNamespace

keyProvider := config.KeyProvider
if keyProvider != "pkcs1v15" && config.KeyProvider != "oaesp" {
return nil, fmt.Errorf("invalid key provider: %s", keyProvider)
}

configureLogger(config)

return &SetupContext{
Expand Down
2 changes: 0 additions & 2 deletions app/context/setupContext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ func TestSetupContextBuilder_NewSetupContext(t *testing.T) {
assert.Equal(t, "1.2.3", actual.AppVersion)
assert.Equal(t, "myTestNamespace", actual.AppConfig.TargetNamespace)
assert.Equal(t, "k8s/k8s-component-operator:0.0.2", actual.AppConfig.ComponentOperatorChart)
assert.Equal(t, "https://etcdc.yaml", actual.AppConfig.EtcdClientImageRepo)
assert.Equal(t, "pkcs1v15", actual.AppConfig.KeyProvider)
assert.Equal(t, "user", actual.DoguRegistryConfiguration.Username)
assert.Equal(t, "pw", actual.DoguRegistryConfiguration.Password)
assert.Equal(t, "endpoint", actual.DoguRegistryConfiguration.Endpoint)
Expand Down
2 changes: 1 addition & 1 deletion app/context/setupJson.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ type Dogus struct {
}

// CustomKeyValue is a map of string -> map pairs.
type CustomKeyValue map[string]map[string]interface{}
type CustomKeyValue map[string]map[string]any

// SetupJsonConfiguration is the main struct for the configuration of the setup.
type SetupJsonConfiguration struct {
Expand Down
7 changes: 0 additions & 7 deletions app/context/testdata/invalidConfigKeyProvider.yaml

This file was deleted.

7 changes: 1 addition & 6 deletions app/context/testdata/testConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ log_level: "DEBUG"
component_operator_crd_chart: "k8s/k8s-component-operator-crd:0.0.2"
component_operator_chart: "k8s/k8s-component-operator:0.0.2"
components:
k8s-etcd:
version: "1.2.3"
helmRepositoryNamespace: k8s
k8s-dogu-operator:
version: "0.0.1"
helmRepositoryNamespace: k8s
k8s-service-discovery:
version: "latest"
helmRepositoryNamespace: k8s
etcd_client_image_repo: https://etcdc.yaml
key_provider: pkcs1v15
helmRepositoryNamespace: k8s
15 changes: 9 additions & 6 deletions app/core/mock_fileClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions app/patch/mock_dynClient_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 33 additions & 6 deletions app/patch/mock_gvrMapper_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions app/patch/mock_jsonPatchApplier_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 34056aa

Please sign in to comment.