Skip to content

Commit

Permalink
Support mapping operations to a pod
Browse files Browse the repository at this point in the history
  • Loading branch information
wzshiming committed Nov 18, 2024
1 parent 5f5cdc9 commit cd84ab0
Show file tree
Hide file tree
Showing 34 changed files with 1,331 additions and 3 deletions.
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_attaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ spec:
logsFile:
description: LogsFile is the file from which the attach starts
type: string
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: object
type: array
required:
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_clusterattaches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ spec:
logsFile:
description: LogsFile is the file from which the attach starts
type: string
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: object
type: array
selector:
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_clusterexecs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ spec:
description: WorkDir is the working directory to exec with.
type: string
type: object
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: object
type: array
selector:
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_clusterlogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ spec:
description: LogsFile is the file from which the log forward
starts
type: string
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: object
type: array
selector:
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_clusterportforwards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ spec:
items:
type: string
type: array
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
ports:
description: |-
Ports is a list of ports to forward.
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_execs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ spec:
description: WorkDir is the working directory to exec with.
type: string
type: object
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: object
type: array
required:
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_logs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ spec:
description: LogsFile is the file from which the log forward
starts
type: string
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
type: object
type: array
required:
Expand Down
13 changes: 13 additions & 0 deletions kustomize/crd/bases/kwok.x-k8s.io_portforwards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ spec:
items:
type: string
type: array
mapping:
description: Mapping is mapping to target
properties:
container:
type: string
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
ports:
description: |-
Ports is a list of ports to forward.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/internalversion/attach_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ type AttachConfig struct {
Containers []string
// LogsFile is the file from which the attach starts
LogsFile string
// Mapping is mapping to target
Mapping *MappingTarget
}
2 changes: 2 additions & 0 deletions pkg/apis/internalversion/exec_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type ExecTarget struct {
Containers []string
// Local holds information how to exec to a local target.
Local *ExecTargetLocal
// Mapping is mapping to target
Mapping *MappingTarget
}

// ExecTargetLocal holds information how to exec to a local target.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/internalversion/logs_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ type Log struct {
LogsFile string
// Follow up if true
Follow bool
// Mapping is mapping to target
Mapping *MappingTarget
}
24 changes: 24 additions & 0 deletions pkg/apis/internalversion/mapping_target_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package internalversion

// MappingTarget is a target for a Pod
type MappingTarget struct {
Name string
Namespace string
Container string
}
2 changes: 2 additions & 0 deletions pkg/apis/internalversion/port_forward_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ type Forward struct {
// Command is the command to run to forward with stdin/stdout.
// if set, Target will be ignored.
Command []string
// Mapping is mapping to target
Mapping *MappingTarget
}

// ForwardTarget holds information how to forward to a target.
Expand Down
42 changes: 42 additions & 0 deletions pkg/apis/internalversion/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions pkg/apis/internalversion/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cd84ab0

Please sign in to comment.