Skip to content

Commit

Permalink
fix: kube deployments with same schema don't redeploy (#2653)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Sep 12, 2024
1 parent 6e9732f commit 2547351
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/controller/dal/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (d *DAL) PollDeployments(ctx context.Context) {
d.DeploymentChanges.Publish(DeploymentNotification{
Message: optional.Some(deployment),
})
} else if !bytes.Equal(previousState.schemaHash, state.schemaHash) || previousState.minReplicas != state.minReplicas {
} else if !bytes.Equal(previousState.schemaHash, state.schemaHash) || previousState.minReplicas != state.minReplicas || !bytes.Equal(previousState.Key.Suffix, state.Key.Suffix) {
logger.Tracef("Changed deployment: %s", name)
d.DeploymentChanges.Publish(DeploymentNotification{
Message: optional.Some(deployment),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package k8sscaling_test

import (
"strings"
"testing"

"github.com/alecthomas/assert/v2"
Expand All @@ -18,5 +19,12 @@ func TestKubeScaling(t *testing.T) {
in.Call("echo", "echo", "Bob", func(t testing.TB, response string) {
assert.Equal(t, "Hello, Bob!!!", response)
}),
in.EditFile("echo", func(content []byte) []byte {
return []byte(strings.ReplaceAll(string(content), "Hello", "Bye"))
}, "echo.go"),
in.Deploy("echo"),
in.Call("echo", "echo", "Bob", func(t testing.TB, response string) {
assert.Equal(t, "Bye, Bob!!!", response)
}),
)
}

0 comments on commit 2547351

Please sign in to comment.