gke

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package gke implements the GCP Kubernetes Engine (Container) API as a server.Handler. Real google.golang.org/api/container/v1 clients configured with a custom endpoint hit this handler the same way they hit container.googleapis.com.

Wave-1 coverage (control plane only):

POST   /v1/projects/{p}/locations/{l}/clusters
GET    /v1/projects/{p}/locations/{l}/clusters
GET    /v1/projects/{p}/locations/{l}/clusters/{c}
PUT    /v1/projects/{p}/locations/{l}/clusters/{c}
DELETE /v1/projects/{p}/locations/{l}/clusters/{c}
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setLogging
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setMonitoring
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setMasterAuth
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setLegacyAbac
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setNetworkPolicy
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setMaintenancePolicy
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:setResourceLabels
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:startIpRotation
POST   /v1/projects/{p}/locations/{l}/clusters/{c}:completeIpRotation
POST   /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools
GET    /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools
GET    /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}
PUT    /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}
DELETE /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}
POST   /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}:setSize
POST   /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}:setAutoscaling
POST   /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}:setManagement
POST   /v1/projects/{p}/locations/{l}/clusters/{c}/nodePools/{n}:rollback
GET    /v1/projects/{p}/locations/{l}/operations
GET    /v1/projects/{p}/locations/{l}/operations/{op}
POST   /v1/projects/{p}/locations/{l}/operations/{op}:cancel

All mutating endpoints return Operation envelopes with status=DONE so SDK pollers terminate on the first response. Cluster.Endpoint and MasterAuth.ClusterCaCertificate carry stub values — see provider/gcp/gke for the Wave-2 deferral note.

The /v1/projects/{p}/locations/{l}/ prefix is shared with Cloud Functions (functions/) and Cloud SQL (/v1/projects/{p}/instances). Matches narrows on the 4th segment so this handler claims ONLY clusters/operations URLs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler serves GKE container-API REST requests against a gke.Mock backend.

func New

func New(m *gke.Mock) *Handler

New returns a GKE handler backed by m.

func (*Handler) Matches

func (*Handler) Matches(r *http.Request) bool

Matches accepts /v1/projects/{p}/locations/{l}/{clusters|operations}/... paths. Anything else (functions, instances, databases) belongs to a different handler and falls through.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes based on the parsed path.

Jump to

Keyboard shortcuts

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