Documentation
¶
Index ¶
- Constants
- Variables
- func NewHandler(appLister applisters.ApplicationLister, namespace string, ...) *terminalHandler
- type AppResourceTreeFn
- type GetSettingsFunc
- type PtyHandler
- type Server
- func (s *Server) Create(ctx context.Context, q *application.ApplicationCreateRequest) (*v1alpha1.Application, error)
- func (s *Server) Delete(ctx context.Context, q *application.ApplicationDeleteRequest) (*application.ApplicationResponse, error)
- func (s *Server) DeleteResource(ctx context.Context, q *application.ApplicationResourceDeleteRequest) (*application.ApplicationResponse, error)
- func (s *Server) Get(ctx context.Context, q *application.ApplicationQuery) (*v1alpha1.Application, error)
- func (s *Server) GetApplicationSyncWindows(ctx context.Context, q *application.ApplicationSyncWindowsQuery) (*application.ApplicationSyncWindowsResponse, error)
- func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationManifestQuery) (*apiclient.ManifestResponse, error)
- func (s *Server) GetManifestsWithFiles(stream application.ApplicationService_GetManifestsWithFilesServer) error
- func (s *Server) GetOCIMetadata(ctx context.Context, q *application.RevisionMetadataQuery) (*v1alpha1.OCIMetadata, error)
- func (s *Server) GetResource(ctx context.Context, q *application.ApplicationResourceRequest) (*application.ApplicationResourceResponse, error)
- func (s *Server) List(ctx context.Context, q *application.ApplicationQuery) (*v1alpha1.ApplicationList, error)
- func (s *Server) ListLinks(ctx context.Context, req *application.ListAppLinksRequest) (*application.LinksResponse, error)
- func (s *Server) ListResourceActions(ctx context.Context, q *application.ApplicationResourceRequest) (*application.ResourceActionsListResponse, error)
- func (s *Server) ListResourceEvents(ctx context.Context, q *application.ApplicationResourceEventsQuery) (*eventspb.EventList, error)
- func (s *Server) ListResourceLinks(ctx context.Context, req *application.ApplicationResourceRequest) (*application.LinksResponse, error)
- func (s *Server) ManagedResources(ctx context.Context, q *application.ResourcesQuery) (*application.ManagedResourcesResponse, error)
- func (s *Server) Patch(ctx context.Context, q *application.ApplicationPatchRequest) (*v1alpha1.Application, error)
- func (s *Server) PatchResource(ctx context.Context, q *application.ApplicationResourcePatchRequest) (*application.ApplicationResourceResponse, error)
- func (s *Server) PodLogs(q *application.ApplicationPodLogsQuery, ...) error
- func (s *Server) ResourceTree(ctx context.Context, q *application.ResourcesQuery) (*v1alpha1.ApplicationTree, error)
- func (s *Server) RevisionChartDetails(ctx context.Context, q *application.RevisionMetadataQuery) (*v1alpha1.ChartDetails, error)
- func (s *Server) RevisionMetadata(ctx context.Context, q *application.RevisionMetadataQuery) (*v1alpha1.RevisionMetadata, error)
- func (s *Server) Rollback(ctx context.Context, rollbackReq *application.ApplicationRollbackRequest) (*v1alpha1.Application, error)
- func (s *Server) RunResourceAction(ctx context.Context, q *application.ResourceActionRunRequest) (*application.ApplicationResponse, error)deprecated
- func (s *Server) RunResourceActionV2(ctx context.Context, q *application.ResourceActionRunRequestV2) (*application.ApplicationResponse, error)
- func (s *Server) ServerSideDiff(ctx context.Context, q *application.ApplicationServerSideDiffQuery) (*application.ApplicationServerSideDiffResponse, error)
- func (s *Server) Sync(ctx context.Context, syncReq *application.ApplicationSyncRequest) (*v1alpha1.Application, error)
- func (s *Server) TerminateOperation(ctx context.Context, termOpReq *application.OperationTerminateRequest) (*application.OperationTerminateResponse, error)
- func (s *Server) Update(ctx context.Context, q *application.ApplicationUpdateRequest) (*v1alpha1.Application, error)
- func (s *Server) UpdateSpec(ctx context.Context, q *application.ApplicationUpdateSpecRequest) (*v1alpha1.ApplicationSpec, error)
- func (s *Server) Watch(q *application.ApplicationQuery, ws application.ApplicationService_WatchServer) error
- func (s *Server) WatchResourceTree(q *application.ResourcesQuery, ...) error
- type TerminalCommand
- type TerminalMessage
- type TerminalOptions
Constants ¶
const ( ReconnectCode = 1 ReconnectMessage = "\nReconnect because the token was refreshed...\n" )
const EndOfTransmission = "\u0004"
Variables ¶
var (
ErrCacheMiss = cacheutil.ErrCacheMiss
)
Functions ¶
func NewHandler ¶ added in v1.8.8
func NewHandler(appLister applisters.ApplicationLister, namespace string, enabledNamespaces []string, db db.DB, appResourceTree AppResourceTreeFn, allowedShells []string, sessionManager *util_session.SessionManager, terminalOptions *TerminalOptions) *terminalHandler
NewHandler returns a new terminal handler.
Types ¶
type AppResourceTreeFn ¶ added in v1.8.8
type AppResourceTreeFn func(ctx context.Context, app *v1alpha1.Application) (*v1alpha1.ApplicationTree, error)
func NewServer ¶
func NewServer( namespace string, kubeclientset kubernetes.Interface, appclientset appclientset.Interface, appLister applisters.ApplicationLister, appInformer cache.SharedIndexInformer, appBroadcaster broadcast.Broadcaster[v1alpha1.ApplicationWatchEvent], repoClientset apiclient.Clientset, cache *servercache.Cache, kubectl kube.Kubectl, db db.DB, enf *rbac.Enforcer, projectLock sync.KeyLock, settingsMgr *settings.SettingsManager, projInformer cache.SharedIndexInformer, enabledNamespaces []string, enableK8sEvent []string, syncWithReplaceAllowed bool, ) (application.ApplicationServiceServer, AppResourceTreeFn)
NewServer returns a new instance of the Application service
type GetSettingsFunc ¶ added in v1.8.8
type PtyHandler ¶ added in v1.8.8
type PtyHandler interface {
io.Reader
io.Writer
remotecommand.TerminalSizeQueue
}
PtyHandler is what remotecommand expects from a pty
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides an Application service
func (*Server) Create ¶
func (s *Server) Create(ctx context.Context, q *application.ApplicationCreateRequest) (*v1alpha1.Application, error)
Create creates an application
func (*Server) Delete ¶
func (s *Server) Delete(ctx context.Context, q *application.ApplicationDeleteRequest) (*application.ApplicationResponse, error)
Delete removes an application and all associated resources
func (*Server) DeleteResource ¶ added in v0.8.0
func (s *Server) DeleteResource(ctx context.Context, q *application.ApplicationResourceDeleteRequest) (*application.ApplicationResponse, error)
DeleteResource deletes a specified resource
func (*Server) Get ¶
func (s *Server) Get(ctx context.Context, q *application.ApplicationQuery) (*v1alpha1.Application, error)
Get returns an application by name
func (*Server) GetApplicationSyncWindows ¶ added in v1.3.0
func (s *Server) GetApplicationSyncWindows(ctx context.Context, q *application.ApplicationSyncWindowsQuery) (*application.ApplicationSyncWindowsResponse, error)
func (*Server) GetManifests ¶ added in v0.4.1
func (s *Server) GetManifests(ctx context.Context, q *application.ApplicationManifestQuery) (*apiclient.ManifestResponse, error)
GetManifests returns application manifests
func (*Server) GetManifestsWithFiles ¶ added in v1.8.8
func (s *Server) GetManifestsWithFiles(stream application.ApplicationService_GetManifestsWithFilesServer) error
func (*Server) GetOCIMetadata ¶ added in v1.8.8
func (s *Server) GetOCIMetadata(ctx context.Context, q *application.RevisionMetadataQuery) (*v1alpha1.OCIMetadata, error)
func (*Server) GetResource ¶ added in v0.11.0
func (s *Server) GetResource(ctx context.Context, q *application.ApplicationResourceRequest) (*application.ApplicationResourceResponse, error)
func (*Server) List ¶
func (s *Server) List(ctx context.Context, q *application.ApplicationQuery) (*v1alpha1.ApplicationList, error)
List returns list of applications
func (*Server) ListLinks ¶ added in v1.8.8
func (s *Server) ListLinks(ctx context.Context, req *application.ListAppLinksRequest) (*application.LinksResponse, error)
func (*Server) ListResourceActions ¶ added in v1.0.0
func (s *Server) ListResourceActions(ctx context.Context, q *application.ApplicationResourceRequest) (*application.ResourceActionsListResponse, error)
func (*Server) ListResourceEvents ¶ added in v0.4.4
func (s *Server) ListResourceEvents(ctx context.Context, q *application.ApplicationResourceEventsQuery) (*eventspb.EventList, error)
ListResourceEvents returns a list of event resources
func (*Server) ListResourceLinks ¶ added in v1.8.8
func (s *Server) ListResourceLinks(ctx context.Context, req *application.ApplicationResourceRequest) (*application.LinksResponse, error)
func (*Server) ManagedResources ¶ added in v0.11.0
func (s *Server) ManagedResources(ctx context.Context, q *application.ResourcesQuery) (*application.ManagedResourcesResponse, error)
func (*Server) Patch ¶ added in v0.12.0
func (s *Server) Patch(ctx context.Context, q *application.ApplicationPatchRequest) (*v1alpha1.Application, error)
Patch patches an application
func (*Server) PatchResource ¶ added in v0.12.0
func (s *Server) PatchResource(ctx context.Context, q *application.ApplicationResourcePatchRequest) (*application.ApplicationResourceResponse, error)
PatchResource patches a resource
func (*Server) PodLogs ¶ added in v0.3.0
func (s *Server) PodLogs(q *application.ApplicationPodLogsQuery, ws application.ApplicationService_PodLogsServer) error
func (*Server) ResourceTree ¶ added in v0.11.0
func (s *Server) ResourceTree(ctx context.Context, q *application.ResourcesQuery) (*v1alpha1.ApplicationTree, error)
func (*Server) RevisionChartDetails ¶ added in v1.8.8
func (s *Server) RevisionChartDetails(ctx context.Context, q *application.RevisionMetadataQuery) (*v1alpha1.ChartDetails, error)
RevisionChartDetails returns the helm chart metadata, as fetched from the reposerver
func (*Server) RevisionMetadata ¶ added in v1.2.0
func (s *Server) RevisionMetadata(ctx context.Context, q *application.RevisionMetadataQuery) (*v1alpha1.RevisionMetadata, error)
func (*Server) Rollback ¶ added in v0.3.1
func (s *Server) Rollback(ctx context.Context, rollbackReq *application.ApplicationRollbackRequest) (*v1alpha1.Application, error)
func (*Server) RunResourceAction
deprecated
added in
v1.0.0
func (s *Server) RunResourceAction(ctx context.Context, q *application.ResourceActionRunRequest) (*application.ApplicationResponse, error)
RunResourceAction runs a resource action on a live resource
Deprecated: use RunResourceActionV2 instead. This version does not support resource action parameters but is maintained for backward compatibility. It will be removed in a future release.
func (*Server) RunResourceActionV2 ¶ added in v1.8.8
func (s *Server) RunResourceActionV2(ctx context.Context, q *application.ResourceActionRunRequestV2) (*application.ApplicationResponse, error)
func (*Server) ServerSideDiff ¶ added in v1.8.8
func (s *Server) ServerSideDiff(ctx context.Context, q *application.ApplicationServerSideDiffQuery) (*application.ApplicationServerSideDiffResponse, error)
ServerSideDiff gets the destination cluster and creates a server-side dry run applier and performs the diff It returns the diff result in the form of a list of ResourceDiffs.
func (*Server) Sync ¶
func (s *Server) Sync(ctx context.Context, syncReq *application.ApplicationSyncRequest) (*v1alpha1.Application, error)
Sync syncs an application to its target state
func (*Server) TerminateOperation ¶ added in v0.6.0
func (s *Server) TerminateOperation(ctx context.Context, termOpReq *application.OperationTerminateRequest) (*application.OperationTerminateResponse, error)
func (*Server) Update ¶
func (s *Server) Update(ctx context.Context, q *application.ApplicationUpdateRequest) (*v1alpha1.Application, error)
Update updates an application
func (*Server) UpdateSpec ¶ added in v0.3.3
func (s *Server) UpdateSpec(ctx context.Context, q *application.ApplicationUpdateSpecRequest) (*v1alpha1.ApplicationSpec, error)
UpdateSpec updates an application spec and filters out any invalid parameter overrides
func (*Server) Watch ¶
func (s *Server) Watch(q *application.ApplicationQuery, ws application.ApplicationService_WatchServer) error
func (*Server) WatchResourceTree ¶ added in v1.8.8
func (s *Server) WatchResourceTree(q *application.ResourcesQuery, ws application.ApplicationService_WatchResourceTreeServer) error
type TerminalCommand ¶ added in v1.8.8
type TerminalCommand struct {
Code int
}
TerminalCommand is the struct for websocket commands,For example you need ask client to reconnect
type TerminalMessage ¶ added in v1.8.8
type TerminalMessage struct {
Operation string `json:"operation"`
Data string `json:"data"`
Rows uint16 `json:"rows"`
Cols uint16 `json:"cols"`
}
TerminalMessage is the struct for websocket message.