@Override
    public void registerInstance(String namespaceId, String serviceName, Instance instance) throws NacosException {
        NamingUtils.checkInstanceIsLegal(instance);
        
        boolean ephemeral = instance.isEphemeral();
        String clientId = IpPortBasedClient.getClientId(instance.toInetAddr(), ephemeral);
        createIpPortClientIfAbsent(clientId);
        Service service = getService(namespaceId, serviceName, ephemeral);
        clientOperationService.registerInstance(service, instance, clientId);
    }
@Test
    void testRegisterInstanceWithInvalidClusterName() throws NacosException {
        Throwable exception = assertThrows(NacosException.class, () -> {
            
            Instance instance = new Instance();
            instance.setEphemeral(true);
            instance.setClusterName("cluster1,cluster2");
            new InstanceOperatorClientImpl(null, null, null, null, null, null, null).registerInstance("ns-01", "serviceName01", instance);
        });
        assertTrue(exception.getMessage()
                .contains("Instance 'clusterName' should be characters with only 0-9a-zA-Z-. (current: cluster1,cluster2)"));
    }