Skip to content
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
bb8af47
#119 add standard labels to dogus and coponents
alexander-dammeier Aug 5, 2025
aa7bea4
#121 create state diff without loading the blueprint again
alexander-dammeier Aug 5, 2025
a5de572
#119 update changelog
alexander-dammeier Aug 5, 2025
ae79469
#119 fix duplicate error if config key is present and absent
alexander-dammeier Aug 5, 2025
2085982
#121 WIP: do not load blueprint in every use case
alexander-dammeier Aug 5, 2025
9973c7b
Merge branch 'v2/develop' into feature/121-apply-blueprint-continuously
alexander-dammeier Aug 7, 2025
f346f9e
Merge branch 'feature/121-non-blocking-health-checks' into feature/12…
alexander-dammeier Aug 7, 2025
07cf18a
Merge branch 'feature/121-remove-maintenance-mode' into feature/121-a…
alexander-dammeier Aug 7, 2025
cee514f
#121 WIP: use bluerpint instead of the id to call use cases
alexander-dammeier Aug 7, 2025
7fe4543
#121 fix reconciler tests
alexander-dammeier Aug 12, 2025
4e32076
#121 remove StatusPhaseStaticallyValidated
alexander-dammeier Aug 12, 2025
82ea608
#121 fix tests
alexander-dammeier Aug 12, 2025
ad52028
#121 remove BlueprintSpecStaticallyValidated event
alexander-dammeier Aug 12, 2025
1e42af1
#121 remove StatusPhaseValidated status
alexander-dammeier Aug 12, 2025
dcd9618
#121 remove BlueprintSpecValidated event
alexander-dammeier Aug 12, 2025
19a8262
#121 remove StatusPhaseInvalid
alexander-dammeier Aug 13, 2025
b37cfbf
#121 remove StatusPhaseEffectiveBlueprintGenerated
alexander-dammeier Aug 13, 2025
b97f726
#121 remove EffectiveBlueprintCalculatedEvent
alexander-dammeier Aug 13, 2025
bce1e0c
#121 remove StatusPhaseStateDiffDetermined
alexander-dammeier Aug 13, 2025
1aed68a
#121 remove StatusPhaseEcosystemHealthyUpfront
alexander-dammeier Aug 13, 2025
7ba9da7
#121 remove StatusPhaseEcosystemUnhealthyUpfront
alexander-dammeier Aug 13, 2025
211cee1
#121 remove blueprint pre-processing
alexander-dammeier Aug 13, 2025
ba285ae
#121 remove StatusPhaseEcosystemHealthyAfterwards
alexander-dammeier Aug 13, 2025
1cfd2fe
#121 remove censoring in post-processing
alexander-dammeier Aug 14, 2025
9d46832
#121 do not write sensitive data in blueprint CR
alexander-dammeier Aug 14, 2025
0aeff2a
#121 remove unused censoring functions
alexander-dammeier Aug 14, 2025
7eb4861
#121 remove StatusPhaseEcosystemUnhealthyAfterwards
alexander-dammeier Aug 14, 2025
486d591
#121 check if changes need to be made or early exit
alexander-dammeier Aug 14, 2025
807cd04
#121 make self upgrade non-blocking
alexander-dammeier Aug 14, 2025
217e008
#121 remove self upgrade statuses
alexander-dammeier Aug 14, 2025
1e4c0e1
#121 remove StatusPhaseApplyEcosystemConfig
alexander-dammeier Aug 15, 2025
498763d
#121 remove config status phases
alexander-dammeier Aug 15, 2025
30a6efb
#121 write down ideas for state diff
alexander-dammeier Aug 15, 2025
2026c36
#121 remove StatusPhaseInProgress
alexander-dammeier Aug 15, 2025
a7a6875
#121 unify health checks, extract component apply
alexander-dammeier Aug 19, 2025
70ced3b
#121 extract dogu apply
alexander-dammeier Aug 19, 2025
5d99e31
#121 remove dogu restarts
alexander-dammeier Aug 20, 2025
8372290
#121 fix tests after renaming mock
alexander-dammeier Aug 20, 2025
eb01371
Merge branch 'v2/develop' into feature/121-apply-blueprint-continuously
alexander-dammeier Aug 20, 2025
cdcdce0
#121 update changelog
alexander-dammeier Aug 20, 2025
d77f197
#121 rename post-processing to completeBp; remove last status phases
alexander-dammeier Aug 20, 2025
a30adaa
#121 load and persist conditions via repository
alexander-dammeier Aug 20, 2025
10940cf
#121 fix event test
alexander-dammeier Aug 20, 2025
85c9620
#121 always write a reason in conditions
alexander-dammeier Aug 20, 2025
ac92073
#121 remove unused blocking health checks; reduce log output
alexander-dammeier Aug 20, 2025
a5df1fc
#121 handle DogusApplied conditions after determining StateDiff
alexander-dammeier Aug 22, 2025
8673e62
#121 remove retry while loading dogu.jsons
alexander-dammeier Aug 27, 2025
46f390f
#121 add cache for dogu descriptors
alexander-dammeier Aug 27, 2025
fd4dd64
#121 fix tests
alexander-dammeier Aug 27, 2025
0d54958
#121 change slice-pointer of conditions to normal slice
meiserloh Aug 30, 2025
643e9a8
#121 add TODO
meiserloh Aug 30, 2025
7224d31
#121 remove cache and use local dogu descriptor repository
meiserloh Sep 4, 2025
371a5ca
#121 prevent additional health checks, when unnecessary
meiserloh Sep 5, 2025
03b045b
[#125] ignore nginx dependency
Sep 8, 2025
13be6bc
#121 Update to newest CRD version
meiserloh Sep 11, 2025
ecde0fd
#121 Add unit test for spec change usecase
nhinze23 Sep 11, 2025
ba7e13d
[#125] replace annotation dependency with validate capabilities
Sep 12, 2025
c2506bf
#121 Fix tests and nil pointer problems
meiserloh Sep 12, 2025
315dce2
Merge remote-tracking branch 'origin/feature/121.2-apply-blueprint-co…
meiserloh Sep 12, 2025
e499e6e
[#125] install component crd
Sep 12, 2025
166b3aa
[#125] install component crd
Sep 12, 2025
9382d7e
#121 flatten config in domain
meiserloh Sep 15, 2025
51d641c
Merge pull request #126 from cloudogu/feature/125-ignore-nginx-depend…
kahoona77 Sep 15, 2025
b558509
Bump version
kahoona77 Sep 15, 2025
8ff6e30
Update changelog
kahoona77 Sep 15, 2025
74b6429
Merge branch 'release/v2.8.0' into develop
kahoona77 Sep 15, 2025
2fde501
#121 add tests
meiserloh Sep 15, 2025
8deed0e
#121 incorporate cesmarvin review
meiserloh Sep 15, 2025
0746b2c
#121 display only changes in stateDiff
meiserloh Sep 15, 2025
83d6311
#121 incorporate review comments
meiserloh Sep 16, 2025
7b169ed
Merge remote-tracking branch 'origin/develop' into feature/121.2-appl…
meiserloh Sep 16, 2025
b3db9e0
#121 rename domain DryRun to Stopped
meiserloh Sep 17, 2025
d0acd5b
#121 blueprint should be applied until completed
meiserloh Sep 17, 2025
637c8d4
#121 apply blueprint if not completed
meiserloh Sep 18, 2025
e518dea
#121 improve tests
meiserloh Sep 18, 2025
04a12f9
#121 reduce state diff events
meiserloh Sep 18, 2025
fa4e54e
#121 remove applied conditions in favor of LastApplySucceeded
meiserloh Sep 18, 2025
0e61e6a
#121 set conditions to unknown on first reconcile
meiserloh Sep 19, 2025
e5911f0
#121 fix sonar issues
meiserloh Sep 19, 2025
109bfd0
#121 reduce complexity further
meiserloh Sep 19, 2025
ed11c5d
#121 remove serialization of statediff to domain
meiserloh Sep 22, 2025
5395651
#121 remove serialization of statediff to domain
meiserloh Sep 22, 2025
d682af5
#121 enforce singlton cr
meiserloh Sep 22, 2025
08f542e
#121 fix logging for multiple blueprint errors
meiserloh Sep 23, 2025
8587953
#121 Upgrade to Golang v1.25.1 and Makefiles to v10.3.0
meiserloh Sep 24, 2025
d797621
#121 add DogusUpToDate Use Case
meiserloh Sep 24, 2025
c41e8f8
#121 pause reconciliation on config and version change
meiserloh Sep 25, 2025
c31d1a1
#121 censor sensitive config values in effective Blueprint
meiserloh Sep 25, 2025
ba2159f
#121 add display name to blueprint
meiserloh Sep 25, 2025
8d6559e
#121 clean up roles
meiserloh Sep 25, 2025
7e92c85
#121 clean up dependencies
meiserloh Sep 26, 2025
1aa0237
#121 fix todos
meiserloh Sep 26, 2025
6542ba8
#121 use k8s.ui/utils/ptr package instead of own helper
meiserloh Sep 26, 2025
710a299
#121 remove ReverseProxyConfig-Pointer from domain
meiserloh Sep 26, 2025
9c9200d
#121 remove Subfolder-Pointer from domain
meiserloh Sep 26, 2025
42904c4
#121 remove rewriteTarget- & additionalConfig-Pointer from domain
meiserloh Sep 26, 2025
e18577c
#121 remove config-Pointer from domain
meiserloh Sep 26, 2025
ece4020
#121 allow empty values in config
meiserloh Sep 29, 2025
1e094a2
#121 remove Todo
meiserloh Sep 29, 2025
7d8145a
#121 combine stateDiff events and throw ecosystemUnhealty only once
meiserloh Sep 29, 2025
14e31e4
#121 check ecosystem health before stateDiff to avoid overhead
meiserloh Sep 29, 2025
89fba7e
#121 upgrade makefiles to 10.4.0
meiserloh Sep 29, 2025
099c4dd
#121 apply cesmarvin review
meiserloh Sep 29, 2025
1024804
#121 apply cesmarvin review
meiserloh Sep 29, 2025
ca875ca
#121 update docs
meiserloh Sep 29, 2025
42762ff
#121 add stopped event and log
meiserloh Sep 30, 2025
81a97d2
#121 validate that sensitive config is not allowed to have normal values
meiserloh Sep 30, 2025
a206826
#121 only log stopped + event when actually stopped
meiserloh Oct 1, 2025
fed9ba6
#121 add debug log line for no ops reconciles
meiserloh Oct 1, 2025
1fdf8df
#121 retry notFoundErrors with backoff to handle not blueprints too
meiserloh Oct 2, 2025
7d84bce
#121 Handle all NotFoundErrors with retry except blueprints
meiserloh Oct 2, 2025
3dd94be
#121 set executable to false on missing config reference
meiserloh Oct 7, 2025
0d0d76e
#121 extract apply and preparation use case and clean up tests
meiserloh Oct 7, 2025
6522e73
#121 move domain object changes into aggregate
meiserloh Oct 7, 2025
f2f8548
#121 Move blueprint changes into the aggregate
meiserloh Oct 8, 2025
f93e267
#121 remove unnecessary rights to update finalizers
meiserloh Oct 8, 2025
7476cd7
#121 merge proxy config dogu action into one to simplify the status
meiserloh Oct 8, 2025
941962a
#121 remove unnecessary patch and update rights to whole blueprint
meiserloh Oct 10, 2025
bd8309a
#121 use crd-conditions
meiserloh Oct 10, 2025
b340d29
#121 fix typo
meiserloh Oct 10, 2025
ef37916
#121 clarify messages of not allowed actions
meiserloh Oct 10, 2025
4834589
Merge pull request #127 from cloudogu/feature/121.2-apply-blueprint-c…
alexander-dammeier Oct 16, 2025
9bd11ce
Merge branch 'v2/develop' into feature/121-apply-blueprint-continuously
alexander-dammeier Oct 17, 2025
b2601e3
#121 fix docs
alexander-dammeier Oct 17, 2025
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
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#119] *breaking* sensitive dogu config can now only be referenced with secrets
- it was not safe to have these values in clear text in the blueprint
- [#119] we now support blueprint v2 CRs
- [#121] health checks before and after applying the blueprint are now non-blocking
- [#121] all health checks are now non-blocking
- [#121] there are in general no steps anymore, which will block the reconciliation loop beyond some HTTP-Requests
- [#121] *breaking* blueprints will now be executed as a continuous process
- the operator will now detect changes and will enforce the content of the blueprint
- [#121] *breaking* the current state will now be reflected via conditions instead of the `statusPhase` field
- [#121] *breaking* events were reworked, some events are now more general, some events got removed completely
- Note, that events are for humans. You should not compute them for automation as they have no consistency guarantees.

### Removed
- [#119] *breaking* no support for v1 blueprint CRs anymore
- make sure to persist your blueprints before upgrading
- you need to transform your blueprints to the new v2 format yourself
- [#121] remove maintenance mode
- [#121] *breaking* dogus will not be restarted by the blueprint operator anymore
- this is now the responsibility of the dogu operator

## [v2.7.0] - 2025-07-17
### Fixed
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ require (
github.com/Masterminds/semver/v3 v3.3.1
github.com/cloudogu/ces-commons-lib v0.2.0
github.com/cloudogu/cesapp-lib v0.18.1
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250731163609-f388bd8c571c
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250820104829-95faf37d626a
github.com/cloudogu/k8s-component-operator v1.9.0
github.com/cloudogu/k8s-dogu-lib/v2 v2.8.0
github.com/cloudogu/k8s-registry-lib v0.5.1
github.com/cloudogu/remote-dogu-descriptor-lib v0.1.1
github.com/cloudogu/retry-lib v0.1.0
github.com/go-logr/logr v1.4.2
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/stretchr/testify v1.10.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
Expand All @@ -39,6 +39,7 @@ require (
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/chai2010/gettext-go v1.0.3 // indirect
github.com/cloudogu/retry-lib v0.1.0 // indirect
github.com/containerd/cgroups/v3 v3.0.5 // indirect
github.com/containerd/containerd v1.7.27 // indirect
github.com/containerd/errdefs v1.0.0 // indirect
Expand Down
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,8 @@ github.com/cloudogu/ces-commons-lib v0.2.0 h1:yOEZWFl4W9N3J/6fok4svE3UufK5GQQtyx
github.com/cloudogu/ces-commons-lib v0.2.0/go.mod h1:4rvR2RTDDaz5a6OZ1fW27G0MOnl5I3ackeiHxt4gn3o=
github.com/cloudogu/cesapp-lib v0.18.1 h1:LMdGktIefm/PuhdPqpLTPvjY1smO06EEGBbRSAaYi7U=
github.com/cloudogu/cesapp-lib v0.18.1/go.mod h1:J05eXFxnz4enZblABlmiVTZaUtJ+LIhlJ2UF6l9jpDw=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250723132542-b0472a456ff0 h1:b3vbIIV1J8YtRCMkJC0EKB10DcTPDqVNda/FNX11E80=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250723132542-b0472a456ff0/go.mod h1:Qyi8M+HJMHJfhXN6Zotey/tXjFuJDM9RIXn+FjQaJAU=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250731094124-310a388d0c7f h1:05BZKhsUJrv4oHkmK4CbNd2/0egXqXup/sfHOOCWC/0=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250731094124-310a388d0c7f/go.mod h1:Qyi8M+HJMHJfhXN6Zotey/tXjFuJDM9RIXn+FjQaJAU=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250731163609-f388bd8c571c h1:o2hARW5ifab56Yjzxedc95wCBnjsJuF1k0bOfqUNXB0=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250731163609-f388bd8c571c/go.mod h1:Qyi8M+HJMHJfhXN6Zotey/tXjFuJDM9RIXn+FjQaJAU=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250820104829-95faf37d626a h1:aj5qH5Ejn+TstaHjt+8Y6vigIY5uVl59IWPVzaFlczU=
github.com/cloudogu/k8s-blueprint-lib/v2 v2.0.0-20250820104829-95faf37d626a/go.mod h1:Qyi8M+HJMHJfhXN6Zotey/tXjFuJDM9RIXn+FjQaJAU=
github.com/cloudogu/k8s-component-operator v1.9.0 h1:b1/gMcAPQBP93EIVTE1ctmAKFdVOqnTST+x6LOqu08g=
github.com/cloudogu/k8s-component-operator v1.9.0/go.mod h1:BdWqwpZWHoSFOduQ3FzcVV4uGJNb+t0DUYlLBHQ9wwQ=
github.com/cloudogu/k8s-dogu-lib/v2 v2.8.0 h1:ae+LtiY+J2/qIX1AUJLcVxx/FQvlstq9ViVMwlJD26Y=
Expand Down Expand Up @@ -321,6 +317,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug=
github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI=
Expand Down
78 changes: 78 additions & 0 deletions pkg/adapter/doguregistry/cache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package doguregistry

import (
"context"
"fmt"

cescommons "github.com/cloudogu/ces-commons-lib/dogu"
"github.com/cloudogu/cesapp-lib/core"
gocache "github.com/patrickmn/go-cache"
"sigs.k8s.io/controller-runtime/pkg/log"
)

// TODO: We should move this implementation in the dogu-descriptor-lib, so others can profit from it as well.

type Cache struct {
repository remoteDoguDescriptorRepository
cache *gocache.Cache
}

func NewCache(repository remoteDoguDescriptorRepository, cache *gocache.Cache) *Cache {
return &Cache{
repository: repository,
cache: cache,
}
}

func (c *Cache) GetLatest(ctx context.Context, name cescommons.QualifiedName) (*core.Dogu, error) {
// we cannot cache latest for sure
dogu, err := c.repository.GetLatest(ctx, name)
if err != nil {
return nil, err
}
version, err := core.ParseVersion(dogu.Version)
if err != nil {
return nil, fmt.Errorf("cannot populate cache as latest dogu version cannot be parsed from response: %w", err)
}
c.SetCached(
cescommons.QualifiedVersion{
Name: name,
Version: version,
},
dogu,
)
return dogu, nil
}

func (c *Cache) Get(ctx context.Context, version cescommons.QualifiedVersion) (*core.Dogu, error) {
logger := log.FromContext(ctx).WithName("DoguDescriptorCache")
dogu, found := c.GetCached(version)
if found {
logger.V(2).Info("dogu descriptor cache hit", "dogu", version)
return dogu, nil
}

// cache missed
dogu, err := c.repository.Get(ctx, version)
if err != nil {
return nil, err
}
c.SetCached(version, dogu)
return dogu, nil
}

func cacheKeyFromReference(qualifiedDoguVersion cescommons.QualifiedVersion) string {
return fmt.Sprintf("%s:%s", qualifiedDoguVersion.Name.String(), qualifiedDoguVersion.Version.String())
}

func (c *Cache) GetCached(qualifiedDoguVersion cescommons.QualifiedVersion) (*core.Dogu, bool) {
cached, found := c.cache.Get(cacheKeyFromReference(qualifiedDoguVersion))
if found {
return cached.(*core.Dogu), found
}
return nil, found
}

func (c *Cache) SetCached(qualifiedDoguVersion cescommons.QualifiedVersion, dogu *core.Dogu) {
c.cache.SetDefault(cacheKeyFromReference(qualifiedDoguVersion), dogu)
}
37 changes: 15 additions & 22 deletions pkg/adapter/doguregistry/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ package doguregistry
import (
"context"
"errors"
"fmt"

cescommons "github.com/cloudogu/ces-commons-lib/dogu"
cloudoguerrors "github.com/cloudogu/ces-commons-lib/errors"
"github.com/cloudogu/cesapp-lib/core"
"github.com/cloudogu/retry-lib/retry"

"github.com/cloudogu/k8s-blueprint-operator/v2/pkg/domainservice"
)

var maxTries = 20

type Remote struct {
repository remoteDoguDescriptorRepository
}
Expand All @@ -23,27 +19,24 @@ func NewRemote(repository remoteDoguDescriptorRepository) *Remote {
}

func (r *Remote) GetDogu(ctx context.Context, qualifiedDoguVersion cescommons.QualifiedVersion) (*core.Dogu, error) {
dogu := &core.Dogu{}
err := retry.OnError(maxTries, cloudoguerrors.IsConnectionError, func() error {
var err error
dogu, err = r.repository.Get(ctx, qualifiedDoguVersion)
return err
})
// do not retry here. If any error happens, just reconcile later. We only do retries in application level.
// This makes the code way easier and non-blocking.
dogu, err := r.repository.Get(ctx, qualifiedDoguVersion)
if err != nil {
// this is ugly, maybe do it better in cesapp-lib?
if cloudoguerrors.IsNotFoundError(err) {
return nil, &domainservice.NotFoundError{
WrappedError: err,
Message: fmt.Sprintf("dogu %q with version %q could not be found", qualifiedDoguVersion.Name, qualifiedDoguVersion.Version.Raw),
}
}

return nil, &domainservice.InternalError{
WrappedError: err,
Message: fmt.Sprintf("failed to get dogu %q with version %q", qualifiedDoguVersion.Name, qualifiedDoguVersion.Version.Raw),
return nil, domainservice.NewNotFoundError(
err,
"dogu %q with version %q could not be found",
qualifiedDoguVersion.Name, qualifiedDoguVersion.Version.Raw,
)
} else {
return nil, domainservice.NewInternalError(
err,
"failed to get dogu %q with version %q",
qualifiedDoguVersion.Name, qualifiedDoguVersion.Version.Raw,
)
}
}

return dogu, nil
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/adapter/doguregistry/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package doguregistry
import (
"context"
"fmt"
"testing"

cescommons "github.com/cloudogu/ces-commons-lib/dogu"
cloudoguerrors "github.com/cloudogu/ces-commons-lib/errors"
"github.com/cloudogu/cesapp-lib/core"
"github.com/cloudogu/k8s-blueprint-operator/v2/pkg/domainservice"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)

func TestNewRemote(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"

v2 "github.com/cloudogu/k8s-blueprint-lib/v2/api/v2"
serializerv2 "github.com/cloudogu/k8s-blueprint-operator/v2/pkg/adapter/kubernetes/blueprintcr/v2/serializer"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -64,17 +65,22 @@ func (repo *blueprintSpecRepo) GetById(ctx context.Context, blueprintId string)
return nil, err
}

conditions := &blueprintCR.Status.Conditions
if conditions == nil {
conditions = &[]domain.Condition{}
}

blueprintSpec := &domain.BlueprintSpec{
Id: blueprintId,
EffectiveBlueprint: effectiveBlueprint,
StateDiff: stateDiff,
Conditions: conditions,
Config: domain.BlueprintConfiguration{
IgnoreDoguHealth: blueprintCR.Spec.IgnoreDoguHealth,
IgnoreComponentHealth: blueprintCR.Spec.IgnoreComponentHealth,
AllowDoguNamespaceSwitch: blueprintCR.Spec.AllowDoguNamespaceSwitch,
DryRun: blueprintCR.Spec.DryRun,
},
Status: domain.StatusPhase(blueprintCR.Status.Phase),
}

blueprint, blueprintErr := serializerv2.ConvertToBlueprintDomain(blueprintCR.Spec.Blueprint)
Expand Down Expand Up @@ -118,13 +124,13 @@ func (repo *blueprintSpecRepo) Update(ctx context.Context, spec *domain.Blueprin
CreationTimestamp: metav1.Time{},
},
Status: v2.BlueprintStatus{
Phase: v2.StatusPhase(spec.Status),
EffectiveBlueprint: effectiveBlueprint,
StateDiff: serializerv2.ConvertToStateDiffDTO(spec.StateDiff),
Conditions: *spec.Conditions,
},
}

logger.Info("update blueprint CR status")
logger.V(2).Info("update blueprint CR status")

CRAfterUpdate, err := repo.blueprintClient.UpdateStatus(ctx, updatedBlueprint, metav1.UpdateOptions{})
if err != nil {
Expand Down
Loading