Skip to content

Commit

Permalink
Merge pull request #2315 from kyrtapz/roks_net_id_4.14
Browse files Browse the repository at this point in the history
[release-4.14] OCPBUGS-30021: Fully disable network-node-identity on ROKS
  • Loading branch information
openshift-merge-bot[bot] committed Apr 8, 2024
2 parents 8053c62 + c5467b6 commit d429c8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 0 additions & 10 deletions pkg/network/node_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"os"
"path/filepath"

configv1 "github.com/openshift/api/config/v1"
operv1 "github.com/openshift/api/operator/v1"
"github.com/openshift/cluster-network-operator/pkg/bootstrap"
cnoclient "github.com/openshift/cluster-network-operator/pkg/client"
Expand Down Expand Up @@ -55,15 +54,6 @@ func renderNetworkNodeIdentity(conf *operv1.NetworkSpec, bootstrapResult *bootst
klog.Infof("Network node identity is disabled")
return nil, nil
}
if bootstrapResult.Infra.ControlPlaneTopology == configv1.ExternalTopologyMode &&
bootstrapResult.Infra.PlatformType == configv1.IBMCloudPlatformType {
// In environments with external control plane topology, the API server is deployed out of cluster.
// This means that CNO cannot easily predict how to deploy and enforce the node identity webhook.
// IBMCloud uses an external control plane topology with Calico as the CNI for both HyperShift based ROKS
// deployments and IBM ROKS Toolkit based ROKS deployments.
klog.Infof("Network node identity is disabled on %s platorm", configv1.IBMCloudPlatformType)
return nil, nil
}
data := render.MakeRenderData()
data.Data["ReleaseVersion"] = os.Getenv("RELEASE_VERSION")
data.Data["OVNHybridOverlayEnable"] = false
Expand Down
14 changes: 12 additions & 2 deletions pkg/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,17 @@ var cloudProviderConfig = types.NamespacedName{
// isNetworkNodeIdentityEnabled determines if network node identity should be enabled.
// It checks the `enabled` key in the network-node-identity/openshift-network-operator configmap.
// If the configmap doesn't exist, it returns true (the feature is enabled by default).
func isNetworkNodeIdentityEnabled(client cnoclient.Client) (bool, error) {
func isNetworkNodeIdentityEnabled(client cnoclient.Client, infra *bootstrap.InfraStatus) (bool, error) {
if infra.ControlPlaneTopology == configv1.ExternalTopologyMode &&
infra.PlatformType == configv1.IBMCloudPlatformType {
// In environments with external control plane topology, the API server is deployed out of cluster.
// This means that CNO cannot easily predict how to deploy and enforce the node identity webhook.
// IBMCloud uses an external control plane topology with Calico as the CNI for both HyperShift based ROKS
// deployments and IBM ROKS Toolkit based ROKS deployments.
klog.Infof("Network node identity is disabled on %s platorm", configv1.IBMCloudPlatformType)
return false, nil
}

nodeIdentity := &corev1.ConfigMap{}
nodeIdentityLookup := types.NamespacedName{Name: "network-node-identity", Namespace: names.APPLIED_NAMESPACE}
if err := client.ClientFor("").CRClient().Get(context.TODO(), nodeIdentityLookup, nodeIdentity); err != nil {
Expand Down Expand Up @@ -130,7 +140,7 @@ func InfraStatus(client cnoclient.Client) (*bootstrap.InfraStatus, error) {
}
}

netIDEnabled, err := isNetworkNodeIdentityEnabled(client)
netIDEnabled, err := isNetworkNodeIdentityEnabled(client, res)
if err != nil {
return nil, fmt.Errorf("failed to determine if network node identity should be enabled: %w", err)
}
Expand Down

0 comments on commit d429c8b

Please sign in to comment.