We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5dc994 commit 8db8728Copy full SHA for 8db8728
pkg/templates/danglingservice/template.go
@@ -44,14 +44,17 @@ func init() {
44
Message: "service has no selector specified",
45
}}
46
} else {
47
+ // Check if Service is linked to Endpoints
48
for _, obj := range lintCtx.Objects() {
- if obj.(type) = *batchV1Beta1.Endpoints {
49
+
50
+ endpoints, ok := object.K8sObject.(*v1.Endpoints)
51
+ if !ok {
52
continue
53
}
- if service.Namespace != obj.K8sObject.GetNamespace() {
54
+ if endpoints.Namespace != obj.K8sObject.GetNamespace() {
55
56
- if service.Spec.Name == endpointTemplateSpec.Spec.Name {
57
+ if endpoints.Name == obj.GetK8sObjectName().Name {
58
// Found!
59
return nil
60
0 commit comments