app

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffServiceBindings

func DiffServiceBindings(spec v1alpha1.AppParameters, ymlManifest string) []v1alpha1.ServiceBindingConfiguration

DiffServiceBindings checks whether current state is up-to-date compared to the given

func GenerateObservation

func GenerateObservation(res *resource.App) v1alpha1.AppObservation

GenerateObservation takes an App resource and returns *AppObservation.

func IsUpToDate

func IsUpToDate(spec v1alpha1.AppParameters, status v1alpha1.AppObservation) (bool, error)

func NewPushClient

func NewPushClient(client *cfv3.Client) *pushClient

NewPushClient creates a new PushClient

Types

type AppClient

type AppClient interface {
	Get(ctx context.Context, guid string) (*resource.App, error)
	Single(ctx context.Context, opts *client.AppListOptions) (*resource.App, error)
	Create(ctx context.Context, r *resource.AppCreate) (*resource.App, error)
	Update(ctx context.Context, guid string, r *resource.AppUpdate) (*resource.App, error)
	Delete(ctx context.Context, guid string) (string, error)

	Start(ctx context.Context, guid string) (*resource.App, error)
	Stop(ctx context.Context, guid string) (*resource.App, error)
}

AppClient defines the interface to communicate with Cloud Foundry App resource.

type ChangeDetection added in v0.3.2

type ChangeDetection struct {
	ChangedFields map[string]struct{}
}

ChangeDetection represents what fields have changed

func DetectChanges added in v0.3.2

func DetectChanges(spec v1alpha1.AppParameters, status v1alpha1.AppObservation) (*ChangeDetection, error)

DetectChanges determines what fields have changed between spec and status

func (*ChangeDetection) HasChanges added in v0.3.2

func (cd *ChangeDetection) HasChanges() bool

func (*ChangeDetection) HasField added in v0.3.2

func (cd *ChangeDetection) HasField(field string) bool

HasField checks if a specific field changed

type Client

func NewAppClient

func NewAppClient(client *client.Client) *Client

NewAppClient returns a new AppClient.

func (*Client) CreateAndPush

func (c *Client) CreateAndPush(ctx context.Context, spec v1alpha1.AppParameters, dockerCredentials *DockerCredentials) (*resource.App, error)

CreateAndPush creates and pushes an app to the Cloud Foundry.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, guid string) error

Delete deletes an app in the Cloud Foundry.

func (*Client) GetByIDOrSpec

func (c *Client) GetByIDOrSpec(ctx context.Context, guid string, spec v1alpha1.AppParameters) (*resource.App, error)

GetByIDOrSpec gets the App by GUID or spec.

func (*Client) ReconcileServiceBinding

func (c *Client) ReconcileServiceBinding(ctx context.Context, guid string, spec v1alpha1.AppParameters, ymlManifest string) error

ReconcileServiceBinding updates an app in the Cloud Foundry.

func (*Client) Update

func (c *Client) Update(ctx context.Context, guid string, spec v1alpha1.AppParameters) (*resource.App, error)

Update updates an app in the Cloud Foundry.

func (*Client) UpdateAndPush added in v0.3.2

func (c *Client) UpdateAndPush(ctx context.Context, guid string, spec v1alpha1.AppParameters, dockerCredentials *DockerCredentials) (*resource.App, error)

UpdateAndPush updates and pushes an app to the Cloud Foundry.

type DockerCredentials

type DockerCredentials resource.DockerCredentials

type ManifestClient

type ManifestClient interface {
	Generate(ctx context.Context, appGUID string) (string, error)
	ApplyManifest(ctx context.Context, spaceGUID string, manifest string) (string, error)
	ManifestDiff(ctx context.Context, spaceGUID string, manifest string) (*resource.ManifestDiff, error)
}

ManifestClient defines the interface to communicate with Cloud Foundry Manifest resource.

type PushClient

type PushClient interface {
	Push(ctx context.Context, application *resource.App, manifest *operation.AppManifest, zipFile io.Reader) (*resource.App, error)
	GenerateManifest(ctx context.Context, appGUID string) (string, error)
}

PushClient is the interface for pushing an app to the Cloud Foundry

Jump to

Keyboard shortcuts

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