Documentation ¶
Overview ¶
* Copyright (c) 2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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.
* Copyright (c) 2024. Devtron Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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.
Index ¶
- Constants
- func ConvertConfigToProxyConfig(config *client.RemoteConnectionConfig) *bean.ProxyConfig
- func ConvertConfigToSSHTunnelConfig(config *client.RemoteConnectionConfig) *bean.SSHTunnelConfig
- func IsReleaseNotFoundInCacheError(err error) bool
- func NewDeployedAppDetail(config *client.ClusterConfig, release *release.Release) *client.DeployedAppDetail
- func NewRegistryConfig(credential *client.RegistryCredential) (*registry.Configuration, error)
- func TrimSchemeFromURL(registryUrl string) string
- type HelmAppService
- type HelmAppServiceImpl
- func (impl HelmAppServiceImpl) BuildAppDetail(req *client.AppDetailRequest) (*bean.AppDetail, error)
- func (impl *HelmAppServiceImpl) CleanDir(dir string)
- func (impl *HelmAppServiceImpl) FetchApplicationStatus(req *client.AppDetailRequest) (*client.AppStatus, error)
- func (impl *HelmAppServiceImpl) GetApplicationListForCluster(config *client.ClusterConfig) *client.DeployedAppList
- func (impl *HelmAppServiceImpl) GetDeploymentDetail(request *client.DeploymentDetailRequest) (*client.DeploymentDetailResponse, error)
- func (impl *HelmAppServiceImpl) GetDeploymentHistory(req *client.AppDetailRequest) (*client.HelmAppDeploymentHistory, error)
- func (impl *HelmAppServiceImpl) GetDesiredManifest(req *client.ObjectRequest) (*client.DesiredManifestResponse, error)
- func (impl *HelmAppServiceImpl) GetHelmAppValues(req *client.AppDetailRequest) (*client.ReleaseInfo, error)
- func (impl *HelmAppServiceImpl) GetNatsMessageForHelmInstallError(ctx context.Context, ...) (string, error)
- func (impl *HelmAppServiceImpl) GetNatsMessageForHelmInstallSuccess(helmInstallMessage commonHelmService.HelmReleaseStatusConfig) (string, error)
- func (impl *HelmAppServiceImpl) GetNotes(ctx context.Context, request *client.InstallReleaseRequest) (string, error)
- func (impl *HelmAppServiceImpl) GetRandomString() string
- func (impl *HelmAppServiceImpl) GetReleaseDetails(ctx context.Context, releaseIdentifier *client.ReleaseIdentifier) (*client.DeployedAppDetail, error)
- func (impl HelmAppServiceImpl) GetResourceTreeForExternalResources(req *client.ExternalResourceTreeRequest) (*bean.ResourceTreeResponse, error)
- func (impl *HelmAppServiceImpl) InstallRelease(ctx context.Context, request *client.InstallReleaseRequest) (*client.InstallReleaseResponse, error)
- func (impl *HelmAppServiceImpl) InstallReleaseWithCustomChart(ctx context.Context, request *client.HelmInstallCustomRequest) (bool, error)
- func (impl *HelmAppServiceImpl) IsReleaseInstalled(ctx context.Context, releaseIdentifier *client.ReleaseIdentifier) (bool, error)
- func (impl *HelmAppServiceImpl) PushHelmChartToOCIRegistryRepo(ctx context.Context, OCIRegistryRequest *client.OCIRegistryRequest) (*client.OCIRegistryResponse, error)
- func (impl *HelmAppServiceImpl) RollbackRelease(request *client.RollbackReleaseRequest) (bool, error)
- func (impl *HelmAppServiceImpl) ScaleObjects(ctx context.Context, clusterConfig *client.ClusterConfig, ...) (*client.HibernateResponse, error)
- func (impl *HelmAppServiceImpl) TemplateChart(ctx context.Context, request *client.InstallReleaseRequest, getChart bool) (string, []byte, error)
- func (impl *HelmAppServiceImpl) TemplateChartBulk(ctx context.Context, request []*client.InstallReleaseRequest) (map[string]string, error)
- func (impl *HelmAppServiceImpl) UninstallRelease(releaseIdentifier *client.ReleaseIdentifier) (*client.UninstallReleaseResponse, error)
- func (impl *HelmAppServiceImpl) UpgradeRelease(ctx context.Context, request *client.UpgradeReleaseRequest) (*client.UpgradeReleaseResponse, error)
- func (impl *HelmAppServiceImpl) UpgradeReleaseWithChartInfo(ctx context.Context, request *client.InstallReleaseRequest) (*client.UpgradeReleaseResponse, error)
- func (impl *HelmAppServiceImpl) UpgradeReleaseWithCustomChart(ctx context.Context, request *client.UpgradeReleaseRequest) (bool, error)
- func (impl *HelmAppServiceImpl) ValidateOCIRegistryLogin(ctx context.Context, OCIRegistryRequest *client.RegistryCredential) (*client.OCIRegistryResponse, error)
Constants ¶
const ( ReadmeFileName = "README.md" REGISTRY_TYPE_ECR = "ecr" REGISTRYTYPE_GCR = "gcr" REGISTRYTYPE_ARTIFACT_REGISTRY = "artifact-registry" JSON_KEY_USERNAME string = "_json_key" HELM_CLIENT_ERROR = "Error in creating Helm client" RELEASE_INSTALLED = "Release Installed" )
const (
DirCreatingError = "err in creating dir"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertConfigToProxyConfig ¶
func ConvertConfigToProxyConfig(config *client.RemoteConnectionConfig) *bean.ProxyConfig
func ConvertConfigToSSHTunnelConfig ¶
func ConvertConfigToSSHTunnelConfig(config *client.RemoteConnectionConfig) *bean.SSHTunnelConfig
func NewDeployedAppDetail ¶
func NewDeployedAppDetail(config *client.ClusterConfig, release *release.Release) *client.DeployedAppDetail
func NewRegistryConfig ¶
func NewRegistryConfig(credential *client.RegistryCredential) (*registry.Configuration, error)
func TrimSchemeFromURL ¶
Types ¶
type HelmAppService ¶
type HelmAppService interface { GetApplicationListForCluster(config *client.ClusterConfig) *client.DeployedAppList BuildAppDetail(req *client.AppDetailRequest) (*bean.AppDetail, error) FetchApplicationStatus(req *client.AppDetailRequest) (*client.AppStatus, error) GetHelmAppValues(req *client.AppDetailRequest) (*client.ReleaseInfo, error) ScaleObjects(ctx context.Context, clusterConfig *client.ClusterConfig, requests []*client.ObjectIdentifier, scaleDown bool) (*client.HibernateResponse, error) GetDeploymentHistory(req *client.AppDetailRequest) (*client.HelmAppDeploymentHistory, error) GetDesiredManifest(req *client.ObjectRequest) (*client.DesiredManifestResponse, error) UninstallRelease(releaseIdentifier *client.ReleaseIdentifier) (*client.UninstallReleaseResponse, error) UpgradeRelease(ctx context.Context, request *client.UpgradeReleaseRequest) (*client.UpgradeReleaseResponse, error) GetDeploymentDetail(request *client.DeploymentDetailRequest) (*client.DeploymentDetailResponse, error) InstallRelease(ctx context.Context, request *client.InstallReleaseRequest) (*client.InstallReleaseResponse, error) UpgradeReleaseWithChartInfo(ctx context.Context, request *client.InstallReleaseRequest) (*client.UpgradeReleaseResponse, error) IsReleaseInstalled(ctx context.Context, releaseIdentifier *client.ReleaseIdentifier) (bool, error) RollbackRelease(request *client.RollbackReleaseRequest) (bool, error) TemplateChart(ctx context.Context, request *client.InstallReleaseRequest, getChart bool) (string, []byte, error) TemplateChartBulk(ctx context.Context, request []*client.InstallReleaseRequest) (map[string]string, error) InstallReleaseWithCustomChart(ctx context.Context, req *client.HelmInstallCustomRequest) (bool, error) GetNotes(ctx context.Context, installReleaseRequest *client.InstallReleaseRequest) (string, error) UpgradeReleaseWithCustomChart(ctx context.Context, request *client.UpgradeReleaseRequest) (bool, error) // ValidateOCIRegistryLogin Validates the OCI registry credentials by login ValidateOCIRegistryLogin(ctx context.Context, OCIRegistryRequest *client.RegistryCredential) (*client.OCIRegistryResponse, error) // PushHelmChartToOCIRegistryRepo Pushes the helm chart to the OCI registry and returns the generated digest and pushedUrl PushHelmChartToOCIRegistryRepo(ctx context.Context, OCIRegistryRequest *client.OCIRegistryRequest) (*client.OCIRegistryResponse, error) GetResourceTreeForExternalResources(req *client.ExternalResourceTreeRequest) (*bean.ResourceTreeResponse, error) GetReleaseDetails(ctx context.Context, releaseIdentifier *client.ReleaseIdentifier) (*client.DeployedAppDetail, error) }
type HelmAppServiceImpl ¶
type HelmAppServiceImpl struct { K8sInformer k8sInformer.K8sInformer // contains filtered or unexported fields }
func NewHelmAppServiceImpl ¶
func NewHelmAppServiceImpl(logger *zap.SugaredLogger, k8sService commonHelmService.K8sService, k8sInformer k8sInformer.K8sInformer, helmReleaseConfig *globalConfig.HelmReleaseConfig, k8sUtil k8sUtils.K8sService, converter converter.ClusterBeanConverter, clusterRepository repository.ClusterRepository, common commonHelmService.CommonHelmService, registrySettings registry2.SettingsFactory) (*HelmAppServiceImpl, error)
func (HelmAppServiceImpl) BuildAppDetail ¶
func (impl HelmAppServiceImpl) BuildAppDetail(req *client.AppDetailRequest) (*bean.AppDetail, error)
func (*HelmAppServiceImpl) CleanDir ¶
func (impl *HelmAppServiceImpl) CleanDir(dir string)
func (*HelmAppServiceImpl) FetchApplicationStatus ¶
func (impl *HelmAppServiceImpl) FetchApplicationStatus(req *client.AppDetailRequest) (*client.AppStatus, error)
func (*HelmAppServiceImpl) GetApplicationListForCluster ¶
func (impl *HelmAppServiceImpl) GetApplicationListForCluster(config *client.ClusterConfig) *client.DeployedAppList
func (*HelmAppServiceImpl) GetDeploymentDetail ¶
func (impl *HelmAppServiceImpl) GetDeploymentDetail(request *client.DeploymentDetailRequest) (*client.DeploymentDetailResponse, error)
func (*HelmAppServiceImpl) GetDeploymentHistory ¶
func (impl *HelmAppServiceImpl) GetDeploymentHistory(req *client.AppDetailRequest) (*client.HelmAppDeploymentHistory, error)
func (*HelmAppServiceImpl) GetDesiredManifest ¶
func (impl *HelmAppServiceImpl) GetDesiredManifest(req *client.ObjectRequest) (*client.DesiredManifestResponse, error)
func (*HelmAppServiceImpl) GetHelmAppValues ¶
func (impl *HelmAppServiceImpl) GetHelmAppValues(req *client.AppDetailRequest) (*client.ReleaseInfo, error)
func (*HelmAppServiceImpl) GetNatsMessageForHelmInstallError ¶
func (impl *HelmAppServiceImpl) GetNatsMessageForHelmInstallError(ctx context.Context, helmInstallMessage commonHelmService.HelmReleaseStatusConfig, releaseIdentifier *client.ReleaseIdentifier, installationErr error) (string, error)
func (*HelmAppServiceImpl) GetNatsMessageForHelmInstallSuccess ¶
func (impl *HelmAppServiceImpl) GetNatsMessageForHelmInstallSuccess(helmInstallMessage commonHelmService.HelmReleaseStatusConfig) (string, error)
func (*HelmAppServiceImpl) GetNotes ¶
func (impl *HelmAppServiceImpl) GetNotes(ctx context.Context, request *client.InstallReleaseRequest) (string, error)
func (*HelmAppServiceImpl) GetRandomString ¶
func (impl *HelmAppServiceImpl) GetRandomString() string
func (*HelmAppServiceImpl) GetReleaseDetails ¶
func (impl *HelmAppServiceImpl) GetReleaseDetails(ctx context.Context, releaseIdentifier *client.ReleaseIdentifier) (*client.DeployedAppDetail, error)
func (HelmAppServiceImpl) GetResourceTreeForExternalResources ¶
func (impl HelmAppServiceImpl) GetResourceTreeForExternalResources(req *client.ExternalResourceTreeRequest) (*bean.ResourceTreeResponse, error)
func (*HelmAppServiceImpl) InstallRelease ¶
func (impl *HelmAppServiceImpl) InstallRelease(ctx context.Context, request *client.InstallReleaseRequest) (*client.InstallReleaseResponse, error)
func (*HelmAppServiceImpl) InstallReleaseWithCustomChart ¶
func (impl *HelmAppServiceImpl) InstallReleaseWithCustomChart(ctx context.Context, request *client.HelmInstallCustomRequest) (bool, error)
func (*HelmAppServiceImpl) IsReleaseInstalled ¶
func (impl *HelmAppServiceImpl) IsReleaseInstalled(ctx context.Context, releaseIdentifier *client.ReleaseIdentifier) (bool, error)
func (*HelmAppServiceImpl) PushHelmChartToOCIRegistryRepo ¶
func (impl *HelmAppServiceImpl) PushHelmChartToOCIRegistryRepo(ctx context.Context, OCIRegistryRequest *client.OCIRegistryRequest) (*client.OCIRegistryResponse, error)
func (*HelmAppServiceImpl) RollbackRelease ¶
func (impl *HelmAppServiceImpl) RollbackRelease(request *client.RollbackReleaseRequest) (bool, error)
func (*HelmAppServiceImpl) ScaleObjects ¶
func (impl *HelmAppServiceImpl) ScaleObjects(ctx context.Context, clusterConfig *client.ClusterConfig, objects []*client.ObjectIdentifier, scaleDown bool) (*client.HibernateResponse, error)
func (*HelmAppServiceImpl) TemplateChart ¶
func (impl *HelmAppServiceImpl) TemplateChart(ctx context.Context, request *client.InstallReleaseRequest, getChart bool) (string, []byte, error)
func (*HelmAppServiceImpl) TemplateChartBulk ¶
func (impl *HelmAppServiceImpl) TemplateChartBulk(ctx context.Context, request []*client.InstallReleaseRequest) (map[string]string, error)
func (*HelmAppServiceImpl) UninstallRelease ¶
func (impl *HelmAppServiceImpl) UninstallRelease(releaseIdentifier *client.ReleaseIdentifier) (*client.UninstallReleaseResponse, error)
func (*HelmAppServiceImpl) UpgradeRelease ¶
func (impl *HelmAppServiceImpl) UpgradeRelease(ctx context.Context, request *client.UpgradeReleaseRequest) (*client.UpgradeReleaseResponse, error)
func (*HelmAppServiceImpl) UpgradeReleaseWithChartInfo ¶
func (impl *HelmAppServiceImpl) UpgradeReleaseWithChartInfo(ctx context.Context, request *client.InstallReleaseRequest) (*client.UpgradeReleaseResponse, error)
func (*HelmAppServiceImpl) UpgradeReleaseWithCustomChart ¶
func (impl *HelmAppServiceImpl) UpgradeReleaseWithCustomChart(ctx context.Context, request *client.UpgradeReleaseRequest) (bool, error)
func (*HelmAppServiceImpl) ValidateOCIRegistryLogin ¶
func (impl *HelmAppServiceImpl) ValidateOCIRegistryLogin(ctx context.Context, OCIRegistryRequest *client.RegistryCredential) (*client.OCIRegistryResponse, error)