cluster

package
v0.0.0-...-b563e91 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource struct {
	Name string                        `json:"name"`
	Type resource.PipelineResourceType `json:"type"`
	// URL must be a host string
	URL      string `json:"url"`
	Revision string `json:"revision"`
	// Server requires Basic authentication
	Username  string `json:"username"`
	Password  string `json:"password"`
	Namespace string `json:"namespace"`
	// Server requires Bearer authentication. This client will not attempt to use
	// refresh tokens for an OAuth2 flow.
	// Token overrides userame and password
	Token string `json:"token"`
	// Server should be accessed without verifying the TLS certificate. For testing only.
	Insecure bool
	// CAData holds PEM-encoded bytes (typically read from a root certificates bundle).
	// CAData takes precedence over CAFile
	CAData []byte `json:"cadata"`
	// ClientKeyData contains PEM-encoded data from a client key file for TLS.
	ClientKeyData []byte `json:"clientKeyData"`
	// ClientCertificateData contains PEM-encoded data from a client cert file for TLS.
	ClientCertificateData []byte `json:"clientCertificateData"`
	// Secrets holds a struct to indicate a field name and corresponding secret name to populate it
	Secrets []resource.SecretParam `json:"secrets"`

	KubeconfigWriterImage string `json:"-"`
	ShellImage            string `json:"-"`
}

Resource represents a cluster configuration (kubeconfig) that can be accessed by tasks in the pipeline

func NewResource

func NewResource(name string, kubeconfigWriterImage, shellImage string, r *resource.PipelineResource) (*Resource, error)

NewResource create a new k8s cluster resource to pass to a pipeline task

func (*Resource) GetInputTaskModifier

func (s *Resource) GetInputTaskModifier(ts *v1beta1.TaskSpec, path string) (v1beta1.TaskModifier, error)

GetInputTaskModifier returns the TaskModifier to be used when this resource is an input.

func (Resource) GetName

func (s Resource) GetName() string

GetName returns the name of the resource

func (*Resource) GetOutputTaskModifier

func (s *Resource) GetOutputTaskModifier(_ *v1beta1.TaskSpec, _ string) (v1beta1.TaskModifier, error)

GetOutputTaskModifier returns a No-op TaskModifier.

func (Resource) GetType

GetType returns the type of the resource, in this case "cluster"

func (*Resource) GetURL

func (s *Resource) GetURL() string

GetURL returns the url to be used with this resource

func (*Resource) Replacements

func (s *Resource) Replacements() map[string]string

Replacements is used for template replacement on a ClusterResource inside of a Taskrun.

func (Resource) String

func (s Resource) String() string

Jump to

Keyboard shortcuts

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