argocd

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 24 Imported by: 1

Documentation

Overview

Copyright (C) 2021-2023, Kubefirst

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

This program is licensed under MIT. See the LICENSE file for more details.

Index

Constants

View Source
const ArgoCDAPIVersion string = "argoproj.io/v1alpha1"

Variables

View Source
var ArgocdSecretClient coreV1Types.SecretInterface

Functions

func ApplyArgoCDKustomize

func ApplyArgoCDKustomize(clientset *kubernetes.Clientset, argoCDInstallPath string) error

ApplyArgoCDKustomize

func ArgoCDApplicationCleanup

func ArgoCDApplicationCleanup(clientset kubernetes.Interface, removeApps []string) error

ArgoCDApplicationCleanup removes and waits for specific ArgoCD applications

func DeleteApplication

func DeleteApplication(httpClient pkg.HTTPDoer, applicationName, argoCDToken, cascade string) (httpCodeResponse int, syncStatus string, Error error)

Sync request ArgoCD to manual sync an application.

func GetArgoCDApplication

func GetArgoCDApplication(token string, applicationName string) (argocdModel.V1alpha1Application, error)

GetArgoCDApplication by receiving the ArgoCD token, and the application name, this function returns the full application data Application struct. This can be used when a resource needs to be updated, we firstly collect all Application data, update what is necessary and then request the PUT function to update the resource.

func GetArgoCDApplicationObject

func GetArgoCDApplicationObject(gitopsRepoURL, registryPath string) *v1alpha1ArgocdApplication.Application

func GetArgoCDToken

func GetArgoCDToken(username string, password string) (string, error)

GetArgoCDToken expects ArgoCD username and password, and returns a ArgoCD Bearer Token. ArgoCD username and password are stored in the viper file.

func GetArgoEndpoint

func GetArgoEndpoint() string

GetArgoEndpoint provides a solution in the interim for returning the correct endpoint address

func GetArgocdTokenV2

func GetArgocdTokenV2(httpClient *http.Client, argocdBaseURL string, username string, password string) (string, error)

GetArgocdTokenV2

func RestPatchArgoCD

func RestPatchArgoCD(clientset kubernetes.Interface, applicationName string, payload []byte) error

RestPatchArgoCD uses RESTClient to patch a given ArgoCD Application using the provided payload

Types

type Config

type Config struct {
	Configs struct {
		Repositories struct {
			SoftServeGitops struct {
				URL      string `yaml:"url,omitempty"`
				Insecure string `json:"insecure,omitempty"`
				Type     string `json:"type,omitempty"`
				Name     string `json:"name,omitempty"`
			} `yaml:"soft-serve-gitops,omitempty"`
			RepoGitops struct {
				URL  string `yaml:"url,omitempty"`
				Type string `yaml:"type,omitempty"`
				Name string `yaml:"name,omitempty"`
			} `yaml:"github-serve-gitops,omitempty"`
		} `yaml:"repositories,omitempty"`
		CredentialTemplates struct {
			SSHCreds struct {
				URL           string `yaml:"url,omitempty"`
				SSHPrivateKey string `yaml:"sshPrivateKey,omitempty"`
			} `yaml:"ssh-creds,omitempty"`
		} `yaml:"credentialTemplates,omitempty"`
	} `yaml:"configs,omitempty"`
	Server struct {
		ExtraArgs []string `yaml:"extraArgs,omitempty"`
		Ingress   struct {
			Enabled     string `yaml:"enabled,omitempty"`
			Annotations struct {
				IngressKubernetesIoRewriteTarget   string `yaml:"ingress.kubernetes.io/rewrite-target,omitempty"`
				IngressKubernetesIoBackendProtocol string `yaml:"ingress.kubernetes.io/backend-protocol,omitempty"`
			} `yaml:"annotations,omitempty"`
			Hosts []string    `yaml:"hosts,omitempty"`
			TLS   []TLSConfig `yaml:"tls,omitempty"`
		} `yaml:"ingress,omitempty"`
	} `yaml:"server,omitempty"`
}

todo call this ArgocdConfig or something not so generic Config ArgoCD configuration

type PatchStringValue

type PatchStringValue struct {
	Op    string `json:"op"`
	Path  string `json:"path"`
	Value string `json:"value"`
}

PatchStringValue specifies a patch operation for a string

type TLSConfig

type TLSConfig struct {
	Hosts      []string `yaml:"hosts,omitempty"`
	SecretName string   `yaml:"secretName,omitempty"`
}

Jump to

Keyboard shortcuts

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