Skip to content

Commit cfc27d9

Browse files
kabicinKirby Chin
authored andcommitted
Add API server NetworkPolicy to support a potential deny all egress
1 parent 456940a commit cfc27d9

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
@@ -946,20 +946,15 @@ func (r *ReconcileWebSphereLiberty) deletePVC(reqLogger logr.Logger, pvcName str
946946
}
947947
}
948948

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

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

0 commit comments

Comments
 (0)