// checkBinaryVersion makes sure that the plan phase is being executed with
// the proper gravity binary
checkBinaryVersion makes sure that the plan phase is being executed with
the proper gravity binary
// checkBinaryVersion makes sure that the plan phase is being executed with // the proper gravity binary
func checkBinaryVersion(gravityPackage loc.Locator) error {
	ourVersion, err := semver.NewVersion(version.Get().Version)
	if err != nil {
		return trace.Wrap(err, "failed to parse this binary version: %v",
			version.Get().Version)
	}
	requiredVersion, err := gravityPackage.SemVer()
	if err != nil {
		return trace.Wrap(err, "failed to parse required binary version: %v",
			gravityPackage)
	}
	if !ourVersion.Equal(*requiredVersion) {
		return trace.BadParameter(
			`Current operation plan should be executed with the gravity binary of version %q while this binary is of version %q.
Please use the gravity binary from the upgrade installer tarball to execute the plan, or download appropriate version from Gravity Hub (curl https://get.gravitational.io/telekube/install/%v | bash).
`, requiredVersion, ourVersion, gravityPackage.Version)
	}
	return nil
}
func checkBinaryVersion ( gravityPackage loc . Locator ) error { ourVersion , err := semver . NewVersion ( version . Get ( ) . Version ) if err != nil { return trace . Wrap ( err , " " , version . Get ( ) . Version ) } requiredVersion , err := gravityPackage . SemVer ( ) if err != nil { return trace . Wrap ( err , " " , gravityPackage ) } if ! ourVersion . Equal ( * requiredVersion ) { return trace . BadParameter ( `Current operation plan should be executed with the gravity binary of version %q while this binary is of version %q.

Please use the gravity binary from the upgrade installer tarball to execute the plan, or download appropriate version from Gravity Hub (curl https://get.gravitational.io/telekube/install/%v | bash).
` , requiredVersion , ourVersion , gravityPackage . Version ) } return nil }
checkBinaryVersion makes sure that the plan phase is being executed with
the proper gravity binary
checkBinaryVersion makes sure that the plan phase is being executed with the proper gravity binary