package core

import "github.com/oslokommune/okctl/pkg/client/core"

Package core implements the business logic layer for the client-side

Index

Functions

func GetAssociatedClustersCount

func GetAssociatedClustersCount(fs *afero.Afero, absoluteRepositoryRootDir string, clusterContext v1alpha1.Cluster, app v1alpha1.Application) (int, error)

GetAssociatedClustersCount knows how to count the number of associated clusters a specific application has. A cluster is classified as associated if and only if the cluster has an ArgoCD application referencing the app and the app has an overlay folder referencing the cluster.

func NewAWSLoadBalancerControllerService

func NewAWSLoadBalancerControllerService(
	policy client.ManagedPolicyService,
	account client.ServiceAccountService,
	helm client.HelmService,
) client.AWSLoadBalancerControllerService

NewAWSLoadBalancerControllerService returns an initialised service

func NewApplicationManifestService

func NewApplicationManifestService(fs *afero.Afero, absoluteOutputDirectory string) client.ApplicationManifestService

NewApplicationManifestService initializes an Application Manifest Service

func NewApplicationPostgresService

func NewApplicationPostgresService(
	manifestService client.ApplicationManifestService,
	pgService client.ComponentService,
	sgService api.SecurityGroupService,
	vpcService client.VPCService,
	kubeService api.KubeService,
	clusterService client.ClusterService,
) client.ApplicationPostgresService

NewApplicationPostgresService initializes a ApplicationPostgresService

func NewApplicationService

func NewApplicationService(
	fs *afero.Afero,
	kubectlClient kubectl.Client,
	appManifestService client.ApplicationManifestService,
	absoluteRepositoryDir string,
	gitRemoteFileDeleter client.GitRemoteFileDeleter,
) client.ApplicationService

NewApplicationService initializes a new Scaffold application service

func NewArgoCDService

func NewArgoCDService(opts NewArgoCDServiceOpts) client.ArgoCDService

NewArgoCDService returns an initialised service

func NewAutoscalerService

NewAutoscalerService returns an initialised service

func NewBlockstorageService

NewBlockstorageService returns an initialised service

func NewCertificateService

func NewCertificateService(
	service api.CertificateService,
	state client.CertificateState,
) client.CertificateService

NewCertificateService returns an initialised service

func NewClusterService

func NewClusterService(
	service api.ClusterService,
	state client.ClusterState,
	provider v1alpha1.CloudProvider,
	auth aws.Authenticator,
) client.ClusterService

NewClusterService returns an initialised cluster service

func NewComponentService

func NewComponentService(
	service api.ComponentService,
	state client.ComponentState,
	manifest client.ManifestService,
	provider v1alpha1.CloudProvider,
) client.ComponentService

NewComponentService returns an initialised component service

func NewContainerRepositoryService

NewContainerRepositoryService returns an initialised container repository service

func NewDomainService

func NewDomainService(service api.DomainService, state client.DomainState) client.DomainService

NewDomainService returns an initialised service

func NewExternalDNSService

NewExternalDNSService returns an initialised service

func NewExternalSecretsService

func NewExternalSecretsService(
	policy client.ManagedPolicyService,
	account client.ServiceAccountService,
	helm client.HelmService,
) client.ExternalSecretsService

NewExternalSecretsService returns an initialised service

func NewGithubService

func NewGithubService(parameterService api.ParameterService, githubClient github.Github, state client.GithubState) client.GithubService

NewGithubService returns an initialised service

func NewHelmService

func NewHelmService(service api.HelmService, state client.HelmState) client.HelmService

NewHelmService returns an initialised helm service

func NewIdentityManagerService

NewIdentityManagerService returns an initialised service

func NewManagedPolicyService

func NewManagedPolicyService(
	service api.ManagedPolicyService,
	state client.ManagedPolicyState,
) client.ManagedPolicyService

NewManagedPolicyService returns an initialised service

func NewManifestService

func NewManifestService(service api.KubeService, state client.ManifestState) client.ManifestService

NewManifestService returns an initialised service

func NewMonitoringService

func NewMonitoringService(opts NewMonitoringServiceOpts) client.MonitoringService

NewMonitoringService returns an initialised service

func NewNameserverHandlerService

func NewNameserverHandlerService(githubAPI github.Githuber) client.NSRecordDelegationService

NewNameserverHandlerService initializes a new NSRecordDelegationService

func NewParameterService

func NewParameterService(
	service api.ParameterService,
	state client.ParameterState,
) client.ParameterService

NewParameterService returns an initialised service

func NewRemoteStateService

func NewRemoteStateService(kvAPI api.KeyValueStoreService, objectAPI api.ObjectStorageService) client.RemoteStateService

NewRemoteStateService returns an initialized RemoteStateService

func NewServiceAccountService

func NewServiceAccountService(
	service api.ServiceAccountService,
	state client.ServiceAccountState,
) client.ServiceAccountService

NewServiceAccountService returns an initialised service

func NewVPCService

func NewVPCService(service api.VpcService, state client.VPCState) client.VPCService

NewVPCService returns an initialised VPC service

Types

type NewArgoCDServiceOpts

type NewArgoCDServiceOpts struct {
	Fs                  *afero.Afero
	BinaryProvider      binaries.Provider
	CredentialsProvider credentials.Provider
	AbsoluteRepoDir     string
	Identity            client.IdentityManagerService
	Cert                client.CertificateService
	Manifest            client.ManifestService
	Param               client.ParameterService
	Helm                client.HelmService
	State               client.ArgoCDState
}

NewArgoCDServiceOpts defines required data for an ArgoCD service

type NewMonitoringServiceOpts

type NewMonitoringServiceOpts struct {
	State                 client.MonitoringState
	Helm                  client.HelmService
	CertificateService    client.CertificateService
	IdentityService       client.IdentityManagerService
	ManifestService       client.ManifestService
	ParameterService      client.ParameterService
	ServiceAccountService client.ServiceAccountService
	PolicyService         client.ManagedPolicyService
	ObjectStorageService  api.ObjectStorageService
	KeyValueStoreService  api.KeyValueStoreService
	Provider              v1alpha1.CloudProvider
}

NewMonitoringServiceOpts contains necessary data for handling monitoring

type Services

type Services struct {
	AWSLoadBalancerControllerService client.AWSLoadBalancerControllerService
	ArgoCD                           client.ArgoCDService
	ApplicationService               client.ApplicationService
	ApplicationManifestService       client.ApplicationManifestService
	ApplicationPostgresService       client.ApplicationPostgresService
	Certificate                      client.CertificateService
	Cluster                          client.ClusterService
	Domain                           client.DomainService
	ExternalDNS                      client.ExternalDNSService
	ExternalSecrets                  client.ExternalSecretsService
	Github                           client.GithubService
	Manifest                         client.ManifestService
	NameserverHandler                client.NSRecordDelegationService
	Parameter                        client.ParameterService
	Vpc                              client.VPCService
	IdentityManager                  client.IdentityManagerService
	Autoscaler                       client.AutoscalerService
	Blockstorage                     client.BlockstorageService
	Monitoring                       client.MonitoringService
	Component                        client.ComponentService
	Helm                             client.HelmService
	ManagedPolicy                    client.ManagedPolicyService
	ServiceAccount                   client.ServiceAccountService
	ContainerRepository              client.ContainerRepositoryService
	RemoteState                      client.RemoteStateService
}

Services contains all client-side services

type StateHandlers

type StateHandlers struct {
	Helm                      client.HelmState
	ManagedPolicy             client.ManagedPolicyState
	ServiceAccount            client.ServiceAccountState
	Certificate               client.CertificateState
	IdentityManager           client.IdentityManagerState
	Github                    client.GithubState
	Manifest                  client.ManifestState
	Vpc                       client.VPCState
	Parameter                 client.ParameterState
	Domain                    client.DomainState
	ExternalDNS               client.ExternalDNSState
	Cluster                   client.ClusterState
	Component                 client.ComponentState
	Monitoring                client.MonitoringState
	ArgoCD                    client.ArgoCDState
	ContainerRepository       client.ContainerRepositoryState
	Loki                      client.LokiState
	Promtail                  client.PromtailState
	Tempo                     client.TempoState
	Autoscaler                client.AutoscalerState
	AWSLoadBalancerController client.AWSLoadBalancerControllerState
	Blockstorage              client.BlockstorageState
	ExternalSecrets           client.ExternalSecretsState
	Upgrade                   client.UpgradeState
	Kubernetes                client.KubernetesState
}

StateHandlers contains the state handlers

type StateNodes

type StateNodes struct {
	ArgoCD              breeze.Client
	Certificate         breeze.Client
	Cluster             breeze.Client
	Domain              breeze.Client
	ExternalDNS         breeze.Client
	Github              breeze.Client
	Manifest            breeze.Client
	Parameter           breeze.Client
	Vpc                 breeze.Client
	IdentityManager     breeze.Client
	Monitoring          breeze.Client
	Component           breeze.Client
	Helm                breeze.Client
	ManagedPolicy       breeze.Client
	ServiceAccount      breeze.Client
	ContainerRepository breeze.Client
	Upgrade             breeze.Client
}

StateNodes contains all state storage nodes

Source Files

doc.go handler_client.go service_application_client.go service_application_manifest_client.go service_application_postgres_client.go service_argocd_client.go service_autoscaler.go service_awsloadbalancercontroller_client.go service_blockstorage.go service_certificate_client.go service_cluster_client.go service_component.go service_container_repository_client.go service_domain_client.go service_externaldns_client.go service_externalsecrets.go service_github.go service_helm_client.go service_identitymanager_client.go service_managedpolicy_client.go service_manifest_client.go service_monitoring_client.go service_nsrecorddelegation_client.go service_parameter_client.go service_remotestate_client.go service_serviceaccount_client.go service_vpc_client.go

Directories

PathSynopsis
pkg/client/core/state
pkg/client/core/state/directPackage direct contains functionality for retrieving state directly from the source
pkg/client/core/state/stormPackage storm implements a state layer using the storm library
pkg/client/core/store
pkg/client/core/store/filesystemPackage filesystem interacts with the file system
Version
v0.0.106 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
63 packages
Last checked
18 hours ago

Tools for package owners.