A golang package for comparing and working with k0s version numbers

version

A go-language package for managing k0s version numbers. It is based on hashicorp/go-version but adds sorting and comparison capabilities for the k0s version numbering scheme which requires additional sorting by the build tag.

Usage

Basic comparison

import (
  "fmt"
  "github.com/k0sproject/version"
)

func main() {
  a := version.NewVersion("1.23.3+k0s.1")
  b := version.NewVersion("1.23.3+k0s.2")
  fmt.Println("a is greater than b: %t", a.GreaterThan(b))
  fmt.Println("a is less than b: %t", a.LessThan(b))
  fmt.Println("a is equal to b: %t", a.Equal(b))
}

Outputs:

a is greater than b: false
a is less than b: true
a is equal to b: false

Check online for latest version

import (
  "fmt"
  "github.com/k0sproject/version"
)

func main() {
  latest, err := version.LatestStableRelease()
  if err != nil {
    panic(err)
  }
  fmt.Println("Latest k0s version is: %s", latest)
}
Owner
k0s - The Zero Friction Kubernetes by Team Lens
k0s - The Zero Friction Kubernetes by Team Lens
Similar Resources

A library containing useful functions for working with Go types.

Go Type Tools A library containing useful functions for working with Go types. Table of Contents Reasoning Examples Array Map Int String Usage License

Feb 18, 2022

Go version manager. Super simple tool to install and manage Go versions. Install go without root. Gobrew doesn't require shell rehash.

gobrew Go version manager Install or update With curl $ curl -sLk https://git.io/gobrew | sh - or with go $ go get -u github.com/kevincobain2000/gobre

Jan 5, 2023

Semantic version generator using git commit keywords and overrides

Semantic version generator Project created overnight, to prove that management of semantic versioning is NOT painful and do not require arguments and

Jan 1, 2023

Go Version Manager

gvm By Josh Bussdieker (jbuss, jaja, jbussdieker) while working at Moovweb Currently lovingly maintained by Benjamin Knigge Pull requests and other an

Jan 2, 2023

A live-updating version of the UNIX wc command.

A live-updating version of the UNIX wc command.

lwc A live-updating version of the UNIX wc command. Installation You can get a prebuilt binary for every major platform from the Releases page. Just e

Jul 26, 2022

A tool to restart a Docker container with a newer version of the image

repull A tool to restart a Docker container with a newer version of an image used by the container Often you may need to pull a newer version of an im

Nov 28, 2022

Mutagen Compose is a modified version of Docker Compose that offers automated integration with Mutagen.

Mutagen Compose Mutagen Compose is a (minimally) modified version of Docker Compose that offers automated integration with Mutagen. This allows you to

Dec 22, 2022

Transform latin letters to runes & vice versa. Go version.

Riimut Transform latin letters to runes & vice versa. Go version. Includes transformers for four main runic alphabets: Elder Futhark Younger Futhark M

Aug 2, 2022

Minified version of Project Sherlock written in GO

Minified version of Project Sherlock written in GO

Dec 19, 2022
Bump-version - Bump a given semantic version, following a given version fragment

bump-version Bump a given semantic version, following a given version fragment.

Feb 7, 2022
APKrash is an Android APK security analysis toolkit focused on comparing APKs to detect tampering and repackaging.
 APKrash is an Android APK security analysis toolkit focused on comparing APKs to detect tampering and repackaging.

APKrash APKrash is an Android APK security analysis toolkit focused on comparing APKs to detect tampering and repackaging. Features Able to analyze pu

Nov 8, 2022
library for working with github api, written in Golang

gitdata library for working with github api, written in Golang Example: get user data package main import ( "fmt" "log" "github.com/a1excoder/git

May 19, 2022
Gologin is Golang (Go) login manager working with RDBMS Databases
Gologin is Golang (Go) login manager working with RDBMS Databases

What is Gologin Gologin is an easy to setup professional login manager for Go web applications. It helps you protect your application resources from u

Aug 28, 2022
Working towards a control plane for the MiCo Tool and the MiCoProxy

A simple control plane for MiCo This is still largely a work in progress The overall idea is to build a kubernetes DaemonSet that watches kubernetes s

May 4, 2022
Automated-gke-cilium-networkpolicy-demo - Quickly provision and tear down a GKE cluster with Cilium enabled for working with Network Policy.

Automated GKE Network Policy Demo Before running the automation, make sure you have the correct variables in env-automation/group_vars/all.yaml. There

Jan 1, 2022
"go build" wrapper to add version info to Golang applications

govvv The simple Go binary versioning tool that wraps the go build command. Stop worrying about -ldflags and go get github.com/ahmetb/govvv now. Build

Dec 16, 2022
"go build" wrapper to add version info to Golang applications

govvv The simple Go binary versioning tool that wraps the go build command. Stop worrying about -ldflags and go get github.com/ahmetb/govvv now. Build

Dec 16, 2022
MenuStart plugin to nwg-panel, also capable of working standalone
MenuStart plugin to nwg-panel, also capable of working standalone

nwg-menu This code provides the MenuStart plugin to nwg-panel. It also may be used standalone, however, with a little help from command line arguments

Sep 9, 2022
Additional Terraform resources for working with AWS KMS

This is a (hopefully temporary) Terraform provider for working with AWS KMS, particularly for generating data keys. It attempts to correct a deficienc

Nov 29, 2021