package upgrade
import "github.com/oslokommune/okctl/pkg/upgrade"
Package upgrade knows how to upgrade okctl
Index ¶
- Constants
- Variables
- func ToUpgradeVersion(tagName string) string
- type ChecksumDownloader
- type ChecksumHTTPDownloader
- func NewChecksumDownloader() ChecksumHTTPDownloader
- func (c ChecksumHTTPDownloader) Download(checksumAsset *github.ReleaseAsset) ([]byte, error)
- type FetcherOpts
- type GithubReleaseParser
- func NewGithubReleaseParser(checksumDownloader ChecksumDownloader) GithubReleaseParser
- func (g GithubReleaseParser) ToUpgradeBinaries(releases []*github.RepositoryRelease) ([]okctlUpgradeBinary, error)
- type Opts
- type Upgrader
Constants ¶
const ( // DotCountForRegularSemver contains the amount of dots in a regular semver version DotCountForRegularSemver = 3 // DotCountForSemverWithHotfix contains the amount of dots in a semver plus hotfix version DotCountForSemverWithHotfix = 4 )
const ( // ChecksumsTxt contains the file name of the checksum file asset in a Github release ChecksumsTxt = "okctl-upgrade-checksums.txt" )
const DocumentationURL = "https://okctl.io/getting-started/upgrading"
DocumentationURL is the URL to the upgrade documentation
const OkctlUpgradeRepo = "okctl-upgrade"
OkctlUpgradeRepo contains the repository for upgrades
Variables ¶
var OkctlUpgradeRepoURL = fmt.Sprintf("https://github.com/oslokommune/%s", OkctlUpgradeRepo) //nolint:gochecknoglobals
OkctlUpgradeRepoURL contains URL for the upgrade repository
Functions ¶
func ToUpgradeVersion ¶
ToUpgradeVersion converts a git tag to an upgrade version
Types ¶
type ChecksumDownloader ¶
type ChecksumDownloader interface { Download(checksumAsset *github.ReleaseAsset) ([]byte, error) }
ChecksumDownloader knows how to download the checksums for a github release asset
type ChecksumHTTPDownloader ¶
type ChecksumHTTPDownloader struct{}
ChecksumHTTPDownloader knows how to download the checksums for a github release asset through HTTP
func NewChecksumDownloader ¶
func NewChecksumDownloader() ChecksumHTTPDownloader
NewChecksumDownloader returns a new ChecksumHTTPDownloader
func (ChecksumHTTPDownloader) Download ¶
func (c ChecksumHTTPDownloader) Download(checksumAsset *github.ReleaseAsset) ([]byte, error)
Download downloads the given checksum asset1
type FetcherOpts ¶
FetcherOpts contains data needed to initialize a fetch.Provider
type GithubReleaseParser ¶
type GithubReleaseParser struct {
// contains filtered or unexported fields
}
GithubReleaseParser parses Github releases
func NewGithubReleaseParser ¶
func NewGithubReleaseParser(checksumDownloader ChecksumDownloader) GithubReleaseParser
NewGithubReleaseParser returns a new GithubReleaseParser
func (GithubReleaseParser) ToUpgradeBinaries ¶
func (g GithubReleaseParser) ToUpgradeBinaries(releases []*github.RepositoryRelease) ([]okctlUpgradeBinary, error)
ToUpgradeBinaries converts the provided github releases to okctl upgrade binaries
type Opts ¶
type Opts struct { Debug bool AutoConfirm bool Logger *logrus.Logger Out io.Writer RepositoryDirectory string GithubService client.GithubService ChecksumDownloader ChecksumHTTPDownloader ClusterVersioner clusterversion.Versioner OriginalClusterVersioner originalclusterversion.Versioner Surveyor survey.Surveyor FetcherOpts FetcherOpts OkctlVersion string State client.UpgradeState ClusterID api.ID BinaryEnvironmentVariables map[string]string }
Opts contains all data needed to create an Upgrader
func (Opts) Validate ¶
Validate validates the given parameters
type Upgrader ¶
type Upgrader struct {
// contains filtered or unexported fields
}
Upgrader knows how to upgrade okctl
func New ¶
New returns a new Upgrader, or an error if initialization fails
func (Upgrader) Run ¶
Run upgrades okctl
Source Files ¶
binary_provider.go checksum_downloader.go filter.go github_release_parser.go okctl_ugrade_binary.go parse_file_name.go upgrade.go upgrade_binary_version.go
Directories ¶
Path | Synopsis |
---|---|
pkg/upgrade/clusterversion | Package clusterversion manages the cluster version |
pkg/upgrade/originalclusterversion | Package originalclusterversion knows how to save the original version of a cluster |
pkg/upgrade/survey | Package survey knows how to get input from the user |
pkg/upgrade/testutils | Package testutils provides test utilities for upgrade |
- Version
- v0.0.106 (latest)
- Published
- Oct 21, 2022
- Platform
- linux/amd64
- Imports
- 28 packages
- Last checked
- 2 days ago –
Tools for package owners.