From c80a15af4647e362cb95f092e1a88d8a520010d4 Mon Sep 17 00:00:00 2001 From: Bartek Tofel Date: Tue, 3 Mar 2026 17:18:41 +0100 Subject: [PATCH] set CL image env var used by simple nodeset --- framework/.changeset/v0.15.1.md | 1 + framework/cmd/main.go | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 framework/.changeset/v0.15.1.md diff --git a/framework/.changeset/v0.15.1.md b/framework/.changeset/v0.15.1.md new file mode 100644 index 000000000..5c087ba54 --- /dev/null +++ b/framework/.changeset/v0.15.1.md @@ -0,0 +1 @@ +- Set CL node image also as `CTF_CHAINLINK_IMAGE` env var in compat command diff --git a/framework/cmd/main.go b/framework/cmd/main.go index c58096b92..c2a10e2b4 100644 --- a/framework/cmd/main.go +++ b/framework/cmd/main.go @@ -345,6 +345,10 @@ Be aware that any TODO requires your attention before your run the final test! Name: "exclude-refs", Usage: "Patterns to exclude specific refs (e.g., beta,rc,v0,v1)", }, + &cli.BoolFlag{ + Name: "skip-pull", + Usage: "Skip docker pull; use locally built images (e.g. for local testing)", + }, }, Usage: "Rollbacks N versions back, runs the test the upgrades CL nodes with new versions", Action: func(c *cli.Context) error { @@ -362,6 +366,7 @@ Be aware that any TODO requires your attention before your run the final test! nop := c.String("nop") sotURL := c.String("sot-url") + skipPull := c.Bool("skip-pull") // test logic is: // - rollback to selected ref @@ -393,7 +398,7 @@ Be aware that any TODO requires your attention before your run the final test! Msg("Formed upgrade sequence") // if no commands just show the tags and return if buildcmd == "" || envcmd == "" || testcmd == "" { - framework.L.Info().Msg("No envcmd or testcmd provided, skipping") + framework.L.Info().Msg("No envcmd or testcmd or buildcmd provided, skipping") return nil } // checkout the oldest ref @@ -410,7 +415,9 @@ Be aware that any TODO requires your attention before your run the final test! // setup the env and verify with test command framework.L.Info().Strs("Sequence", refs).Msg("Running upgrade sequence") + // first env var is used by devenv, second by simple nodeset to override the image os.Setenv("CHAINLINK_IMAGE", fmt.Sprintf("%s:%s", registry, refs[0])) + os.Setenv("CTF_CHAINLINK_IMAGE", fmt.Sprintf("%s:%s", registry, refs[0])) if _, err := framework.ExecCmdWithContext(c.Context, buildcmd); err != nil { return err } @@ -427,8 +434,10 @@ Be aware that any TODO requires your attention before your run the final test! Str("Version", tag). Msg("Upgrading nodes") img := fmt.Sprintf("%s:%s", registry, tag) - if _, err := framework.ExecCmdWithContext(c.Context, fmt.Sprintf("docker pull %s", img)); err != nil { - return fmt.Errorf("failed to pull image %s: %w", img, err) + if !skipPull { + if _, err := framework.ExecCmdWithContext(c.Context, fmt.Sprintf("docker pull %s", img)); err != nil { + return fmt.Errorf("failed to pull image %s: %w", img, err) + } } for i := range nodes { if err := framework.UpgradeContainer(c.Context, fmt.Sprintf(nodeNameTemplate, i), img); err != nil {