expect(result[:message]).toeq('pod_name can contain only lowercase letters, digits, \'-\', and \'.\' and must start and end with an alphanumeric character')
end
end
describe'#check_container_name'do
...
...
@@ -287,5 +294,16 @@ describe ::PodLogs::KubernetesService do
expect(result[:status]).toeq(:error)
expect(result[:message]).toeq('container_name cannot be larger than 253 chars')
end
it'returns error if container_name is in invalid format'do
result=subject.send(:check_container_name,
container_name: "Invalid_container_name",
pod_name: pod_name,
raw_pods: raw_pods
)
expect(result[:status]).toeq(:error)
expect(result[:message]).toeq('container_name can contain only lowercase letters, digits, \'-\', and \'.\' and must start and end with an alphanumeric character')