Skip to content

Commit

Permalink
Merge branch 'release/v0.5.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nhinze23 authored and cesmarvin committed Oct 11, 2023
2 parents 4a1de70 + 505e3c3 commit b8e0f28
Show file tree
Hide file tree
Showing 47 changed files with 4,289 additions and 629 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [v0.5.1] - 2023-10-11
### Changed
- [#33] Replace mittwald-go-helm-client with a reduced implementation fitted to our needs

## [v0.5.0] - 2023-10-06
### Added
- [#29] Add permissions on all namespaces to install components in namespaces like monitoring or longhorn-system. Add a new property deployNamespace. It is used to determine where the helm deployment should go. If it is empty the namespace from the component-operator is used.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN make compile-generic
FROM gcr.io/distroless/static:nonroot
LABEL maintainer="[email protected]" \
NAME="k8s-component-operator" \
VERSION="0.5.0"
VERSION="0.5.1"

WORKDIR /
COPY --from=builder /workspace/target/k8s-component-operator .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set these to the desired values
ARTIFACT_ID=k8s-component-operator
VERSION=0.5.0
VERSION=0.5.1
## Image URL to use all building/pushing image targets
IMAGE_DEV=${K3CES_REGISTRY_URL_PREFIX}/${ARTIFACT_ID}:${VERSION}
IMAGE=cloudogu/${ARTIFACT_ID}:${VERSION}
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ kind: Kustomization
images:
- name: controller
newName: cloudogu/k8s-component-operator
newTag: 0.5.0
newTag: 0.5.1
7 changes: 7 additions & 0 deletions config/samples/dogu-operator-crd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: k8s.cloudogu.com/v1
kind: Component
metadata:
name: k8s-dogu-operator-crd
spec:
name: k8s-dogu-operator-crd
namespace: k8s
19 changes: 7 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@ require (
github.com/cloudogu/cesapp-lib v0.12.1
github.com/cloudogu/k8s-apply-lib v0.4.2
github.com/go-logr/logr v1.2.4
github.com/mittwald/go-helm-client v0.12.3
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.27.10
github.com/onsi/gomega v1.28.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.12.0-dev.1.0.20230817154107-a749b663101d
helm.sh/helm/v3 v3.13.0
k8s.io/api v0.28.2
k8s.io/apimachinery v0.28.2
k8s.io/cli-runtime v0.28.2
k8s.io/client-go v0.28.2
sigs.k8s.io/controller-runtime v0.16.2
sigs.k8s.io/yaml v1.3.0
)

// replace mittwald client with our own until mittwald supports plain HTTP helm registries
// this should be released in helm v3.13 which is scheduled in September 23
replace github.com/mittwald/go-helm-client v0.12.3 => github.com/cloudogu/go-helm-client v0.0.0-20230822080918-4b3b24282d0d

require (
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
Expand Down Expand Up @@ -107,7 +105,6 @@ require (
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
Expand All @@ -119,7 +116,6 @@ require (
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
Expand All @@ -146,9 +142,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.28.2 // indirect
k8s.io/apiserver v0.28.2 // indirect
k8s.io/cli-runtime v0.28.2 // indirect
k8s.io/component-base v0.28.2 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230905202853-d090da108d2f // indirect
Expand All @@ -159,5 +155,4 @@ require (
sigs.k8s.io/kustomize/api v0.14.0 // indirect
sigs.k8s.io/kustomize/kyaml v0.14.3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudogu/cesapp-lib v0.12.1 h1:FBHviZwc3fZB3cMqhK7BqRQD5HZZJcDt6BiG7kAKrTc=
github.com/cloudogu/cesapp-lib v0.12.1/go.mod h1:PTQqI3xs1ReJMXYE6BGTF33yAfmS4J7P8UiE4AwDMDY=
github.com/cloudogu/go-helm-client v0.0.0-20230822080918-4b3b24282d0d h1:wORDIdIYkMpsHrNUXbyhllPYpM8fbXIYqv0jvrcIj6I=
github.com/cloudogu/go-helm-client v0.0.0-20230822080918-4b3b24282d0d/go.mod h1:b1jCbr7z27zWDtVPp3IjXDMwe7GrHxg/L8jOC5jW9Ls=
github.com/cloudogu/k8s-apply-lib v0.4.2 h1:D5hTYvIZya+tAyGCUGaZ1T83otvpQwzrZXz5JPHQQ5M=
github.com/cloudogu/k8s-apply-lib v0.4.2/go.mod h1:jR/+7q47O5gb++4gVsmEElT8/EJoi+Msw2dVzArTPW0=
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
Expand Down Expand Up @@ -322,12 +320,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/onsi/gomega v1.28.0 h1:i2rg/p9n/UqIDAMFUJ6qIUUMcsqOuUHgbpbu235Vr1c=
github.com/onsi/gomega v1.28.0/go.mod h1:A1H2JE76sI14WIP57LMKj7FVfCHx3g3BcZVjJG8bjX8=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
Expand Down Expand Up @@ -595,8 +593,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g=
helm.sh/helm/v3 v3.12.0-dev.1.0.20230817154107-a749b663101d h1:6J+y+NmyX17vulRO05myRL0BzQwmzZ3bNs+h0ZUiAE4=
helm.sh/helm/v3 v3.12.0-dev.1.0.20230817154107-a749b663101d/go.mod h1:bmvO+xB/gCRkjlpIFBHGEDI4tCwmTU+tcOGqd4C4RqU=
helm.sh/helm/v3 v3.13.0 h1:XPJKIU30K4JTQ6VX/6e0hFAmEIonYa8E7wx5aqv4xOc=
helm.sh/helm/v3 v3.13.0/go.mod h1:2PBEKsMWKLVZTojUOqMS3Eadv5mP43FBWrRgLNkNm9Y=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.28.2 h1:9mpl5mOb6vXZvqbQmankOfPIGiudghwCoLl1EYfUZbw=
Expand Down
10 changes: 6 additions & 4 deletions pkg/api/v1/ces_component_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package v1
import (
"embed"
"fmt"
helmclient "github.com/mittwald/go-helm-client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/cloudogu/k8s-component-operator/pkg/helm/client"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
Expand Down Expand Up @@ -73,7 +75,7 @@ func (c *Component) String() string {
}

// GetHelmChartSpec returns the helm chart for the component cr without custom values.
func (c *Component) GetHelmChartSpec() *helmclient.ChartSpec {
func (c *Component) GetHelmChartSpec() *client.ChartSpec {
deployNamespace := ""

if c.Spec.DeployNamespace != "" {
Expand All @@ -82,7 +84,7 @@ func (c *Component) GetHelmChartSpec() *helmclient.ChartSpec {
deployNamespace = c.Namespace
}

return &helmclient.ChartSpec{
return &client.ChartSpec{
ReleaseName: c.Spec.Name,
ChartName: fmt.Sprintf("%s/%s", c.Spec.Namespace, c.Spec.Name),
Namespace: deployNamespace,
Expand Down
10 changes: 6 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ package config
import (
"context"
"fmt"
"os"
"strconv"
"strings"

"github.com/Masterminds/semver/v3"
"gopkg.in/yaml.v3"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
"os"
ctrl "sigs.k8s.io/controller-runtime"
"strconv"
"strings"
"sigs.k8s.io/yaml"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"context"
"time"

helmclient "github.com/mittwald/go-helm-client"
"helm.sh/helm/v3/pkg/release"
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"

"github.com/cloudogu/k8s-component-operator/pkg/api/ecosystem"
k8sv1 "github.com/cloudogu/k8s-component-operator/pkg/api/v1"
"github.com/cloudogu/k8s-component-operator/pkg/helm/client"
)

// installManager includes functionality to install components in the cluster.
Expand All @@ -34,15 +34,15 @@ type upgradeManager interface {
// helmClient is an interface for managing components with helm.
type helmClient interface {
// InstallOrUpgrade takes a helmChart and applies it.
InstallOrUpgrade(ctx context.Context, chart *helmclient.ChartSpec) error
InstallOrUpgrade(ctx context.Context, chart *client.ChartSpec) error
// Uninstall removes the helmRelease for the given name
Uninstall(releaseName string) error
// ListDeployedReleases returns all deployed helm releases
ListDeployedReleases() ([]*release.Release, error)
// SatisfiesDependencies validates that all dependencies are installed in the required version. A nil error
// indicates that all dependencies (if any) meet the requirements, so that the client may conduct an installation or
// upgrade.
SatisfiesDependencies(ctx context.Context, chart *helmclient.ChartSpec) error
SatisfiesDependencies(ctx context.Context, chart *client.ChartSpec) error
}

// eventRecorder embeds the record.EventRecorder interface for usage in this package.
Expand Down
27 changes: 14 additions & 13 deletions pkg/controllers/mock_helmClient_test.go

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

Loading

0 comments on commit b8e0f28

Please sign in to comment.