Skip to content

Commit

Permalink
updated broker to use current appDep of release
Browse files Browse the repository at this point in the history
  • Loading branch information
xadhatter committed Nov 29, 2023
1 parent 3982b91 commit 398180d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 10 additions & 2 deletions components/broker/engine/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,21 @@ func (str *Store) buildReleaseMatcher(ctx context.Context) (*matcher.EventMatche
vars map[string]*api.Val
)

if appDep, err := str.AppDeployment(rel.Spec.AppDeployment.Name); err != nil {
var appDepName string
if rel.Status.Current != nil {
appDepName = rel.Status.Current.AppDeployment.Name
}
if appDepName == "" {
str.log.Debugf("Release '%s/%s' does not have a current AppDeployment", rel.Namespace, rel.Name)
continue
}

if appDep, err := str.AppDeployment(appDepName); err != nil {
str.log.Warn(err)
continue
} else {
comps = appDep.Spec.Components
}

if env, err := str.ReleaseEnv(rel.Name); err != nil {
str.log.Warn(err)
continue
Expand Down
12 changes: 8 additions & 4 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,18 @@ between deployments KubeFox is able to share a single pod. Not only are
environments injected per request, routing is performed dynamically.

For fun publish the new version, release it to the `qa` environment, then
promote version `v0.1.0` to the `prod` environment. Check out those blazing fast
the releases.
promote version `v0.1.0` to the `prod` environment. Because of the stricter
release policies set in the `prod` environment a snapshot is required for the
release. Much like a versioned deployment, an environment snapshot is immutable,
ensuring a stable release even if the `prod` environment is changed.

Check out those blazing fast the releases.

```{ .shell .copy }
git tag v0.1.1 && \
fox publish --version v0.1.1 --wait 5m && \
fox release v0.1.1 --virtual-env qa && \
fox release v0.1.0 --virtual-env prod
fox release v0.1.0 --virtual-env prod --create-snapshot
```

??? example "Output"
Expand All @@ -700,7 +704,7 @@ git tag v0.1.1 && \
$ git tag v0.1.1 && \
fox publish --version v0.1.1 --wait 5m && \
fox release v0.1.1 --virtual-env qa && \
fox release v0.1.0 --virtual-env prod
fox release v0.1.0 --virtual-env prod --create-snapshot
info Component image 'localhost/kubefox/hello-world/backend:bb702a1' exists.
info Loading component image 'localhost/kubefox/hello-world/backend:bb702a1' into kind cluster 'kind'.

Expand Down

0 comments on commit 398180d

Please sign in to comment.