cli

package
v0.0.0-...-07865b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

The MIT License (MIT)

Copyright (c) 2022-2023 Reliza Incorporated (Reliza (tm), https://reliza.io)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The MIT License (MIT)

Copyright (c) 2022-2023 Reliza Incorporated (Reliza (tm), https://reliza.io)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The MIT License (MIT)

Copyright (c) 2022-2023 Reliza Incorporated (Reliza (tm), https://reliza.io)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The MIT License (MIT)

Copyright (c) 2022-2023 Reliza Incorporated (Reliza (tm), https://reliza.io)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const (
	ShellToUse   = "sh"
	KubesealApp  = "tools/kubeseal"
	RelizaCliApp = "tools/reliza-cli"
	HelmMimeType = "application/vnd.cncf.helm.config.v1+json"
)
View Source
const (
	StandaloneMode   = "STANDALONE"
	ExistingArgoMode = "EXISTING_ARGO"
	NewArgoMode      = "NEW_ARGO"
)
View Source
const (
	HelmApp               = "tools/helm"
	KubectlApp            = "tools/kubectl"
	WorkValues            = "work-values.yaml"
	ValuesDiff            = "values-diff.yaml"
	ValuesDiffPrev        = "values-diff-prev.yaml"
	LastVersionFile       = "last_version"
	InstallValues         = "install-values.yaml"
	RecordedDeloyedData   = "recorded-deployed-data.json"
	WatcherHelmDataSuffix = "-watcher-helm.json"
	CustomValuesFile      = "reliza-hub-custom-values.yaml"
)

Variables

View Source
var (
	SecretsNamespace string
	RelizaNamespace  string

	EnvMode string
)

Functions

func CreateNamespaceIfMissing

func CreateNamespaceIfMissing(namespace string)

func DeleteObsoleteDeployment

func DeleteObsoleteDeployment(groupPath string)

func DownloadHelmChart

func DownloadHelmChart(path string, rd *RelizaDeployment, pa *ProjectAuth, helmRepoInfo HelmRepoInfo) error

func ExtractRlzDigestFromCdxDigest

func ExtractRlzDigestFromCdxDigest(cdxHash cdx.Hash) string

func GetChartNameFromDeployment

func GetChartNameFromDeployment(rd *RelizaDeployment) string

func GetInstanceCycloneDX

func GetInstanceCycloneDX() (string, error)

func GetLastHelmVersion

func GetLastHelmVersion(groupPath string) string

func GetSealedCert

func GetSealedCert() string

func InstallApplication

func InstallApplication(groupPath string, rd *RelizaDeployment) error

func InstallHelmChart

func InstallHelmChart(groupPath string, rd *RelizaDeployment) error

func InstallSealedCertificates

func InstallSealedCertificates()

func InstallWatcher

func InstallWatcher(namespacesForWatcher *map[string]bool)

func IsFirstArgoInstallDone

func IsFirstArgoInstallDone(rd *RelizaDeployment) bool

func IsFirstHelmInstallDone

func IsFirstHelmInstallDone(rd *RelizaDeployment) bool

func IsFirstInstallDone

func IsFirstInstallDone(rd *RelizaDeployment) bool

func IsValuesDiff

func IsValuesDiff(groupPath string) bool

func KubectlApply

func KubectlApply(path string)

func MergeHelmValues

func MergeHelmValues(groupPath string, rd *RelizaDeployment) error

func ProduceArgoApplicationYaml

func ProduceArgoApplicationYaml(w io.Writer, rd *RelizaDeployment, namespace, groupPath string) error

func ProduceEcrSecretYaml

func ProduceEcrSecretYaml(w io.Writer, rd *RelizaDeployment, projAuth ProjectAuth, namespace string)

func ProduceNoCredSecretYaml

func ProduceNoCredSecretYaml(w io.Writer, rd *RelizaDeployment, projAuth ProjectAuth, namespace string, helmInfo HelmRepoInfo)

func ProducePlainSecretYaml

func ProducePlainSecretYaml(w io.Writer, rd *RelizaDeployment, projAuth ProjectAuth, namespace string, helmInfo HelmRepoInfo)

func ProduceSecretYaml

func ProduceSecretYaml(w io.Writer, rd *RelizaDeployment, projAuth ProjectAuth, namespace string, helmInfo HelmRepoInfo)

func RecordDeployedData

func RecordDeployedData(groupPath string, rd *RelizaDeployment)

func RecordHelmChartVersion

func RecordHelmChartVersion(groupPath string, rd *RelizaDeployment)

func ReplaceTagsForDiff

func ReplaceTagsForDiff(groupPath string, namespace string) error

func ReplaceTagsForInstall

func ReplaceTagsForInstall(groupPath string, namespace string) error

func ResolvePreviousDiffFile

func ResolvePreviousDiffFile(groupPath string) error

func SetHelmChartAppVersion

func SetHelmChartAppVersion(groupPath string, rd *RelizaDeployment) error

func SetSealedCertificateOnTheHub

func SetSealedCertificateOnTheHub(cert string)

func StreamHelmChartMetadataToHub

func StreamHelmChartMetadataToHub(ppn *PathsPerNamespace)

func WaitUntilSecretCreated

func WaitUntilSecretCreated(name string, namespace string)

Types

type ArgoApplicationTemplateResolver

type ArgoApplicationTemplateResolver struct {
	Name                string
	ArgoNamespace       string
	ReleaseNamespace    string
	HelmChartName       string
	MegedValuesFromFile string
	ChartUri            string
	Version             string
}

type ArgoInfo

type ArgoInfo struct {
	IsArgoDetected bool
	IsArgoEnabled  bool
	ArgoNamespace  string
}

type HelmRepoInfo

type HelmRepoInfo struct {
	ChartName string
	RepoUri   string
	RepoHost  string
	UseOci    bool
	OciUri    string
}

func GetHelmRepoInfoFromDeployment

func GetHelmRepoInfoFromDeployment(rd *RelizaDeployment) HelmRepoInfo

type NamespaceImages

type NamespaceImages struct {
	Namespace string
	Images    string
}

type PathsPerNamespace

type PathsPerNamespace struct {
	Namespace string
	Paths     []string
	// contains filtered or unexported fields
}

type ProjectAuth

type ProjectAuth struct {
	Login    string `json:"login"`
	Password string `json:"password"`
	Type     string `json:"type"`
	Url      string
}

func GetProjectAuthByArtifactDigest

func GetProjectAuthByArtifactDigest(artDigest, releaseNamespace string) ProjectAuth

func ResolveHelmAuthSecret

func ResolveHelmAuthSecret(secretName string) ProjectAuth

type RelizaDeployment

type RelizaDeployment struct {
	Name       string
	Namespace  string
	Bundle     string
	ArtUri     string
	ArtVersion string
	ArtHash    cdx.Hash
	ConfigFile string
	AppVersion string
}

func ParseInstanceCycloneDXIntoDeployments

func ParseInstanceCycloneDXIntoDeployments(cyclonedxManifest string) []RelizaDeployment

type ResolvedProperty

type ResolvedProperty struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ResolvedSecret

type ResolvedSecret struct {
	Secret    string `json:"value"`
	Timestamp int64  `json:"lastUpdated"`
	Key       string `json:"key"`
}

type SecretPropsCliResponse

type SecretPropsCliResponse struct {
	Secrets    []ResolvedSecret   `json:"secrets"`
	Properties []ResolvedProperty `json:"properties"`
}

type SecretTemplateResolver

type SecretTemplateResolver struct {
	Name       string
	Namespace  string
	Username   string
	Password   string
	Url        string
	NameBase64 string
	EnableOci  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL