@@ -59,65 +59,6 @@ func Delete(ctx context.Context, c client.Writer, ref *corev1.ObjectReference) e
59
59
return nil
60
60
}
61
61
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
-
121
62
// CreateFromTemplateInput is the input to CreateFromTemplate.
122
63
type CreateFromTemplateInput struct {
123
64
// Client is the controller runtime client.
0 commit comments