app

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Apache-2.0 Imports: 17 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(mg xpresource.Managed, spec v1alpha1.AppParameters, status v1alpha1.AppObservation) (bool, error)

IsUpToDate checks whether current state is up-to-date compared to the given spec and managed-resource-derived metadata.

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)
	// Restart(ctx context.Context, guid string) (*resource.App, error)
	GetEnvironmentVariables(ctx context.Context, guid string) (map[string]*string, error)
	SetEnvironmentVariables(ctx context.Context, guid string, envVars map[string]*string) (map[string]*string, 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

DetectChanges determines what fields have changed between spec and status. Metadata drift is computed from the full desired metadata, including Crossplane-owned/default labels derived from the managed resource. Passing mg ensures missing or stale default labels trigger the Update path that re-applies them to the Cloud Foundry app.

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

func (*ChangeDetection) HasOtherChanges added in v1.2.0

func (cd *ChangeDetection) HasOtherChanges(excluded ...string) bool

HasOtherChanges returns true if there are changed fields other than the excluded ones.

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, mg xpresource.Managed, 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) FetchRoutes added in v1.1.1

func (c *Client) FetchRoutes(ctx context.Context, appGUID string) ([]v1alpha1.AppRouteObservation, error)

FetchRoutes fetches all routes mapped to the given application and converts them to AppRouteObservation values. Errors from the CF API are returned non-nil so the caller can decide whether to make them fatal. If no RouteFetcher is configured, FetchRoutes returns an empty slice.

func (*Client) GetBySpec added in v1.2.0

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

GetBySpec gets an App by matching spec fields (name and space).

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, mg xpresource.Managed, 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, mg xpresource.Managed, 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

type RouteFetcher added in v1.1.1

type RouteFetcher interface {
	ListForAppAll(ctx context.Context, appGUID string, opts *client.RouteListOptions) ([]*resource.Route, error)
}

RouteFetcher defines the interface to fetch routes for an application.

Jump to

Keyboard shortcuts

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