Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image repo to upgradeVersion #445

Merged
merged 6 commits into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
4 changes: 3 additions & 1 deletion chain/cosmos/cosmos_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,15 @@ func (c *CosmosChain) GetGasFeesInNativeDenom(gasPaid int64) int64 {
return int64(fees)
}

func (c *CosmosChain) UpgradeVersion(ctx context.Context, cli *client.Client, version string) {
func (c *CosmosChain) UpgradeVersion(ctx context.Context, cli *client.Client, ContainerRepo, version string) {
c.cfg.Images[0].Version = version
for _, n := range c.Validators {
n.Image.Version = version
n.Image.Repository = ContainerRepo
}
for _, n := range c.FullNodes {
n.Image.Version = version
n.Image.Repository = ContainerRepo
}
c.pullImages(ctx, cli)
}
Expand Down
6 changes: 3 additions & 3 deletions examples/cosmos/chain_upgrade_ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
)

func TestJunoUpgradeIBC(t *testing.T) {
CosmosChainUpgradeIBCTest(t, "juno", "v6.0.0", "v8.0.0", "multiverse")
CosmosChainUpgradeIBCTest(t, "juno", "v6.0.0", "ghcr.io/strangelove-ventures/heighliner/juno", "v8.0.0", "multiverse")
}

func CosmosChainUpgradeIBCTest(t *testing.T, chainName, initialVersion, upgradeVersion string, upgradeName string) {
func CosmosChainUpgradeIBCTest(t *testing.T, chainName, initialVersion, upgradeContainerRepo, upgradeVersion string, upgradeName string) {
if testing.Short() {
t.Skip("skipping in short mode")
}
Expand Down Expand Up @@ -139,7 +139,7 @@ func CosmosChainUpgradeIBCTest(t *testing.T, chainName, initialVersion, upgradeV
require.NoError(t, err, "error stopping node(s)")

// upgrade version on all nodes
chain.UpgradeVersion(ctx, client, upgradeVersion)
chain.UpgradeVersion(ctx, client, upgradeContainerRepo, upgradeVersion)

// start all nodes back up.
// validators reach consensus on first block after upgrade height
Expand Down
6 changes: 3 additions & 3 deletions examples/cosmos/chain_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ const (
)

func TestJunoUpgrade(t *testing.T) {
CosmosChainUpgradeTest(t, "juno", "v6.0.0", "v8.0.0", "multiverse")
CosmosChainUpgradeTest(t, "juno", "v6.0.0", "ghcr.io/strangelove-ventures/heighliner/juno", "v8.0.0", "multiverse")
}

func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeVersion string, upgradeName string) {
func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeContainerRepo, upgradeVersion, upgradeName string) {
if testing.Short() {
t.Skip("skipping in short mode")
}
Expand Down Expand Up @@ -113,7 +113,7 @@ func CosmosChainUpgradeTest(t *testing.T, chainName, initialVersion, upgradeVers
require.NoError(t, err, "error stopping node(s)")

// upgrade version on all nodes
chain.UpgradeVersion(ctx, client, upgradeVersion)
chain.UpgradeVersion(ctx, client, upgradeContainerRepo, upgradeVersion)

// start all nodes back up.
// validators reach consensus on first block after upgrade height
Expand Down