GoogleContainerTools/skaffold · info

there's no version to upgrade from "latest"

Error message

there's no version to upgrade from "latest"

What it means

SkaffoldConfig implements util.VersionedConfig; Upgrade() moves a config to the next schema version. The 'latest' schema is the newest version, so there is no next version to upgrade to, and the method unconditionally returns nil and this error.

Source

Thrown at pkg/skaffold/schema/latest/upgrade.go:27

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package latest

import (
	"errors"

	"github.com/GoogleContainerTools/skaffold/v2/pkg/skaffold/schema/util"
)

// Upgrade upgrades a configuration to the next version.
func (c *SkaffoldConfig) Upgrade() (util.VersionedConfig, error) {
	return nil, errors.New("there's no version to upgrade from \"latest\"")
}

View on GitHub (pinned to a1189de023)

Solutions

  1. Do not call Upgrade on a config already parsed to the latest schema version; treat it as already up to date.
  2. Check the config's APIVersion before upgrading and skip/return the original config when it equals the latest version.
  3. Parse with the version matching the file's kind/apiVersion and only upgrade older versions (v1..., v2beta...) up to latest.

Example fix

// before
upgraded, err := cfg.Upgrade() // cfg is latest.SkaffoldConfig
// after
if cfg.APIVersion == latest.Version {
    return cfg, nil // already latest, nothing to upgrade
}
upgraded, err := cfg.Upgrade()
Defensive patterns

Strategy: validation

Validate before calling

func isLatest(c *latest.SkaffoldConfig) bool { return c != nil && c.APIVersion == latest.Version } // skip Upgrade when true

Type guard

_, ok := cfg.(util.VersionedConfig); if isLatestConfig(apiVersion) { /* already latest */ }

Try / catch

upgraded, err := cfg.Upgrade()
if err != nil && strings.Contains(err.Error(), "no version to upgrade from") {
    return cfg, nil // already latest
}
if err != nil { return nil, err }

Prevention

When it happens

Trigger: Calling Upgrade() on a *latest.SkaffoldConfig (i.e. a config already parsed as the latest skaffold schema version).

Common situations: Running `skaffold fix` or programmatic schema upgrades against a skaffold.yaml that already uses the newest API version; iterating configs in tooling that blindly calls Upgrade on every parsed config.

Related errors


AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05). Data as JSON: /api/errors/5d6990538c2a8653. Report an issue: GitHub.