demo

package
v0.22.7 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const ARGOCDURL = "https://raw.githubusercontent.com/argoproj/argo-cd/%s/manifests/install-with-hydrator.yaml"

ARGOCDURL is the ArgoCD release URL template.

View Source
const PROMOTERURL = "https://github.com/argoproj-labs/gitops-promoter/releases/download/%s/install.yaml"

PROMOTERURL is the GitOps Promoter release URL template.

Variables

This section is empty.

Functions

func CopyEmbeddedDirToRepo

func CopyEmbeddedDirToRepo(
	ctx context.Context,
	client *github.Client,
	destOwner, destRepo, destPath string,
) error

CopyEmbeddedDirToRepo copies the embedded helm_guestbook directory to a GitHub repository

func CreateNamespace

func CreateNamespace(ctx context.Context, clientset kubernetes.Interface, namespace string) error

CreateNamespace creates a Kubernetes namespace if it doesn't already exist

func CreateOrUpdateSecret

func CreateOrUpdateSecret(
	ctx context.Context,
	clientset kubernetes.Interface,
	namespace, name string,
	data map[string]string,
	labels map[string]string,
) error

CreateOrUpdateSecret creates a secret or updates it if it already exists

func CreateRepoSecrets

func CreateRepoSecrets(
	ctx context.Context,
	k8sClient kubernetes.Interface,
	credentials *Credentials,
	username, repoName string,
) error

CreateRepoSecrets creates the ArgoCD repository secrets for read and write access

func NewDemoCommand

func NewDemoCommand() *cobra.Command

NewDemoCommand creates a new demo command for setting up a gitops-promoter demo repository

func UploadManifests

func UploadManifests(
	ctx context.Context,
	client *github.Client,
	repo *github.Repository,
	replacements Replacements,
) error

UploadManifests uploads manifest files to a GitHub repository with placeholder replacements

Types

type ArgoCDConfig

type ArgoCDConfig struct {
	Upstream string `yaml:"upstream"`
}

ArgoCDConfig holds ArgoCD configuration

type Config

type Config struct {
	ArgoCD         ArgoCDConfig         `yaml:"argocd"`
	GitOpsPromoter GitOpsPromoterConfig `yaml:"gitops-promoter"`
}

Config structure for config.yaml

type Credentials

type Credentials struct {
	Token          string
	AppID          string
	PrivateKey     string
	PrivateKeyPath string
}

Credentials holds all user-provided authentication info

type CredentialsProvider

type CredentialsProvider interface {
	GetCredentials() (*Credentials, error)
}

CredentialsProvider defines the interface for obtaining credentials

type FileCredentialsProvider

type FileCredentialsProvider struct {
	// contains filtered or unexported fields
}

FileCredentialsProvider loads credentials from a config file

func NewFileCredentialsProvider

func NewFileCredentialsProvider(path string) *FileCredentialsProvider

NewFileCredentialsProvider creates a provider that loads from a file

func (*FileCredentialsProvider) GetCredentials

func (p *FileCredentialsProvider) GetCredentials() (*Credentials, error)

GetCredentials implements CredentialsProvider

type GitOpsPromoterConfig

type GitOpsPromoterConfig struct {
	Upstream string `yaml:"upstream"`
}

GitOpsPromoterConfig holds GitOps Promoter configuration

type Installer

type Installer struct {
	ArgoCDURL   string
	PromoterURL string
}

Installer handles cluster setup operations

func NewInstaller

func NewInstaller() (*Installer, error)

NewInstaller creates a new Installer with the given config path

func (*Installer) ApplyBaseApp

func (i *Installer) ApplyBaseApp(ctx context.Context, githubUser string, repoName string) error

ApplyBaseApp applies the embedded ArgoCD base application

func (*Installer) InstallArgoCD

func (i *Installer) InstallArgoCD(ctx context.Context) error

InstallArgoCD installs ArgoCD into the cluster

func (*Installer) InstallGitOpsPromoter

func (i *Installer) InstallGitOpsPromoter(ctx context.Context) error

InstallGitOpsPromoter installs the GitOps Promoter controller

func (*Installer) PatchArgoCD

func (i *Installer) PatchArgoCD(ctx context.Context) error

PatchArgoCD patches the ArgoCD server deployment

func (*Installer) PatchControllerConfiguration

func (i *Installer) PatchControllerConfiguration(ctx context.Context) error

PatchControllerConfiguration patches the ControllerConfiguration resource in the cluster.

func (*Installer) PortForward

func (i *Installer) PortForward(ctx context.Context) error

PortForward starts port forwarding with automatic restart on failure

func (*Installer) RefreshAllApps

func (i *Installer) RefreshAllApps(ctx context.Context) error

RefreshAllApps refreshes all ArgoCD applications in the argocd namespace

func (*Installer) RefreshApp

func (i *Installer) RefreshApp(ctx context.Context, appName string) error

RefreshApp forces a hard refresh on an ArgoCD application

func (*Installer) SetupCluster

func (i *Installer) SetupCluster(ctx context.Context) error

SetupCluster runs the full cluster setup

type InteractivePrompter

type InteractivePrompter struct {
	// contains filtered or unexported fields
}

InteractivePrompter prompts the user for credentials via terminal

func NewInteractivePrompter

func NewInteractivePrompter() *InteractivePrompter

NewInteractivePrompter creates a new interactive prompter

func (*InteractivePrompter) GetCredentials

func (p *InteractivePrompter) GetCredentials() (*Credentials, error)

GetCredentials implements CredentialsProvider

func (*InteractivePrompter) PrintCLIInformation

func (p *InteractivePrompter) PrintCLIInformation()

PrintCLIInformation prints introductory information about the CLI

func (*InteractivePrompter) WithReader

WithReader sets a custom reader (useful for testing)

func (*InteractivePrompter) WithWriter

WithWriter sets a custom writer (useful for testing)

type PEMValidator

type PEMValidator struct{}

PEMValidator validates PEM files

func (*PEMValidator) Validate

func (v *PEMValidator) Validate(path string) error

Validate checks if a file contains a valid private key

type Replacements

type Replacements struct {
	RepoName   string
	Username   string
	AppID      string
	PrivateKey string
}

Replacements holds all the placeholder values

Jump to

Keyboard shortcuts

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