Skip to content

use <portNumber>-<protocol> as pod container port name in devfile library generator #287

Closed
@yangcao77

Description

@yangcao77

The generator currently is using the devfile Endpoint name as the pod container port name. However, the pod container port name has a 15 characters limit, and as a result, Endpoint name is limited to be less than 15 characters.

Since Odo now wants to remove that 15 characters truncating for URL Name:redhat-developer/odo#4060, I rechecked the 15 chars limitation only applies to pod container port name.

We can apply how Odo deals with the port name for S2I projects, use <portNumber>-<protocol> as the name :https://github.com/openshift/odo/blob/cdfa5450201702406feefe3e4de3cc3f5ee494be/pkg/util/util.go#L575-L578

		port := corev1.ContainerPort{
			Name:          fmt.Sprintf("%d-%s", portNumber, strings.ToLower(string(portProto))),
			ContainerPort: portNumber,
			Protocol:      portProto,
			}

Metadata

Metadata

Assignees

Labels

area/apiEnhancement or issue related to the api/devfile specificationkind/enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions