Skip to content

Commit

Permalink
version 0.5 prep
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ruoss committed Mar 4, 2022
1 parent 2f970bb commit cf81eb3
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [0.5.0] -

Version 0.5.0 comes with some major changes. Please read through the [migration guide](guides/migrations.md) before upgrading.

## Added

- `Bonny.Server.AsyncStreamRunner` to run streams in a separate process
Expand Down
48 changes: 48 additions & 0 deletions guides/migrations.md
@@ -0,0 +1,48 @@
# Migrations

## Migrating from 0.4 to 0.5

Version 0.5 comes with some major changes. Please read through this migration guide before upgrading.

### Elixir Version

With version 0.5, bonny moved Elixir support from \~> 1.9 to \~> 1.10.
### Config

The dependency on `:k8s` was upgraded from `0.4.0` to `1.1.0`. With version `1.0`,
`:k8s` brought some major changes. Mainly the way the connection to the cluster
is configured. While pre `1.0`, connections were configured in `config.exs`, in `1.0`
upwards, they had to created and passed to the client by the caller. This change
affects `:bonny`, too.

Starting with version `0.5`, you no longer have to configure `:k8s`. Thsi means
you can remove this block completely as it has no effect:

```elixir
config :k8s,
clusters: ...
```

With `0.5`, `:bonny` however has to be configured with a new option `:get_conn`. The value of
this configuration option is supposed to be an MFA tuple that tells bonny how to get
the connection struct. The function is called by bonny and is expected to return
either `{:ok, K8s.Conn.t()}` or a `K8s.Conn.t()` directly.

```elixir
config :bonny,
get_conn: {MyModule, :get_the_connection},
```

You can use helpers defined in `:k8s` to get the connection:

```elixir
config :bonny,
get_conn: {K8s.Conn, :from_file, ["~/.kube/config", [context: "optional-alternate-context"]]},
```

or, when configuring bonny to run in your cluster:

```elixir
config :bonny,
get_conn: {K8s.Conn, :from_service_account, []}
```
11 changes: 8 additions & 3 deletions mix.exs
@@ -1,6 +1,6 @@
defmodule Bonny.MixProject do
use Mix.Project
@version "0.4.4"
@version "0.5.0"
@source_url "https://github.com/coryodaniel/bonny"

def project do
Expand Down Expand Up @@ -80,7 +80,8 @@ defmodule Bonny.MixProject do
links: %{
"Changelog" => "#{@source_url}/blob/master/CHANGELOG.md",
"GitHub" => @source_url
}
},
files: ["lib", "mix.exs", "README.md", "LICENSE", "CHANGELOG.md"]
]
end

Expand All @@ -91,7 +92,11 @@ defmodule Bonny.MixProject do
assets: "assets",
source_ref: @version,
source_url: @source_url,
extras: ["README.md", "CHANGELOG.md"]
extras: [
"README.md",
"CHANGELOG.md",
"guides/migrations.md"
]
]
end

Expand Down

0 comments on commit cf81eb3

Please sign in to comment.