|
7 | 7 | "github.com/go-logr/logr"
|
8 | 8 | mesheryv1alpha1 "github.com/layer5io/meshery-operator/api/v1alpha1"
|
9 | 9 | mesherykube "github.com/layer5io/meshkit/utils/kubernetes"
|
| 10 | + v1 "k8s.io/api/apps/v1" |
10 | 11 | corev1 "k8s.io/api/core/v1"
|
11 | 12 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
12 | 13 | runtime "k8s.io/apimachinery/pkg/runtime"
|
@@ -35,27 +36,31 @@ func GetObjects(m *mesheryv1alpha1.Broker) map[string]Object {
|
35 | 36 | }
|
36 | 37 |
|
37 | 38 | func getServerObject(namespace, name string, replicas int32) Object {
|
38 |
| - obj := StatefulSet |
| 39 | + var obj = &v1.StatefulSet{} |
| 40 | + StatefulSet.DeepCopyInto(obj) |
39 | 41 | obj.ObjectMeta.Namespace = namespace
|
40 | 42 | obj.ObjectMeta.Name = name
|
41 | 43 | obj.Spec.Replicas = &replicas
|
42 | 44 | return obj
|
43 | 45 | }
|
44 | 46 |
|
45 | 47 | func getServiceObject(namespace, name string) Object {
|
46 |
| - obj := Service |
| 48 | + var obj = &corev1.Service{} |
| 49 | + Service.DeepCopyInto(obj) |
47 | 50 | obj.ObjectMeta.Name = name
|
48 | 51 | obj.ObjectMeta.Namespace = namespace
|
49 | 52 | return obj
|
50 | 53 | }
|
51 | 54 |
|
52 | 55 | func getServerConfig() Object {
|
53 |
| - obj := NatsConfigMap |
| 56 | + var obj = &corev1.ConfigMap{} |
| 57 | + NatsConfigMap.DeepCopyInto(obj) |
54 | 58 | return obj
|
55 | 59 | }
|
56 | 60 |
|
57 | 61 | func getAccountConfig() Object {
|
58 |
| - obj := AccountsConfigMap |
| 62 | + var obj = &corev1.ConfigMap{} |
| 63 | + AccountsConfigMap.DeepCopyInto(obj) |
59 | 64 | return obj
|
60 | 65 | }
|
61 | 66 |
|
|
0 commit comments