mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
Merge pull request #53606 from juanvallejo/jvallejo/add-approx-pod-template-factory-method
Automatic merge from submit-queue (batch tested with PRs 53606, 49361). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. add ApproximatePodTemplateForObject factory method Makes it possible to get at a pod spec template even if an object is scaled to zero, for use with commands that care about pod templates. **Release note**: ```release-note NONE ``` Related downstream patch and use-case: https://github.com/openshift/origin/pull/16379 cc @smarterclayton
This commit is contained in:
@@ -449,6 +449,10 @@ func (f *FakeFactory) AttachablePodForObject(ob runtime.Object, timeout time.Dur
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (f *FakeFactory) ApproximatePodTemplateForObject(obj runtime.Object) (*api.PodTemplateSpec, error) {
|
||||
return f.ApproximatePodTemplateForObject(obj)
|
||||
}
|
||||
|
||||
func (f *FakeFactory) UpdatePodSpecForObject(obj runtime.Object, fn func(*api.PodSpec) error) (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
@@ -713,6 +717,10 @@ func (f *fakeAPIFactory) AttachablePodForObject(object runtime.Object, timeout t
|
||||
}
|
||||
}
|
||||
|
||||
func (f *fakeAPIFactory) ApproximatePodTemplateForObject(obj runtime.Object) (*api.PodTemplateSpec, error) {
|
||||
return f.Factory.ApproximatePodTemplateForObject(obj)
|
||||
}
|
||||
|
||||
func (f *fakeAPIFactory) Validator(validate bool) (validation.Schema, error) {
|
||||
return f.tf.Validator, f.tf.Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user