Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

bug: child resource header comments include confusing characters #246

Open
scottd018 opened this issue Jan 12, 2022 · 0 comments
Open

bug: child resource header comments include confusing characters #246

scottd018 opened this issue Jan 12, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@scottd018
Copy link
Contributor

Given the following:

// CreateServiceServiceNameSvc creates the !!start parent.Spec.Service.Name !!end-svc Service resource.
func CreateServiceServiceNameSvc(
	parent *appsv1alpha1.WebStore,
) ([]client.Object, error) {

	resourceObjs := []client.Object{}
	var resourceObj = &unstructured.Unstructured{
		Object: map[string]interface{}{
			"kind":       "Service",
			"apiVersion": "v1",
			"metadata": map[string]interface{}{
				"name": "" + parent.Spec.Service.Name + "-svc", //  controlled by field: service.name
			},
			"spec": map[string]interface{}{
				"selector": map[string]interface{}{
					// controlled by field: app.label
					"app": parent.Spec.App.Label,
				},
				"ports": []interface{}{
					map[string]interface{}{
						"protocol": "TCP",
						// controlled by field: webstore.really.long.path.required.port
						"port": parent.Spec.Webstore.Really.Long.Path.Required.Port,
						// controlled by field: service.targetPort
						"targetPort": parent.Spec.Service.TargetPort,
					},
				},
			},
		},
	}

	resourceObj.SetNamespace(parent.Namespace)

	resourceObjs = append(resourceObjs, resourceObj)

	return resourceObjs, nil
}

The comment text !!start parent.Spec.Service.Name !!end-svc Service resource. is a bit confusing. I am suspecting this is being parsed out inappropriately.

@scottd018 scottd018 added the bug Something isn't working label Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant