mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
edit: Make environment variables composable
It also adds support for KUBE_EDITOR and GIT_EDITOR which were already advertised in the edit usage message.
This commit is contained in:
committed by
Michail Kargakis
parent
a7425bf070
commit
523b6ec7e3
@@ -101,6 +101,10 @@ type Factory struct {
|
||||
CanBeAutoscaled func(kind string) error
|
||||
// AttachablePodForObject returns the pod to which to attach given an object.
|
||||
AttachablePodForObject func(object runtime.Object) (*api.Pod, error)
|
||||
// EditorEnvs returns a group of environment variables that the edit command
|
||||
// can range over in order to determine if the user has specified an editor
|
||||
// of their choice.
|
||||
EditorEnvs func() []string
|
||||
}
|
||||
|
||||
// NewFactory creates a factory with the default Kubernetes resources defined
|
||||
@@ -331,6 +335,9 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
|
||||
return nil, fmt.Errorf("cannot attach to %s: not implemented", kind)
|
||||
}
|
||||
},
|
||||
EditorEnvs: func() []string {
|
||||
return []string{"KUBE_EDITOR", "EDITOR"}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user