mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(swagger): fix swagger api docs endpoint(s) rename to environment(s) EE-1661 (#5629)
* fix swagger api docs endpoint(s) rename to environment(s)
This commit is contained in:
parent
d911c50f1b
commit
dd808bb7bd
111 changed files with 376 additions and 376 deletions
|
@ -50,7 +50,7 @@ func (factory *ClientFactory) RemoveKubeClient(endpoint *portainer.Endpoint) {
|
|||
factory.endpointClients.Remove(strconv.Itoa(int(endpoint.ID)))
|
||||
}
|
||||
|
||||
// GetKubeClient checks if an existing client is already registered for the endpoint and returns it if one is found.
|
||||
// GetKubeClient checks if an existing client is already registered for the environment(endpoint) and returns it if one is found.
|
||||
// If no client is registered, it will create a new client, register it, and returns it.
|
||||
func (factory *ClientFactory) GetKubeClient(endpoint *portainer.Endpoint) (portainer.KubeClient, error) {
|
||||
key := strconv.Itoa(int(endpoint.ID))
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
// StartExecProcess will start an exec process inside a container located inside a pod inside a specific namespace
|
||||
// using the specified command. The stdin parameter will be bound to the stdin process and the stdout process will write
|
||||
// to the stdout parameter.
|
||||
// This function only works against a local endpoint using an in-cluster config with the user's SA token.
|
||||
// This function only works against a local environment(endpoint) using an in-cluster config with the user's SA token.
|
||||
// This is a blocking operation.
|
||||
func (kcl *KubeClient) StartExecProcess(token string, useAdminToken bool, namespace, podName, containerName string, command []string, stdin io.Reader, stdout io.Writer, errChan chan error) {
|
||||
config, err := rest.InClusterConfig()
|
||||
|
|
|
@ -25,7 +25,7 @@ func (kcl *KubeClient) GetKubeConfig(ctx context.Context, apiServerURL string, b
|
|||
}
|
||||
|
||||
// generateKubeconfig will generate and return kubeconfig resource - usable by `kubectl` cli
|
||||
// which will allow the client to connect directly to k8s server endpoint via portainer (proxy)
|
||||
// which will allow the client to connect directly to k8s server environment(endpoint) via portainer (proxy)
|
||||
func generateKubeconfig(apiServerURL, bearerToken, serviceAccountName string) *clientV1.Config {
|
||||
const (
|
||||
KubeConfigPortainerContext = "portainer-ctx"
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// GetNodesLimits gets the CPU and Memory limits(unused resources) of all nodes in the current k8s endpoint connection
|
||||
// GetNodesLimits gets the CPU and Memory limits(unused resources) of all nodes in the current k8s environment(endpoint) connection
|
||||
func (kcl *KubeClient) GetNodesLimits() (portainer.K8sNodesLimits, error) {
|
||||
nodesLimits := make(portainer.K8sNodesLimits)
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ func (kcl *KubeClient) getServiceAccountToken(serviceAccountName string) (string
|
|||
}
|
||||
|
||||
// API token secret is populated asynchronously.
|
||||
// Is it created by the controller and will depend on the environment/secret-store:
|
||||
// Is it created by the controller and will depend on the environment(endpoint)/secret-store:
|
||||
// https://github.com/kubernetes/kubernetes/issues/67882#issuecomment-422026204
|
||||
// as a work-around, we wait for up to 5 seconds for the secret to be populated.
|
||||
timeout := time.After(5 * time.Second)
|
||||
|
|
|
@ -86,7 +86,7 @@ func (kccas *kubeConfigCAService) IsSecure() bool {
|
|||
return kccas.certificateAuthorityData != ""
|
||||
}
|
||||
|
||||
// GetKubeConfigInternal returns K8s cluster access details for the specified endpoint.
|
||||
// GetKubeConfigInternal returns K8s cluster access details for the specified environment(endpoint).
|
||||
// On startup, portainer generates a certificate against localhost at specified `httpsBindAddr` port, hence
|
||||
// the kubeconfig generated should only be utilised by internal portainer binaries as the `ClusterServerURL`
|
||||
// points to the internally accessible `https` based `localhost` address.
|
||||
|
|
|
@ -110,10 +110,10 @@ func TestKubeConfigService_GetKubeConfigInternal(t *testing.T) {
|
|||
is.True(strings.Contains(clusterAccessDetails.ClusterServerURL, ":1010"), "should contain bind address port")
|
||||
})
|
||||
|
||||
t.Run("GetKubeConfigInternal contains endpoint proxy url", func(t *testing.T) {
|
||||
t.Run("GetKubeConfigInternal contains environment proxy url", func(t *testing.T) {
|
||||
kcs := NewKubeConfigCAService("", "")
|
||||
clusterAccessDetails := kcs.GetKubeConfigInternal(100, "some-token")
|
||||
is.True(strings.Contains(clusterAccessDetails.ClusterServerURL, "api/endpoints/100/kubernetes"), "should contain endpoint proxy url")
|
||||
is.True(strings.Contains(clusterAccessDetails.ClusterServerURL, "api/endpoints/100/kubernetes"), "should contain environment proxy url")
|
||||
})
|
||||
|
||||
t.Run("GetKubeConfigInternal returns insecure cluster access config", func(t *testing.T) {
|
||||
|
|
|
@ -22,7 +22,7 @@ func NewSnapshotter(clientFactory *cli.ClientFactory) *Snapshotter {
|
|||
}
|
||||
}
|
||||
|
||||
// CreateSnapshot creates a snapshot of a specific Kubernetes endpoint
|
||||
// CreateSnapshot creates a snapshot of a specific Kubernetes environment(endpoint)
|
||||
func (snapshotter *Snapshotter) CreateSnapshot(endpoint *portainer.Endpoint) (*portainer.KubernetesSnapshot, error) {
|
||||
client, err := snapshotter.clientFactory.CreateClient(endpoint)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue