debug some typo

This commit is contained in:
pb 2025-04-11 15:45:28 +02:00
parent 98c54eb080
commit aa42f5f49c

View File

@ -309,7 +309,7 @@ func (k *KubernetesService) CreateAdmiraltyTarget(context context.Context,execut
}, },
} }
res, err := dynamicClientApply(executionId, gvrTargets, context, target) res, err := dynamicClientApply(executionId, "target", gvrTargets, context, target)
if err != nil { if err != nil {
return nil, errors.New("Error when trying to apply Source definition :" + err.Error()) return nil, errors.New("Error when trying to apply Source definition :" + err.Error())
} }
@ -342,7 +342,7 @@ func (k *KubernetesService) CreateAdmiraltySource(context context.Context,execut
} }
res, err := dynamicClientApply(executionId, gvrSources, context, source) res, err := dynamicClientApply(executionId, "source",gvrSources, context, source)
if err != nil { if err != nil {
return nil, errors.New("Error when trying to apply Source definition :" + err.Error()) return nil, errors.New("Error when trying to apply Source definition :" + err.Error())
} }
@ -452,7 +452,7 @@ func getCDRapiKube(client kubernetes.Clientset, ctx context.Context, path string
return resp, nil return resp, nil
} }
func dynamicClientApply(executionId string, resourceDefinition schema.GroupVersionResource, ctx context.Context, object map[string]interface{}) ([]byte, error) { func dynamicClientApply(executionId string, typeResource string, resourceDefinition schema.GroupVersionResource, ctx context.Context, object map[string]interface{}) ([]byte, error) {
cli, err := NewDynamicClient() cli, err := NewDynamicClient()
if err != nil { if err != nil {
return nil, errors.New("Could not retrieve dynamic client when creating Admiralty Source : " + err.Error()) return nil, errors.New("Could not retrieve dynamic client when creating Admiralty Source : " + err.Error())
@ -461,7 +461,7 @@ func dynamicClientApply(executionId string, resourceDefinition schema.GroupVersi
res, err := cli.Resource(resourceDefinition). res, err := cli.Resource(resourceDefinition).
Namespace(executionId). Namespace(executionId).
Apply(ctx, Apply(ctx,
"source-"+executionId, typeResource + "-" + executionId,
&unstructured.Unstructured{Object: object}, &unstructured.Unstructured{Object: object},
metav1.ApplyOptions{ metav1.ApplyOptions{
FieldManager: "kubectl-client-side-apply", FieldManager: "kubectl-client-side-apply",