Skip to content

Commit fbbe1d3

Browse files
committed
Add API server NetworkPolicy to support a potential deny all egress
1 parent b317598 commit fbbe1d3

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

controllers/webspherelibertyapplication_controller.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -941,20 +941,15 @@ func (r *ReconcileWebSphereLiberty) deletePVC(reqLogger logr.Logger, pvcName str
941941
}
942942
}
943943

944-
// If a custome hostname was previously set, but is now not set, any previous
945-
// route needs to be deleted, as the host in a route cannot be unset
946-
// and the default generated hostname is difficult to manually recreate
947-
func shouldDeleteRoute(ba common.BaseComponent) bool {
948-
rh := ba.GetStatus().GetReferences()[common.StatusReferenceRouteHost]
949-
if rh != "" {
950-
// The host was previously set.
951-
// If the host is now empty, delete the old route
952-
rt := ba.GetRoute()
953-
if rt == nil || (rt.GetHost() == "" && common.Config[common.OpConfigDefaultHostname] == "") {
954-
return true
955-
}
944+
func (r *ReconcileWebSphereLiberty) getKubeAPIServerEndpoints() (*corev1.Endpoints, error) {
945+
serviceName := "kubernetes"
946+
namespace := "default"
947+
endpoints := &corev1.Endpoints{}
948+
if err := r.GetClient().Get(context.TODO(), types.NamespacedName{Name: serviceName, Namespace: namespace}, endpoints); err != nil {
949+
return nil, err
950+
} else {
951+
return endpoints, nil
956952
}
957-
return false
958953
}
959954

960955
func (r *ReconcileWebSphereLiberty) getEndpoints(serviceName string, namespace string) (*corev1.Endpoints, error) {

0 commit comments

Comments
 (0)