func GenerateAutopilot(in *v1beta2.Autopilot, cluster *container.Cluster) {
	if in != nil {
		if cluster.Autopilot == nil {
			cluster.Autopilot = &container.Autopilot{}
		}
		cluster.Autopilot.Enabled = in.Enabled
	}
}
GenerateAutopilot generates *container.Autopilot from *Autopilot.
package cluster
import (
	"context"
	"encoding/base64"
	"fmt"
	"github.com/google/go-cmp/cmp"
	"github.com/google/go-cmp/cmp/cmpopts"
	"github.com/mitchellh/copystructure"
	container "google.golang.org/api/container/v1"
	clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
	"github.com/crossplane/crossplane-runtime/pkg/errors"
	"github.com/crossplane/provider-gcp/apis/container/v1beta2"
	gcp "github.com/crossplane/provider-gcp/pkg/clients"
)
const (
	BootstrapNodePoolName = "crossplane-bootstrap"
	BNPNameFormat = "%s/nodePools/%s"
	ParentFormat = "projects/%s/locations/%s"
	ClusterNameFormat = "projects/%s/locations/%s/clusters/%s"
)
const (
	errNoSecretInfo  = "missing secret information for GKE cluster"
	errCheckUpToDate = "unable to determine if external resource is up to date"
)
func AddNodePoolForCreate(in *container.Cluster) {
	pool := &container.NodePool{
		Name:             BootstrapNodePoolName,
		InitialNodeCount: 0,
	}
	in.NodePools = []*container.NodePool{pool}
}
func GenerateCluster(name string, in v1beta2.ClusterParameters, cluster *container.Cluster) {  
	cluster.ClusterIpv4Cidr = gcp.StringValue(in.ClusterIpv4Cidr)
	cluster.Description = gcp.StringValue(in.Description)
	cluster.EnableKubernetesAlpha = gcp.BoolValue(in.EnableKubernetesAlpha)
	cluster.EnableTpu = gcp.BoolValue(in.EnableTpu)
	cluster.InitialClusterVersion = gcp.StringValue(in.InitialClusterVersion)
	cluster.LabelFingerprint = gcp.StringValue(in.LabelFingerprint)
	cluster.Locations = in.Locations
	cluster.LoggingService = gcp.StringValue(in.LoggingService)
	cluster.MonitoringService = gcp.StringValue(in.MonitoringService)
	cluster.Name = name
	cluster.Network = gcp.StringValue(in.Network)
	cluster.ResourceLabels = in.ResourceLabels
	cluster.Subnetwork = gcp.StringValue(in.Subnetwork)
	GenerateAddonsConfig(in.AddonsConfig, cluster)
	GenerateAutopilot(in.Autopilot, cluster)
	GenerateAuthenticatorGroupsConfig(in.AuthenticatorGroupsConfig, cluster)
	GenerateAutoscaling(in.Autoscaling, cluster)
	GenerateConfidentialNodes(in.ConfidentialNodes, cluster)
	GenerateBinaryAuthorization(in.BinaryAuthorization, cluster)
	GenerateDatabaseEncryption(in.DatabaseEncryption, cluster)
	GenerateDefaultMaxPodsConstraint(in.DefaultMaxPodsConstraint, cluster)
	GenerateIPAllocationPolicy(in.IPAllocationPolicy, cluster)
	GenerateLegacyAbac(in.LegacyAbac, cluster)
	GenerateMaintenancePolicy(in.MaintenancePolicy, cluster)
	GenerateMasterAuth(in.MasterAuth, cluster)
	GenerateMasterAuthorizedNetworksConfig(in.MasterAuthorizedNetworksConfig, cluster)
	GenerateNetworkConfig(in.NetworkConfig, cluster)
	GenerateNetworkPolicy(in.NetworkPolicy, cluster)
	GenerateNotificationConfig(in.NotificationConfig, cluster)
	GeneratePrivateClusterConfig(in.PrivateClusterConfig, cluster)
	GenerateReleaseChannel(in.ReleaseChannel, cluster)
	GenerateResourceUsageExportConfig(in.ResourceUsageExportConfig, cluster)
	GenerateVerticalPodAutoscaling(in.VerticalPodAutoscaling, cluster)
	GenerateWorkloadIdentityConfig(in.WorkloadIdentityConfig, cluster)
}
func GenerateAddonsConfig(in *v1beta2.AddonsConfig, cluster *container.Cluster) {  
	if in != nil {
		if cluster.AddonsConfig == nil {
			cluster.AddonsConfig = &container.AddonsConfig{}
		}
		if in.CloudRunConfig != nil {
			if cluster.AddonsConfig.CloudRunConfig == nil {
				cluster.AddonsConfig.CloudRunConfig = &container.CloudRunConfig{}
			}
			cluster.AddonsConfig.CloudRunConfig.Disabled = in.CloudRunConfig.Disabled
			cluster.AddonsConfig.CloudRunConfig.LoadBalancerType = gcp.StringValue(in.CloudRunConfig.LoadBalancerType)
			cluster.AddonsConfig.CloudRunConfig.ForceSendFields = []string{"Disabled", "LoadBalancerType"}
		}
		if in.ConfigConnectorConfig != nil {
			if cluster.AddonsConfig.ConfigConnectorConfig == nil {
				cluster.AddonsConfig.ConfigConnectorConfig = &container.ConfigConnectorConfig{}
			}
			cluster.AddonsConfig.ConfigConnectorConfig.Enabled = in.ConfigConnectorConfig.Enabled
			cluster.AddonsConfig.ConfigConnectorConfig.ForceSendFields = []string{"Enabled"}
		}
		if in.DNSCacheConfig != nil {
			if cluster.AddonsConfig.DnsCacheConfig == nil {
				cluster.AddonsConfig.DnsCacheConfig = &container.DnsCacheConfig{}
			}
			cluster.AddonsConfig.DnsCacheConfig.Enabled = in.DNSCacheConfig.Enabled
			cluster.AddonsConfig.DnsCacheConfig.ForceSendFields = []string{"Enabled"}
		}
		if in.GCEPersistentDiskCSIDriverConfig != nil {
			if cluster.AddonsConfig.GcePersistentDiskCsiDriverConfig == nil {
				cluster.AddonsConfig.GcePersistentDiskCsiDriverConfig = &container.GcePersistentDiskCsiDriverConfig{}
			}
			cluster.AddonsConfig.GcePersistentDiskCsiDriverConfig.Enabled = in.GCEPersistentDiskCSIDriverConfig.Enabled
			cluster.AddonsConfig.GcePersistentDiskCsiDriverConfig.ForceSendFields = []string{"Enabled"}
		}
		if in.HorizontalPodAutoscaling != nil {
			if cluster.AddonsConfig.HorizontalPodAutoscaling == nil {
				cluster.AddonsConfig.HorizontalPodAutoscaling = &container.HorizontalPodAutoscaling{}
			}
			cluster.AddonsConfig.HorizontalPodAutoscaling.Disabled = in.HorizontalPodAutoscaling.Disabled
			cluster.AddonsConfig.HorizontalPodAutoscaling.ForceSendFields = []string{"Disabled"}
		}
		if in.HTTPLoadBalancing != nil {
			if cluster.AddonsConfig.HttpLoadBalancing == nil {
				cluster.AddonsConfig.HttpLoadBalancing = &container.HttpLoadBalancing{}
			}
			cluster.AddonsConfig.HttpLoadBalancing.Disabled = in.HTTPLoadBalancing.Disabled
			cluster.AddonsConfig.HttpLoadBalancing.ForceSendFields = []string{"Disabled"}
		}
		if in.KubernetesDashboard != nil {
			if cluster.AddonsConfig.KubernetesDashboard == nil {
				cluster.AddonsConfig.KubernetesDashboard = &container.KubernetesDashboard{}
			}
			cluster.AddonsConfig.KubernetesDashboard.Disabled = in.KubernetesDashboard.Disabled
			cluster.AddonsConfig.KubernetesDashboard.ForceSendFields = []string{"Disabled"}
		}
		if in.NetworkPolicyConfig != nil {
			if cluster.AddonsConfig.NetworkPolicyConfig == nil {
				cluster.AddonsConfig.NetworkPolicyConfig = &container.NetworkPolicyConfig{}
			}
			cluster.AddonsConfig.NetworkPolicyConfig.Disabled = in.NetworkPolicyConfig.Disabled
			cluster.AddonsConfig.NetworkPolicyConfig.ForceSendFields = []string{"Disabled"}
		}
	}
}