mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-11-23 21:33:22 -05:00
Remove client pkg from kubectl pkg (#638)
The nested client pkg was necessary to implement a generator pattern. The generator was necessary as the Kubewrapper type expects a k8sapi.Client object during instantiation. However, the required kubeconfig is not ready during Kubewrapper creation. This patch relies on an Initialize function to set the Kubeconfig and hands over an empty struct during Kubewrapper creation. This allows us to remove the extra Client abstraction.
This commit is contained in:
parent
1968dfe70c
commit
6af54142f2
12 changed files with 93 additions and 1197 deletions
|
|
@ -502,7 +502,6 @@ func (s *stubConfigProvider) JoinConfiguration(_ bool) k8sapi.KubeadmJoinYAML {
|
|||
}
|
||||
|
||||
type stubKubectl struct {
|
||||
applyErr error
|
||||
createConfigMapErr error
|
||||
addTolerationsToDeploymentErr error
|
||||
addTNodeSelectorsToDeploymentErr error
|
||||
|
|
@ -510,17 +509,10 @@ type stubKubectl struct {
|
|||
listAllNamespacesErr error
|
||||
|
||||
listAllNamespacesResp *corev1.NamespaceList
|
||||
resources []kubernetes.Marshaler
|
||||
kubeconfigs [][]byte
|
||||
}
|
||||
|
||||
func (s *stubKubectl) Apply(resources kubernetes.Marshaler, forceConflicts bool) error {
|
||||
s.resources = append(s.resources, resources)
|
||||
return s.applyErr
|
||||
}
|
||||
|
||||
func (s *stubKubectl) SetKubeconfig(kubeconfig []byte) {
|
||||
s.kubeconfigs = append(s.kubeconfigs, kubeconfig)
|
||||
func (s *stubKubectl) Initialize(kubeconfig []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *stubKubectl) CreateConfigMap(ctx context.Context, configMap corev1.ConfigMap) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue