Skip to content

Commit 7bf3ea6

Browse files
authored
Merge pull request #7839 from knabben/drop-clone-template
⚠️ Removing CloneTemplate and CloneTemplateInput
2 parents aebde5b + d485bbe commit 7bf3ea6

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

controllers/external/util.go

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -59,65 +59,6 @@ func Delete(ctx context.Context, c client.Writer, ref *corev1.ObjectReference) e
5959
return nil
6060
}
6161

62-
// CloneTemplateInput is the input to CloneTemplate.
63-
//
64-
// Deprecated: use CreateFromTemplateInput instead. This type will be removed in a future release.
65-
type CloneTemplateInput struct {
66-
// Client is the controller runtime client.
67-
Client client.Client
68-
69-
// TemplateRef is a reference to the template that needs to be cloned.
70-
TemplateRef *corev1.ObjectReference
71-
72-
// Namespace is the Kubernetes namespace the cloned object should be created into.
73-
Namespace string
74-
75-
// ClusterName is the cluster this object is linked to.
76-
ClusterName string
77-
78-
// OwnerRef is an optional OwnerReference to attach to the cloned object.
79-
// +optional
80-
OwnerRef *metav1.OwnerReference
81-
82-
// Labels is an optional map of labels to be added to the object.
83-
// +optional
84-
Labels map[string]string
85-
86-
// Annotations is an optional map of annotations to be added to the object.
87-
// +optional
88-
Annotations map[string]string
89-
}
90-
91-
// CloneTemplate uses the client and the reference to create a new object from the template.
92-
//
93-
// Deprecated: use CreateFromTemplate instead. This function will be removed in a future release.
94-
func CloneTemplate(ctx context.Context, in *CloneTemplateInput) (*corev1.ObjectReference, error) {
95-
from, err := Get(ctx, in.Client, in.TemplateRef, in.Namespace)
96-
if err != nil {
97-
return nil, err
98-
}
99-
generateTemplateInput := &GenerateTemplateInput{
100-
Template: from,
101-
TemplateRef: in.TemplateRef,
102-
Namespace: in.Namespace,
103-
ClusterName: in.ClusterName,
104-
OwnerRef: in.OwnerRef,
105-
Labels: in.Labels,
106-
Annotations: in.Annotations,
107-
}
108-
to, err := GenerateTemplate(generateTemplateInput)
109-
if err != nil {
110-
return nil, err
111-
}
112-
113-
// Create the external clone.
114-
if err := in.Client.Create(ctx, to); err != nil {
115-
return nil, err
116-
}
117-
118-
return GetObjectReference(to), nil
119-
}
120-
12162
// CreateFromTemplateInput is the input to CreateFromTemplate.
12263
type CreateFromTemplateInput struct {
12364
// Client is the controller runtime client.

docs/book/src/developer/providers/v1.3-to-v1.4.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ maintainers of providers and consumers of our Go API.
2222

2323
- `clusterctl backup` has been removed.
2424
- `MachineHealthCheckSuccededCondition` condition type has been removed.
25+
- `CloneTemplate` and `CloneTemplateInput` has been removed.
2526

2627
### API Changes
2728

0 commit comments

Comments
 (0)