From 344b99b2c8d543409b758e462fd6bd5aa5bc6fec Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Wed, 10 Apr 2024 10:17:10 -0700 Subject: [PATCH 01/20] polishing contract --- pkg/parser/utilities.go | 2 +- pkg/proto/nbcontract/v1/apiserverconfig.pb.go | 4 +- pkg/proto/nbcontract/v1/apiserverconfig.proto | 3 + pkg/proto/nbcontract/v1/authconfig.pb.go | 21 +- pkg/proto/nbcontract/v1/authconfig.proto | 23 +- pkg/proto/nbcontract/v1/clusterconfig.pb.go | 47 +- pkg/proto/nbcontract/v1/clusterconfig.proto | 40 +- pkg/proto/nbcontract/v1/config.pb.go | 515 +++++++++--------- pkg/proto/nbcontract/v1/config.proto | 178 +++--- .../nbcontract/v1/containerdconfig.pb.go | 7 +- .../nbcontract/v1/containerdconfig.proto | 6 + .../nbcontract/v1/customcloudconfig.pb.go | 6 +- .../nbcontract/v1/customcloudconfig.proto | 2 + pkg/proto/nbcontract/v1/gpuconfig.pb.go | 6 +- pkg/proto/nbcontract/v1/gpuconfig.proto | 6 +- pkg/proto/nbcontract/v1/httpproxyconfig.pb.go | 8 +- pkg/proto/nbcontract/v1/httpproxyconfig.proto | 8 +- .../nbcontract/v1/kubebinaryconfig.pb.go | 9 +- .../nbcontract/v1/kubebinaryconfig.proto | 12 +- pkg/proto/nbcontract/v1/kubeletconfig.pb.go | 20 +- pkg/proto/nbcontract/v1/kubeletconfig.proto | 17 +- pkg/proto/nbcontract/v1/networkconfig.pb.go | 12 +- pkg/proto/nbcontract/v1/networkconfig.proto | 7 +- pkg/proto/nbcontract/v1/runcconfig.pb.go | 4 +- pkg/proto/nbcontract/v1/runcconfig.proto | 4 + pkg/proto/nbcontract/v1/teleportconfig.pb.go | 4 +- pkg/proto/nbcontract/v1/teleportconfig.proto | 4 + .../nbcontract/v1/tlsbootstrapconfig.pb.go | 190 +++++++ .../nbcontract/v1/tlsbootstrapconfig.proto | 13 + .../v1/tlsbootstrappingconfig.pb.go | 188 ------- .../v1/tlsbootstrappingconfig.proto | 8 - 31 files changed, 762 insertions(+), 612 deletions(-) create mode 100644 pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go create mode 100644 pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto delete mode 100644 pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go delete mode 100644 pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto diff --git a/pkg/parser/utilities.go b/pkg/parser/utilities.go index 44f2e5347b2..ef3ac95c65d 100644 --- a/pkg/parser/utilities.go +++ b/pkg/parser/utilities.go @@ -16,7 +16,7 @@ func getBaseTemplate() *nbcontractv1.Configuration { CustomKubeBinaryUrl: "https://acs-mirror.azureedge.net/kubernetes/v1.26.0/binaries/kubernetes-node-linux-amd64.tar.gz", PrivateKubeBinaryUrl: "", }, - KubeproxyUrl: "", + KubeProxyUrl: "", EnableSsh: true, } } diff --git a/pkg/proto/nbcontract/v1/apiserverconfig.pb.go b/pkg/proto/nbcontract/v1/apiserverconfig.pb.go index c6c6f5f016d..4a6f8e45c83 100644 --- a/pkg/proto/nbcontract/v1/apiserverconfig.pb.go +++ b/pkg/proto/nbcontract/v1/apiserverconfig.pb.go @@ -25,8 +25,10 @@ type ApiServerConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The certificate public key of the API server. ApiServerPublicKey string `protobuf:"bytes,1,opt,name=api_server_public_key,json=apiServerPublicKey,proto3" json:"api_server_public_key,omitempty"` - ApiServerName string `protobuf:"bytes,2,opt,name=api_server_name,json=apiServerName,proto3" json:"api_server_name,omitempty"` + // The name or endpoint URI of the API server. + ApiServerName string `protobuf:"bytes,2,opt,name=api_server_name,json=apiServerName,proto3" json:"api_server_name,omitempty"` } func (x *ApiServerConfig) Reset() { diff --git a/pkg/proto/nbcontract/v1/apiserverconfig.proto b/pkg/proto/nbcontract/v1/apiserverconfig.proto index 32400c776c0..e2d3f90748d 100644 --- a/pkg/proto/nbcontract/v1/apiserverconfig.proto +++ b/pkg/proto/nbcontract/v1/apiserverconfig.proto @@ -2,6 +2,9 @@ syntax = "proto3"; package nbcontract.v1; message ApiServerConfig { + // The certificate public key of the API server. string api_server_public_key = 1; + + // The name or endpoint URI of the API server. string api_server_name = 2; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/authconfig.pb.go b/pkg/proto/nbcontract/v1/authconfig.pb.go index c0ee011a18f..e0d39cfe823 100644 --- a/pkg/proto/nbcontract/v1/authconfig.pb.go +++ b/pkg/proto/nbcontract/v1/authconfig.pb.go @@ -26,13 +26,20 @@ type AuthConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TargetCloud string `protobuf:"bytes,1,opt,name=target_cloud,json=targetCloud,proto3" json:"target_cloud,omitempty"` // set to cloud, default to AzurePublicCloud - TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` - SubscriptionId string `protobuf:"bytes,3,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` - ServicePrincipalId string `protobuf:"bytes,4,opt,name=service_principal_id,json=servicePrincipalId,proto3" json:"service_principal_id,omitempty"` // set to aadClientId - ServicePrincipalSecret string `protobuf:"bytes,5,opt,name=service_principal_secret,json=servicePrincipalSecret,proto3" json:"service_principal_secret,omitempty"` // set to aadClientSecret - AssignedIdentityId string `protobuf:"bytes,6,opt,name=assigned_identity_id,json=assignedIdentityId,proto3" json:"assigned_identity_id,omitempty"` //could be user or system assigned, depending on the type - UseManagedIdentityExtension bool `protobuf:"varint,7,opt,name=use_managed_identity_extension,json=useManagedIdentityExtension,proto3" json:"use_managed_identity_extension,omitempty"` // default to false + // Target cloud. Set to cloud. Default to AzurePublicCloud + TargetCloud string `protobuf:"bytes,1,opt,name=target_cloud,json=targetCloud,proto3" json:"target_cloud,omitempty"` + // Tenant ID + TenantId string `protobuf:"bytes,2,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"` + // Subscription ID + SubscriptionId string `protobuf:"bytes,3,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"` + // Service Principal ID. set to aadClientId + ServicePrincipalId string `protobuf:"bytes,4,opt,name=service_principal_id,json=servicePrincipalId,proto3" json:"service_principal_id,omitempty"` + // Service Principal Secret. set to aadClientSecret + ServicePrincipalSecret string `protobuf:"bytes,5,opt,name=service_principal_secret,json=servicePrincipalSecret,proto3" json:"service_principal_secret,omitempty"` + // Assigned identity id, could be user or system assigned, depending on the type. + AssignedIdentityId string `protobuf:"bytes,6,opt,name=assigned_identity_id,json=assignedIdentityId,proto3" json:"assigned_identity_id,omitempty"` + // Specify if use managed identity extension, default to false + UseManagedIdentityExtension bool `protobuf:"varint,7,opt,name=use_managed_identity_extension,json=useManagedIdentityExtension,proto3" json:"use_managed_identity_extension,omitempty"` } func (x *AuthConfig) Reset() { diff --git a/pkg/proto/nbcontract/v1/authconfig.proto b/pkg/proto/nbcontract/v1/authconfig.proto index 82310d5e831..059abc3b16d 100644 --- a/pkg/proto/nbcontract/v1/authconfig.proto +++ b/pkg/proto/nbcontract/v1/authconfig.proto @@ -3,11 +3,24 @@ package nbcontract.v1; // Auth Config fields stored in azure.json used by cloud-provider-azure message AuthConfig { - string target_cloud = 1; // set to cloud, default to AzurePublicCloud + // Target cloud. Set to cloud. Default to AzurePublicCloud + string target_cloud = 1; + + // Tenant ID string tenant_id = 2; + + // Subscription ID string subscription_id = 3; - string service_principal_id = 4; // set to aadClientId - string service_principal_secret = 5; // set to aadClientSecret - string assigned_identity_id = 6; //could be user or system assigned, depending on the type - bool use_managed_identity_extension = 7; // default to false + + // Service Principal ID. set to aadClientId + string service_principal_id = 4; + + // Service Principal Secret. set to aadClientSecret + string service_principal_secret = 5; + + // Assigned identity id, could be user or system assigned, depending on the type. + string assigned_identity_id = 6; + + // Specify if use managed identity extension, default to false + bool use_managed_identity_extension = 7; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/clusterconfig.pb.go b/pkg/proto/nbcontract/v1/clusterconfig.pb.go index 224b83d4759..438ae620893 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.pb.go +++ b/pkg/proto/nbcontract/v1/clusterconfig.pb.go @@ -124,14 +124,22 @@ type ClusterConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ResourceGroup string `protobuf:"bytes,1,opt,name=resource_group,json=resourceGroup,proto3" json:"resource_group,omitempty"` - Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` - VmType ClusterConfig_VM `protobuf:"varint,3,opt,name=vm_type,json=vmType,proto3,enum=nbcontract.v1.ClusterConfig_VM" json:"vm_type,omitempty"` // default to standard for v1.27 and below versions and vmss for v1.28+ versions - PrimaryAvailabilitySet string `protobuf:"bytes,4,opt,name=primary_availability_set,json=primaryAvailabilitySet,proto3" json:"primary_availability_set,omitempty"` - PrimaryScaleSet string `protobuf:"bytes,5,opt,name=primary_scale_set,json=primaryScaleSet,proto3" json:"primary_scale_set,omitempty"` - VirtualNetworkConfig *ClusterNetworkConfig `protobuf:"bytes,6,opt,name=virtual_network_config,json=virtualNetworkConfig,proto3" json:"virtual_network_config,omitempty"` - UseInstanceMetadata bool `protobuf:"varint,7,opt,name=use_instance_metadata,json=useInstanceMetadata,proto3" json:"use_instance_metadata,omitempty"` // default to false - LoadBalancerConfig *LoadBalancerConfig `protobuf:"bytes,8,opt,name=load_balancer_config,json=loadBalancerConfig,proto3" json:"load_balancer_config,omitempty"` + // Rescource group name + ResourceGroup string `protobuf:"bytes,1,opt,name=resource_group,json=resourceGroup,proto3" json:"resource_group,omitempty"` + // Location + Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` + // VM type + VmType ClusterConfig_VM `protobuf:"varint,3,opt,name=vm_type,json=vmType,proto3,enum=nbcontract.v1.ClusterConfig_VM" json:"vm_type,omitempty"` // default to standard for v1.27 and below versions and vmss for v1.28+ versions + // Primary availability set name + PrimaryAvailabilitySet string `protobuf:"bytes,4,opt,name=primary_availability_set,json=primaryAvailabilitySet,proto3" json:"primary_availability_set,omitempty"` + // Primary scale set name + PrimaryScaleSet string `protobuf:"bytes,5,opt,name=primary_scale_set,json=primaryScaleSet,proto3" json:"primary_scale_set,omitempty"` + // Cluster network config + VirtualNetworkConfig *ClusterNetworkConfig `protobuf:"bytes,6,opt,name=virtual_network_config,json=virtualNetworkConfig,proto3" json:"virtual_network_config,omitempty"` + // Specifiy if it uses instance metadata + UseInstanceMetadata bool `protobuf:"varint,7,opt,name=use_instance_metadata,json=useInstanceMetadata,proto3" json:"use_instance_metadata,omitempty"` // default to false + // Load balancer config + LoadBalancerConfig *LoadBalancerConfig `protobuf:"bytes,8,opt,name=load_balancer_config,json=loadBalancerConfig,proto3" json:"load_balancer_config,omitempty"` } func (x *ClusterConfig) Reset() { @@ -227,11 +235,16 @@ type ClusterNetworkConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - VnetName string `protobuf:"bytes,1,opt,name=vnet_name,json=vnetName,proto3" json:"vnet_name,omitempty"` + // Virtual network name + VnetName string `protobuf:"bytes,1,opt,name=vnet_name,json=vnetName,proto3" json:"vnet_name,omitempty"` + // Virtual network resource group VnetResourceGroup string `protobuf:"bytes,2,opt,name=vnet_resource_group,json=vnetResourceGroup,proto3" json:"vnet_resource_group,omitempty"` - Subnet string `protobuf:"bytes,3,opt,name=subnet,proto3" json:"subnet,omitempty"` + // Subnet name + Subnet string `protobuf:"bytes,3,opt,name=subnet,proto3" json:"subnet,omitempty"` + // Network security group name SecurityGroupName string `protobuf:"bytes,4,opt,name=security_group_name,json=securityGroupName,proto3" json:"security_group_name,omitempty"` - RouteTable string `protobuf:"bytes,5,opt,name=route_table,json=routeTable,proto3" json:"route_table,omitempty"` + // Route table name + RouteTable string `protobuf:"bytes,5,opt,name=route_table,json=routeTable,proto3" json:"route_table,omitempty"` } func (x *ClusterNetworkConfig) Reset() { @@ -306,10 +319,14 @@ type LoadBalancerConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - LoadBalancerSku LoadBalancerConfig_LoadBalancerSku `protobuf:"varint,1,opt,name=load_balancer_sku,json=loadBalancerSku,proto3,enum=nbcontract.v1.LoadBalancerConfig_LoadBalancerSku" json:"load_balancer_sku,omitempty"` // default to basic - ExcludeMasterFromStandardLoadBalancer *bool `protobuf:"varint,2,opt,name=exclude_master_from_standard_load_balancer,json=excludeMasterFromStandardLoadBalancer,proto3,oneof" json:"exclude_master_from_standard_load_balancer,omitempty"` // default to true - MaxLoadBalancerRuleCount *int32 `protobuf:"varint,3,opt,name=max_load_balancer_rule_count,json=maxLoadBalancerRuleCount,proto3,oneof" json:"max_load_balancer_rule_count,omitempty"` // default to 148 - DisableOutboundSnat *bool `protobuf:"varint,4,opt,name=disable_outbound_snat,json=disableOutboundSnat,proto3,oneof" json:"disable_outbound_snat,omitempty"` // default to false + // Load balancer sku, default to basic + LoadBalancerSku LoadBalancerConfig_LoadBalancerSku `protobuf:"varint,1,opt,name=load_balancer_sku,json=loadBalancerSku,proto3,enum=nbcontract.v1.LoadBalancerConfig_LoadBalancerSku" json:"load_balancer_sku,omitempty"` + // Specify if master node should be excluded from standard load balancer, default to true + ExcludeMasterFromStandardLoadBalancer *bool `protobuf:"varint,2,opt,name=exclude_master_from_standard_load_balancer,json=excludeMasterFromStandardLoadBalancer,proto3,oneof" json:"exclude_master_from_standard_load_balancer,omitempty"` + // Maximum number of load balancer rules, default to 148 + MaxLoadBalancerRuleCount *int32 `protobuf:"varint,3,opt,name=max_load_balancer_rule_count,json=maxLoadBalancerRuleCount,proto3,oneof" json:"max_load_balancer_rule_count,omitempty"` + // Disable outbound SNAT (Source Network Address Translation) for load balancer, default to false + DisableOutboundSnat *bool `protobuf:"varint,4,opt,name=disable_outbound_snat,json=disableOutboundSnat,proto3,oneof" json:"disable_outbound_snat,omitempty"` } func (x *LoadBalancerConfig) Reset() { diff --git a/pkg/proto/nbcontract/v1/clusterconfig.proto b/pkg/proto/nbcontract/v1/clusterconfig.proto index 4c24478ba4d..245207ddcdc 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.proto +++ b/pkg/proto/nbcontract/v1/clusterconfig.proto @@ -3,13 +3,29 @@ package nbcontract.v1; // Cluster Config fields stored in azure.json used by cloud-provider-azure message ClusterConfig { + + // Rescource group name string resource_group = 1; + + // Location string location = 2; + + // VM type VM vm_type = 3; // default to standard for v1.27 and below versions and vmss for v1.28+ versions + + // Primary availability set name string primary_availability_set = 4; + + // Primary scale set name string primary_scale_set = 5; + + // Cluster network config ClusterNetworkConfig virtual_network_config = 6; + + // Specifiy if it uses instance metadata bool use_instance_metadata = 7; // default to false + + // Load balancer config LoadBalancerConfig load_balancer_config = 8; enum VM { @@ -20,18 +36,34 @@ message ClusterConfig { } message ClusterNetworkConfig { + // Virtual network name string vnet_name = 1; + + // Virtual network resource group string vnet_resource_group = 2; + + // Subnet name string subnet = 3; + + // Network security group name string security_group_name = 4; + + // Route table name string route_table = 5; } message LoadBalancerConfig { - LoadBalancerSku load_balancer_sku = 1; // default to basic - optional bool exclude_master_from_standard_load_balancer = 2; // default to true - optional int32 max_load_balancer_rule_count = 3; // default to 148 - optional bool disable_outbound_snat = 4; // default to false + // Load balancer sku, default to basic + LoadBalancerSku load_balancer_sku = 1; + + // Specify if master node should be excluded from standard load balancer, default to true + optional bool exclude_master_from_standard_load_balancer = 2; + + // Maximum number of load balancer rules, default to 148 + optional int32 max_load_balancer_rule_count = 3; + + // Disable outbound SNAT (Source Network Address Translation) for load balancer, default to false + optional bool disable_outbound_snat = 4; enum LoadBalancerSku { UNSPECIFIED = 0; diff --git a/pkg/proto/nbcontract/v1/config.pb.go b/pkg/proto/nbcontract/v1/config.pb.go index 6ecf87545d6..1b83c71416b 100644 --- a/pkg/proto/nbcontract/v1/config.pb.go +++ b/pkg/proto/nbcontract/v1/config.pb.go @@ -69,71 +69,86 @@ func (WorkloadRuntime) EnumDescriptor() ([]byte, []int) { return file_pkg_proto_nbcontract_v1_config_proto_rawDescGZIP(), []int{0} } -// illustrative division only type Configuration struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // System Configuration - ClusterCertificateAuthority string `protobuf:"bytes,1,opt,name=cluster_certificate_authority,json=clusterCertificateAuthority,proto3" json:"cluster_certificate_authority,omitempty"` - TlsBootstrappingConfig *TLSBootstrappingConfig `protobuf:"bytes,2,opt,name=tls_bootstrapping_config,json=tlsBootstrappingConfig,proto3" json:"tls_bootstrapping_config,omitempty"` - // cluster/user config - KubernetesVersion string `protobuf:"bytes,3,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` // Q: can this be auto-detected? Or is this part of specifying the desired node version? - KubeBinaryConfig *KubeBinaryConfig `protobuf:"bytes,4,opt,name=kube_binary_config,json=kubeBinaryConfig,proto3" json:"kube_binary_config,omitempty"` - CustomCloudConfig *CustomCloudConfig `protobuf:"bytes,5,opt,name=custom_cloud_config,json=customCloudConfig,proto3,oneof" json:"custom_cloud_config,omitempty"` - KubeproxyUrl string `protobuf:"bytes,6,opt,name=kubeproxy_url,json=kubeproxyUrl,proto3" json:"kubeproxy_url,omitempty"` - ApiserverConfig *ApiServerConfig `protobuf:"bytes,7,opt,name=apiserver_config,json=apiserverConfig,proto3" json:"apiserver_config,omitempty"` - ClusterConfig *ClusterConfig `protobuf:"bytes,14,opt,name=cluster_config,json=clusterConfig,proto3" json:"cluster_config,omitempty"` - AuthConfig *AuthConfig `protobuf:"bytes,15,opt,name=auth_config,json=authConfig,proto3" json:"auth_config,omitempty"` - RuncConfig *RuncConfig `protobuf:"bytes,16,opt,name=runc_config,json=runcConfig,proto3" json:"runc_config,omitempty"` - VmSize string `protobuf:"bytes,17,opt,name=vm_size,json=vmSize,proto3" json:"vm_size,omitempty"` - // ... and a bunch of user-specified config - LinuxAdminUsername string `protobuf:"bytes,18,opt,name=linux_admin_username,json=linuxAdminUsername,proto3" json:"linux_admin_username,omitempty"` - ContainerdConfig *ContainerdConfig `protobuf:"bytes,22,opt,name=containerd_config,json=containerdConfig,proto3" json:"containerd_config,omitempty"` - IsVhd bool `protobuf:"varint,23,opt,name=is_vhd,json=isVhd,proto3" json:"is_vhd,omitempty"` - NetworkConfig *NetworkConfig `protobuf:"bytes,24,opt,name=network_config,json=networkConfig,proto3" json:"network_config,omitempty"` - TeleportConfig *TeleportConfig `protobuf:"bytes,26,opt,name=teleport_config,json=teleportConfig,proto3" json:"teleport_config,omitempty"` - // enable_ssh specifies whether SSH is enabled or disabled on the VM node - EnableSsh bool `protobuf:"varint,27,opt,name=enable_ssh,json=enableSsh,proto3" json:"enable_ssh,omitempty"` - // enable_unattended_upgrade specifies whether unattended upgrade is enabled or disabled on the VM node - EnableUnattendedUpgrade bool `protobuf:"varint,28,opt,name=enable_unattended_upgrade,json=enableUnattendedUpgrade,proto3" json:"enable_unattended_upgrade,omitempty"` - // message_of_the_day specifies the message of the day that is displayed on the VM node when a user logs in - MessageOfTheDay string `protobuf:"bytes,29,opt,name=message_of_the_day,json=messageOfTheDay,proto3" json:"message_of_the_day,omitempty"` - // kubelet_config specifies the kubelet configuration - KubeletConfig *KubeletConfig `protobuf:"bytes,31,opt,name=kubelet_config,json=kubeletConfig,proto3" json:"kubelet_config,omitempty"` - // enable_hosts_config_agent specifies whether the hosts config agent is enabled or disabled on the VM node - EnableHostsConfigAgent bool `protobuf:"varint,32,opt,name=enable_hosts_config_agent,json=enableHostsConfigAgent,proto3" json:"enable_hosts_config_agent,omitempty"` - // custom_ca_certs specifies the custom CA certificates - CustomCaCerts []string `protobuf:"bytes,33,rep,name=custom_ca_certs,json=customCaCerts,proto3" json:"custom_ca_certs,omitempty"` - // provision_output specifies where cluster provision cse output should be stored at - ProvisionOutput string `protobuf:"bytes,34,opt,name=provision_output,json=provisionOutput,proto3" json:"provision_output,omitempty"` - // workload_runtime describes the workload runtime, e.g., either "OCIContainer" or "WasmWasi", currently. - WorkloadRuntime WorkloadRuntime `protobuf:"varint,40,opt,name=workload_runtime,json=workloadRuntime,proto3,enum=nbcontract.v1.WorkloadRuntime" json:"workload_runtime,omitempty"` - // ipv6_dual_stack_enabled specifies whether IPv6 dual stack is enabled or disabled on the VM node - Ipv6DualStackEnabled bool `protobuf:"varint,42,opt,name=ipv6_dual_stack_enabled,json=ipv6DualStackEnabled,proto3" json:"ipv6_dual_stack_enabled,omitempty"` - // outbound_command specifies the command to use for outbound traffic - OutboundCommand string `protobuf:"bytes,43,opt,name=outbound_command,json=outboundCommand,proto3" json:"outbound_command,omitempty"` - // ensure_no_dupe_promiscuous_bridge specifies whether to ensure no duplicate promiscuous bridge - EnsureNoDupePromiscuousBridge bool `protobuf:"varint,45,opt,name=ensure_no_dupe_promiscuous_bridge,json=ensureNoDupePromiscuousBridge,proto3" json:"ensure_no_dupe_promiscuous_bridge,omitempty"` - // custom_search_domain specifies the custom search domain configurations - CustomSearchDomain *CustomSearchDomain `protobuf:"bytes,46,opt,name=custom_search_domain,json=customSearchDomain,proto3" json:"custom_search_domain,omitempty"` - // custom_linux_os_config specifies the custom Linux OS configurations including SwapFile, SysCtl configs, etc. - CustomLinuxOsConfig *CustomLinuxOSConfig `protobuf:"bytes,47,opt,name=custom_linux_os_config,json=customLinuxOsConfig,proto3" json:"custom_linux_os_config,omitempty"` - // azure_private_registry_server specifies the Azure private registry server - AzurePrivateRegistryServer string `protobuf:"bytes,56,opt,name=azure_private_registry_server,json=azurePrivateRegistryServer,proto3" json:"azure_private_registry_server,omitempty"` - // private_egress_proxy_address specifies the private egress proxy address - PrivateEgressProxyAddress string `protobuf:"bytes,57,opt,name=private_egress_proxy_address,json=privateEgressProxyAddress,proto3" json:"private_egress_proxy_address,omitempty"` - // enable_artifact_streaming specifies whether artifact streaming is enabled or disabled on the VM node - EnableArtifactStreaming bool `protobuf:"varint,58,opt,name=enable_artifact_streaming,json=enableArtifactStreaming,proto3" json:"enable_artifact_streaming,omitempty"` - // is_kata specifies whether the node is a Kata node - IsKata bool `protobuf:"varint,59,opt,name=is_kata,json=isKata,proto3" json:"is_kata,omitempty"` - // needs_cgroupv2 specifies whether the node needs cgroupv2 - // when we actually work on the go binary, we should be able to query from the system. By then we can remove this. - NeedsCgroupv2 bool `protobuf:"varint,60,opt,name=needs_cgroupv2,json=needsCgroupv2,proto3" json:"needs_cgroupv2,omitempty"` - // Here begins the final contract - HttpProxyConfig *HTTPProxyConfig `protobuf:"bytes,61,opt,name=http_proxy_config,json=httpProxyConfig,proto3,oneof" json:"http_proxy_config,omitempty"` - GpuConfig *GPUConfig `protobuf:"bytes,62,opt,name=gpu_config,json=gpuConfig,proto3,oneof" json:"gpu_config,omitempty"` + // Semantic version of this node bootstrap contract + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Kubernetes certificate authority certificate, required by the node to establish TLS with the API server + Kubernetes_CACert string `protobuf:"bytes,2,opt,name=kubernetes_CA_cert,json=kubernetesCACert,proto3" json:"kubernetes_CA_cert,omitempty"` + // TLS bootstrap config + TlsBootstrapConfig *TLSBootstrapConfig `protobuf:"bytes,3,opt,name=tls_bootstrap_config,json=tlsBootstrapConfig,proto3" json:"tls_bootstrap_config,omitempty"` + // Cluster/user config + KubernetesVersion string `protobuf:"bytes,4,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` // Q: can this be auto-detected? Or is this part of specifying the desired node version? + // Kube binary URL config + KubeBinaryConfig *KubeBinaryConfig `protobuf:"bytes,5,opt,name=kube_binary_config,json=kubeBinaryConfig,proto3" json:"kube_binary_config,omitempty"` + // Custom cloud config + CustomCloudConfig *CustomCloudConfig `protobuf:"bytes,6,opt,name=custom_cloud_config,json=customCloudConfig,proto3" json:"custom_cloud_config,omitempty"` + // Kube proxy URL + KubeProxyUrl string `protobuf:"bytes,7,opt,name=kube_proxy_url,json=kubeProxyUrl,proto3" json:"kube_proxy_url,omitempty"` + // Kubernetes API server configuration + ApiServerConfig *ApiServerConfig `protobuf:"bytes,8,opt,name=api_server_config,json=apiServerConfig,proto3" json:"api_server_config,omitempty"` + // Various Kubernetes cluster level configuration + ClusterConfig *ClusterConfig `protobuf:"bytes,9,opt,name=cluster_config,json=clusterConfig,proto3" json:"cluster_config,omitempty"` + // Authentication configuration + AuthConfig *AuthConfig `protobuf:"bytes,10,opt,name=auth_config,json=authConfig,proto3" json:"auth_config,omitempty"` + // The CLI tool runc configuration + RuncConfig *RuncConfig `protobuf:"bytes,11,opt,name=runc_config,json=runcConfig,proto3" json:"runc_config,omitempty"` + // The VM size of the node + VmSize string `protobuf:"bytes,12,opt,name=vm_size,json=vmSize,proto3" json:"vm_size,omitempty"` + // Linux admin username. If not specified, the default value is "azureuser" + LinuxAdminUsername string `protobuf:"bytes,13,opt,name=linux_admin_username,json=linuxAdminUsername,proto3" json:"linux_admin_username,omitempty"` + // Containerd configuration + ContainerdConfig *ContainerdConfig `protobuf:"bytes,14,opt,name=containerd_config,json=containerdConfig,proto3" json:"containerd_config,omitempty"` + // Specifies whether the node is a VHD node. This is still needed for some customized scenarios. + IsVhd bool `protobuf:"varint,15,opt,name=is_vhd,json=isVhd,proto3" json:"is_vhd,omitempty"` + // Network configuration. We assumed network mode is always "transparent" now so it's removed from the contract. + NetworkConfig *NetworkConfig `protobuf:"bytes,16,opt,name=network_config,json=networkConfig,proto3" json:"network_config,omitempty"` + // Teleport configuration + TeleportConfig *TeleportConfig `protobuf:"bytes,17,opt,name=teleport_config,json=teleportConfig,proto3" json:"teleport_config,omitempty"` + // Specifies whether SSH is enabled or disabled on the VM node + EnableSsh bool `protobuf:"varint,18,opt,name=enable_ssh,json=enableSsh,proto3" json:"enable_ssh,omitempty"` + // Specifies whether unattended upgrade is enabled or disabled on the VM node + EnableUnattendedUpgrade bool `protobuf:"varint,19,opt,name=enable_unattended_upgrade,json=enableUnattendedUpgrade,proto3" json:"enable_unattended_upgrade,omitempty"` + // The message of the day that is displayed on the VM node when a user logs in + MessageOfTheDay string `protobuf:"bytes,20,opt,name=message_of_the_day,json=messageOfTheDay,proto3" json:"message_of_the_day,omitempty"` + // Kubelet configuration + KubeletConfig *KubeletConfig `protobuf:"bytes,21,opt,name=kubelet_config,json=kubeletConfig,proto3" json:"kubelet_config,omitempty"` + // Specifies whether the hosts config agent is enabled or disabled on the VM node + EnableHostsConfigAgent bool `protobuf:"varint,22,opt,name=enable_hosts_config_agent,json=enableHostsConfigAgent,proto3" json:"enable_hosts_config_agent,omitempty"` + // Custom CA certificates to be added to the system trust store + CustomCaCerts []string `protobuf:"bytes,23,rep,name=custom_ca_certs,json=customCaCerts,proto3" json:"custom_ca_certs,omitempty"` + // A local file path where cluster provision cse output should be stored + ProvisionOutput string `protobuf:"bytes,24,opt,name=provision_output,json=provisionOutput,proto3" json:"provision_output,omitempty"` + // Workload runtime, e.g., either "OCIContainer" or "WasmWasi", currently. + WorkloadRuntime WorkloadRuntime `protobuf:"varint,25,opt,name=workload_runtime,json=workloadRuntime,proto3,enum=nbcontract.v1.WorkloadRuntime" json:"workload_runtime,omitempty"` + // Specifies whether IPv6 dual stack is enabled or disabled on the VM node + Ipv6DualStackEnabled bool `protobuf:"varint,26,opt,name=ipv6_dual_stack_enabled,json=ipv6DualStackEnabled,proto3" json:"ipv6_dual_stack_enabled,omitempty"` + // Command to use for outbound traffic + OutboundCommand string `protobuf:"bytes,27,opt,name=outbound_command,json=outboundCommand,proto3" json:"outbound_command,omitempty"` + // specifies whether to ensure no duplicate promiscuous bridge + EnsureNoDupePromiscuousBridge bool `protobuf:"varint,28,opt,name=ensure_no_dupe_promiscuous_bridge,json=ensureNoDupePromiscuousBridge,proto3" json:"ensure_no_dupe_promiscuous_bridge,omitempty"` + // Custom search domain configurations + CustomSearchDomain *CustomSearchDomain `protobuf:"bytes,29,opt,name=custom_search_domain,json=customSearchDomain,proto3" json:"custom_search_domain,omitempty"` + // Custom Linux OS configurations including SwapFile, SysCtl configs, etc. + CustomLinuxOsConfig *CustomLinuxOSConfig `protobuf:"bytes,30,opt,name=custom_linux_os_config,json=customLinuxOsConfig,proto3" json:"custom_linux_os_config,omitempty"` + // Azure private registry server URI + AzurePrivateRegistryServer string `protobuf:"bytes,31,opt,name=azure_private_registry_server,json=azurePrivateRegistryServer,proto3" json:"azure_private_registry_server,omitempty"` + // Private egress proxy address + PrivateEgressProxyAddress string `protobuf:"bytes,32,opt,name=private_egress_proxy_address,json=privateEgressProxyAddress,proto3" json:"private_egress_proxy_address,omitempty"` + // Specifies whether artifact streaming is enabled or disabled on the VM node + EnableArtifactStreaming bool `protobuf:"varint,33,opt,name=enable_artifact_streaming,json=enableArtifactStreaming,proto3" json:"enable_artifact_streaming,omitempty"` + // Specifies whether the node is a Kata node + IsKata bool `protobuf:"varint,34,opt,name=is_kata,json=isKata,proto3" json:"is_kata,omitempty"` + // Specifies whether the node needs cgroupv2. + // When we actually work on the go binary, we should be able to query from the system. By then we can remove this. + NeedsCgroupv2 bool `protobuf:"varint,35,opt,name=needs_cgroupv2,json=needsCgroupv2,proto3" json:"needs_cgroupv2,omitempty"` + // HTTP/HTTPS proxy configuration for the node + HttpProxyConfig *HTTPProxyConfig `protobuf:"bytes,36,opt,name=http_proxy_config,json=httpProxyConfig,proto3" json:"http_proxy_config,omitempty"` + // GPU configuration for the node + GpuConfig *GPUConfig `protobuf:"bytes,37,opt,name=gpu_config,json=gpuConfig,proto3" json:"gpu_config,omitempty"` } func (x *Configuration) Reset() { @@ -168,16 +183,23 @@ func (*Configuration) Descriptor() ([]byte, []int) { return file_pkg_proto_nbcontract_v1_config_proto_rawDescGZIP(), []int{0} } -func (x *Configuration) GetClusterCertificateAuthority() string { +func (x *Configuration) GetVersion() string { if x != nil { - return x.ClusterCertificateAuthority + return x.Version } return "" } -func (x *Configuration) GetTlsBootstrappingConfig() *TLSBootstrappingConfig { +func (x *Configuration) GetKubernetes_CACert() string { if x != nil { - return x.TlsBootstrappingConfig + return x.Kubernetes_CACert + } + return "" +} + +func (x *Configuration) GetTlsBootstrapConfig() *TLSBootstrapConfig { + if x != nil { + return x.TlsBootstrapConfig } return nil } @@ -203,16 +225,16 @@ func (x *Configuration) GetCustomCloudConfig() *CustomCloudConfig { return nil } -func (x *Configuration) GetKubeproxyUrl() string { +func (x *Configuration) GetKubeProxyUrl() string { if x != nil { - return x.KubeproxyUrl + return x.KubeProxyUrl } return "" } -func (x *Configuration) GetApiserverConfig() *ApiServerConfig { +func (x *Configuration) GetApiServerConfig() *ApiServerConfig { if x != nil { - return x.ApiserverConfig + return x.ApiServerConfig } return nil } @@ -464,170 +486,164 @@ var file_pkg_proto_nbcontract_v1_config_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x34, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6c, - 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x11, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x1d, 0x63, 0x6c, 0x75, - 0x73, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, - 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x1b, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x5f, 0x0a, - 0x18, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, - 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x4c, 0x53, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x16, 0x74, 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, - 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2d, - 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6b, 0x75, 0x62, 0x65, - 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4d, 0x0a, - 0x12, 0x6b, 0x75, 0x62, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x42, 0x69, - 0x6e, 0x61, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x6b, 0x75, 0x62, 0x65, - 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x55, 0x0a, 0x13, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x11, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0d, 0x6b, 0x75, 0x62, 0x65, 0x70, 0x72, 0x6f, 0x78, 0x79, - 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6b, 0x75, 0x62, 0x65, - 0x70, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, 0x6c, 0x12, 0x49, 0x0a, 0x10, 0x61, 0x70, 0x69, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x41, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x52, 0x0f, 0x61, 0x70, 0x69, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x43, 0x0a, 0x0e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6e, 0x62, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, - 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x63, 0x6c, 0x75, 0x73, 0x74, - 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x75, 0x74, 0x68, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, - 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x63, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x17, 0x0a, 0x07, 0x76, 0x6d, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x76, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6c, 0x69, 0x6e, - 0x75, 0x78, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x11, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, - 0x76, 0x68, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x56, 0x68, 0x64, - 0x12, 0x43, 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x0f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, - 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x74, - 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, 0x0a, - 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x73, 0x68, 0x18, 0x1b, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x09, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x19, - 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x6e, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x64, 0x5f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x6e, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x64, 0x65, - 0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x12, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x68, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x18, 0x1d, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x66, 0x54, - 0x68, 0x65, 0x44, 0x61, 0x79, 0x12, 0x43, 0x0a, 0x0e, 0x6b, 0x75, 0x62, 0x65, 0x6c, 0x65, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, + 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x10, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x2c, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x43, 0x41, + 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6b, 0x75, 0x62, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x41, 0x43, 0x65, 0x72, 0x74, 0x12, 0x53, 0x0a, + 0x14, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x62, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x4c, 0x53, 0x42, + 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x12, + 0x74, 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x2d, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, + 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, + 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x4d, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x75, - 0x62, 0x65, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6b, 0x75, 0x62, - 0x65, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x19, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x20, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x65, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, - 0x63, 0x61, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x21, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x61, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x29, 0x0a, - 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x18, 0x22, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x49, 0x0a, 0x10, 0x77, 0x6f, 0x72, 0x6b, - 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x28, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x52, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x75, 0x6e, 0x74, - 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x69, 0x70, 0x76, 0x36, 0x5f, 0x64, 0x75, 0x61, 0x6c, - 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x2a, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x70, 0x76, 0x36, 0x44, 0x75, 0x61, 0x6c, 0x53, 0x74, - 0x61, 0x63, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x6f, 0x75, - 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, 0x2b, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x5f, - 0x6e, 0x6f, 0x5f, 0x64, 0x75, 0x70, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x63, 0x75, - 0x6f, 0x75, 0x73, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x1d, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x4e, 0x6f, 0x44, 0x75, 0x70, 0x65, 0x50, 0x72, - 0x6f, 0x6d, 0x69, 0x73, 0x63, 0x75, 0x6f, 0x75, 0x73, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, 0x12, - 0x53, 0x0a, 0x14, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x2e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, + 0x62, 0x65, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, + 0x6b, 0x75, 0x62, 0x65, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x50, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, + 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x16, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, - 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x2f, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x69, 0x6e, 0x75, 0x78, - 0x4f, 0x53, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, 0x0a, - 0x1d, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x38, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x50, 0x72, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x12, 0x3f, 0x0a, 0x1c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x67, 0x72, 0x65, - 0x73, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x39, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x45, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x74, 0x69, - 0x66, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x3a, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x72, 0x74, 0x69, - 0x66, 0x61, 0x63, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x17, 0x0a, - 0x07, 0x69, 0x73, 0x5f, 0x6b, 0x61, 0x74, 0x61, 0x18, 0x3b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, - 0x69, 0x73, 0x4b, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x5f, - 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x18, 0x3c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, - 0x6e, 0x65, 0x65, 0x64, 0x73, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x12, 0x4f, 0x0a, - 0x11, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x3d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x50, 0x72, 0x6f, - 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x01, 0x52, 0x0f, 0x68, 0x74, 0x74, 0x70, - 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0x3c, - 0x0a, 0x0a, 0x67, 0x70, 0x75, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x3e, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x50, 0x55, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x02, 0x52, 0x09, - 0x67, 0x70, 0x75, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, - 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, 0x72, - 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x67, - 0x70, 0x75, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x47, 0x0a, 0x0f, 0x57, 0x6f, 0x72, - 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x0e, - 0x57, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x43, 0x49, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, - 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x57, 0x41, 0x53, 0x49, - 0x10, 0x02, 0x42, 0xb7, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, - 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, - 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, - 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, - 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, + 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x24, 0x0a, 0x0e, 0x6b, 0x75, 0x62, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6b, 0x75, 0x62, 0x65, + 0x50, 0x72, 0x6f, 0x78, 0x79, 0x55, 0x72, 0x6c, 0x12, 0x4a, 0x0a, 0x11, 0x61, 0x70, 0x69, 0x5f, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x52, 0x0f, 0x61, 0x70, 0x69, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x43, 0x0a, 0x0e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6e, + 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x75, 0x74, + 0x68, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x41, + 0x75, 0x74, 0x68, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x3a, 0x0a, 0x0b, 0x72, 0x75, 0x6e, 0x63, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x63, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0a, 0x72, 0x75, 0x6e, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x17, 0x0a, 0x07, 0x76, 0x6d, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x76, 0x6d, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6c, 0x69, + 0x6e, 0x75, 0x78, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x41, + 0x64, 0x6d, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4c, 0x0a, 0x11, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, + 0x5f, 0x76, 0x68, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x56, 0x68, + 0x64, 0x12, 0x43, 0x0a, 0x0e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x0f, 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, + 0x74, 0x65, 0x6c, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1d, + 0x0a, 0x0a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x73, 0x68, 0x18, 0x12, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x09, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x73, 0x68, 0x12, 0x3a, 0x0a, + 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x6e, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x64, 0x5f, 0x75, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x6e, 0x61, 0x74, 0x74, 0x65, 0x6e, 0x64, + 0x65, 0x64, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x12, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x68, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x18, + 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x66, + 0x54, 0x68, 0x65, 0x44, 0x61, 0x79, 0x12, 0x43, 0x0a, 0x0e, 0x6b, 0x75, 0x62, 0x65, 0x6c, 0x65, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x4b, + 0x75, 0x62, 0x65, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6b, 0x75, + 0x62, 0x65, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x39, 0x0a, 0x19, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x6f, 0x73, 0x74, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x63, 0x61, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x73, 0x18, 0x17, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x61, 0x43, 0x65, 0x72, 0x74, 0x73, 0x12, 0x29, + 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x70, + 0x75, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, + 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x49, 0x0a, 0x10, 0x77, 0x6f, 0x72, + 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x19, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x52, 0x0f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x75, 0x6e, + 0x74, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x17, 0x69, 0x70, 0x76, 0x36, 0x5f, 0x64, 0x75, 0x61, + 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, + 0x1a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x70, 0x76, 0x36, 0x44, 0x75, 0x61, 0x6c, 0x53, + 0x74, 0x61, 0x63, 0x6b, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x6f, + 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x18, + 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, + 0x5f, 0x6e, 0x6f, 0x5f, 0x64, 0x75, 0x70, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x63, + 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x1d, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x4e, 0x6f, 0x44, 0x75, 0x70, 0x65, 0x50, + 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x63, 0x75, 0x6f, 0x75, 0x73, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, + 0x12, 0x53, 0x0a, 0x14, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x16, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, + 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x69, 0x6e, 0x75, + 0x78, 0x4f, 0x53, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, + 0x0a, 0x1d, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, + 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x50, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x12, 0x3f, 0x0a, 0x1c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x67, 0x72, + 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, + 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x74, + 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, + 0x21, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x72, 0x74, + 0x69, 0x66, 0x61, 0x63, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x17, + 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6b, 0x61, 0x74, 0x61, 0x18, 0x22, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x06, 0x69, 0x73, 0x4b, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x73, + 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x18, 0x23, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x12, 0x4a, + 0x0a, 0x11, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x50, 0x72, + 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, 0x68, 0x74, 0x74, 0x70, 0x50, + 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x0a, 0x67, 0x70, + 0x75, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x25, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x50, 0x55, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x67, 0x70, 0x75, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2a, 0x47, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, + 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x57, 0x52, 0x5f, 0x55, 0x4e, 0x53, + 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x43, + 0x49, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, + 0x09, 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x57, 0x41, 0x53, 0x49, 0x10, 0x02, 0x42, 0xb7, 0x01, 0x0a, + 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, + 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, + 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, + 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -645,29 +661,29 @@ func file_pkg_proto_nbcontract_v1_config_proto_rawDescGZIP() []byte { var file_pkg_proto_nbcontract_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_pkg_proto_nbcontract_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_pkg_proto_nbcontract_v1_config_proto_goTypes = []interface{}{ - (WorkloadRuntime)(0), // 0: nbcontract.v1.WorkloadRuntime - (*Configuration)(nil), // 1: nbcontract.v1.Configuration - (*TLSBootstrappingConfig)(nil), // 2: nbcontract.v1.TLSBootstrappingConfig - (*KubeBinaryConfig)(nil), // 3: nbcontract.v1.KubeBinaryConfig - (*CustomCloudConfig)(nil), // 4: nbcontract.v1.CustomCloudConfig - (*ApiServerConfig)(nil), // 5: nbcontract.v1.ApiServerConfig - (*ClusterConfig)(nil), // 6: nbcontract.v1.ClusterConfig - (*AuthConfig)(nil), // 7: nbcontract.v1.AuthConfig - (*RuncConfig)(nil), // 8: nbcontract.v1.RuncConfig - (*ContainerdConfig)(nil), // 9: nbcontract.v1.ContainerdConfig - (*NetworkConfig)(nil), // 10: nbcontract.v1.NetworkConfig - (*TeleportConfig)(nil), // 11: nbcontract.v1.TeleportConfig - (*KubeletConfig)(nil), // 12: nbcontract.v1.KubeletConfig - (*CustomSearchDomain)(nil), // 13: nbcontract.v1.CustomSearchDomain - (*CustomLinuxOSConfig)(nil), // 14: nbcontract.v1.CustomLinuxOSConfig - (*HTTPProxyConfig)(nil), // 15: nbcontract.v1.HTTPProxyConfig - (*GPUConfig)(nil), // 16: nbcontract.v1.GPUConfig + (WorkloadRuntime)(0), // 0: nbcontract.v1.WorkloadRuntime + (*Configuration)(nil), // 1: nbcontract.v1.Configuration + (*TLSBootstrapConfig)(nil), // 2: nbcontract.v1.TLSBootstrapConfig + (*KubeBinaryConfig)(nil), // 3: nbcontract.v1.KubeBinaryConfig + (*CustomCloudConfig)(nil), // 4: nbcontract.v1.CustomCloudConfig + (*ApiServerConfig)(nil), // 5: nbcontract.v1.ApiServerConfig + (*ClusterConfig)(nil), // 6: nbcontract.v1.ClusterConfig + (*AuthConfig)(nil), // 7: nbcontract.v1.AuthConfig + (*RuncConfig)(nil), // 8: nbcontract.v1.RuncConfig + (*ContainerdConfig)(nil), // 9: nbcontract.v1.ContainerdConfig + (*NetworkConfig)(nil), // 10: nbcontract.v1.NetworkConfig + (*TeleportConfig)(nil), // 11: nbcontract.v1.TeleportConfig + (*KubeletConfig)(nil), // 12: nbcontract.v1.KubeletConfig + (*CustomSearchDomain)(nil), // 13: nbcontract.v1.CustomSearchDomain + (*CustomLinuxOSConfig)(nil), // 14: nbcontract.v1.CustomLinuxOSConfig + (*HTTPProxyConfig)(nil), // 15: nbcontract.v1.HTTPProxyConfig + (*GPUConfig)(nil), // 16: nbcontract.v1.GPUConfig } var file_pkg_proto_nbcontract_v1_config_proto_depIdxs = []int32{ - 2, // 0: nbcontract.v1.Configuration.tls_bootstrapping_config:type_name -> nbcontract.v1.TLSBootstrappingConfig + 2, // 0: nbcontract.v1.Configuration.tls_bootstrap_config:type_name -> nbcontract.v1.TLSBootstrapConfig 3, // 1: nbcontract.v1.Configuration.kube_binary_config:type_name -> nbcontract.v1.KubeBinaryConfig 4, // 2: nbcontract.v1.Configuration.custom_cloud_config:type_name -> nbcontract.v1.CustomCloudConfig - 5, // 3: nbcontract.v1.Configuration.apiserver_config:type_name -> nbcontract.v1.ApiServerConfig + 5, // 3: nbcontract.v1.Configuration.api_server_config:type_name -> nbcontract.v1.ApiServerConfig 6, // 4: nbcontract.v1.Configuration.cluster_config:type_name -> nbcontract.v1.ClusterConfig 7, // 5: nbcontract.v1.Configuration.auth_config:type_name -> nbcontract.v1.AuthConfig 8, // 6: nbcontract.v1.Configuration.runc_config:type_name -> nbcontract.v1.RuncConfig @@ -705,7 +721,7 @@ func file_pkg_proto_nbcontract_v1_config_proto_init() { file_pkg_proto_nbcontract_v1_runcconfig_proto_init() file_pkg_proto_nbcontract_v1_customcloudconfig_proto_init() file_pkg_proto_nbcontract_v1_apiserverconfig_proto_init() - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_init() + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_init() file_pkg_proto_nbcontract_v1_clusterconfig_proto_init() if !protoimpl.UnsafeEnabled { file_pkg_proto_nbcontract_v1_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { @@ -721,7 +737,6 @@ func file_pkg_proto_nbcontract_v1_config_proto_init() { } } } - file_pkg_proto_nbcontract_v1_config_proto_msgTypes[0].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/nbcontract/v1/config.proto b/pkg/proto/nbcontract/v1/config.proto index d8b58fba92d..526474b9179 100644 --- a/pkg/proto/nbcontract/v1/config.proto +++ b/pkg/proto/nbcontract/v1/config.proto @@ -15,7 +15,7 @@ import "pkg/proto/nbcontract/v1/teleportconfig.proto"; import "pkg/proto/nbcontract/v1/runcconfig.proto"; import "pkg/proto/nbcontract/v1/customcloudconfig.proto"; import "pkg/proto/nbcontract/v1/apiserverconfig.proto"; -import "pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto"; +import "pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto"; import "pkg/proto/nbcontract/v1/clusterconfig.proto"; enum WorkloadRuntime { @@ -24,121 +24,117 @@ enum WorkloadRuntime { WASM_WASI = 2; } -// illustrative division only message Configuration { - // System Configuration - string cluster_certificate_authority = 1; - TLSBootstrappingConfig tls_bootstrapping_config = 2; - - // cluster/user config - string kubernetes_version = 3; // Q: can this be auto-detected? Or is this part of specifying the desired node version? - KubeBinaryConfig kube_binary_config = 4; - optional CustomCloudConfig custom_cloud_config = 5; - string kubeproxy_url = 6; - ApiServerConfig apiserver_config = 7; - ClusterConfig cluster_config = 14; - AuthConfig auth_config = 15; - RuncConfig runc_config = 16; - string vm_size = 17; + // Semantic version of this node bootstrap contract + string version = 1; - // ... and a bunch of user-specified config - string linux_admin_username = 18; - ContainerdConfig containerd_config = 22; - bool is_vhd = 23; - NetworkConfig network_config = 24; - TeleportConfig teleport_config = 26; + // Kubernetes certificate authority certificate, required by the node to establish TLS with the API server + string kubernetes_CA_cert = 2; - // enable_ssh specifies whether SSH is enabled or disabled on the VM node - bool enable_ssh = 27; + // TLS bootstrap config + TLSBootstrapConfig tls_bootstrap_config = 3; - // enable_unattended_upgrade specifies whether unattended upgrade is enabled or disabled on the VM node - bool enable_unattended_upgrade = 28; + // Cluster/user config + string kubernetes_version = 4; // Q: can this be auto-detected? Or is this part of specifying the desired node version? - // message_of_the_day specifies the message of the day that is displayed on the VM node when a user logs in - string message_of_the_day = 29; + // Kube binary URL config + KubeBinaryConfig kube_binary_config = 5; - // kubelet_config specifies the kubelet configuration - KubeletConfig kubelet_config = 31; + // Custom cloud config + CustomCloudConfig custom_cloud_config = 6; - // enable_hosts_config_agent specifies whether the hosts config agent is enabled or disabled on the VM node - bool enable_hosts_config_agent = 32; + // Kube proxy URL + string kube_proxy_url = 7; - // custom_ca_certs specifies the custom CA certificates - repeated string custom_ca_certs = 33; + // Kubernetes API server configuration + ApiServerConfig api_server_config = 8; + + // Various Kubernetes cluster level configuration + ClusterConfig cluster_config = 9; - // provision_output specifies where cluster provision cse output should be stored at - string provision_output = 34; + // Authentication configuration + AuthConfig auth_config = 10; - // workload_runtime describes the workload runtime, e.g., either "OCIContainer" or "WasmWasi", currently. - WorkloadRuntime workload_runtime = 40; + // The CLI tool runc configuration + RuncConfig runc_config = 11; - // ipv6_dual_stack_enabled specifies whether IPv6 dual stack is enabled or disabled on the VM node - bool ipv6_dual_stack_enabled = 42; + // The VM size of the node + string vm_size = 12; - // outbound_command specifies the command to use for outbound traffic - string outbound_command = 43; + // Linux admin username. If not specified, the default value is "azureuser" + string linux_admin_username = 13; - // ensure_no_dupe_promiscuous_bridge specifies whether to ensure no duplicate promiscuous bridge - bool ensure_no_dupe_promiscuous_bridge = 45; + // Containerd configuration + ContainerdConfig containerd_config = 14; - // custom_search_domain specifies the custom search domain configurations - CustomSearchDomain custom_search_domain = 46; + // Specifies whether the node is a VHD node. This is still needed for some customized scenarios. + bool is_vhd = 15; - // custom_linux_os_config specifies the custom Linux OS configurations including SwapFile, SysCtl configs, etc. - CustomLinuxOSConfig custom_linux_os_config = 47; + // Network configuration. We assumed network mode is always "transparent" now so it's removed from the contract. + NetworkConfig network_config = 16; - // azure_private_registry_server specifies the Azure private registry server - string azure_private_registry_server = 56; + // Teleport configuration + TeleportConfig teleport_config = 17; - // private_egress_proxy_address specifies the private egress proxy address - string private_egress_proxy_address = 57; + // Specifies whether SSH is enabled or disabled on the VM node + bool enable_ssh = 18; - // enable_artifact_streaming specifies whether artifact streaming is enabled or disabled on the VM node - bool enable_artifact_streaming = 58; + // Specifies whether unattended upgrade is enabled or disabled on the VM node + bool enable_unattended_upgrade = 19; - // is_kata specifies whether the node is a Kata node - bool is_kata = 59; + // The message of the day that is displayed on the VM node when a user logs in + string message_of_the_day = 20; - // needs_cgroupv2 specifies whether the node needs cgroupv2 - // when we actually work on the go binary, we should be able to query from the system. By then we can remove this. - bool needs_cgroupv2 = 60; + // Kubelet configuration + KubeletConfig kubelet_config = 21; - // Here begins the final contract - optional HTTPProxyConfig http_proxy_config = 61; - optional GPUConfig gpu_config = 62; -} + // Specifies whether the hosts config agent is enabled or disabled on the VM node + bool enable_hosts_config_agent = 22; -// The following variables are removed from the contract -// Leaving them there for note. -// All of them need default values configured in the VHD, likely in the go binary. -// will remove this section before release -/* + // Custom CA certificates to be added to the system trust store + repeated string custom_ca_certs = 23; -message CloudProviderConfig { - CloudProviderBackoffConfig cloud_provider_backoff_config = 1; - CloudProviderRateLimitConfig cloud_provider_rate_limit_config = 2; - bool cloud_provider_disable_out_bound_snat = 3; -} + // A local file path where cluster provision cse output should be stored + string provision_output = 24; -message CloudProviderBackoffConfig { - FeatureState status = 1; - string mode = 2; - int32 retries = 3; - double exponent = 4; - int32 duration = 5; - double jitter = 6; -} + // Workload runtime, e.g., either "OCIContainer" or "WasmWasi", currently. + WorkloadRuntime workload_runtime = 25; -message CloudProviderRateLimitConfig { - FeatureState status = 1; - double qps = 2; - double qps_write = 3; - int32 bucket = 4; - int32 bucket_write = 5; -} + // Specifies whether IPv6 dual stack is enabled or disabled on the VM node + bool ipv6_dual_stack_enabled = 26; + + // Command to use for outbound traffic + string outbound_command = 27; + + // specifies whether to ensure no duplicate promiscuous bridge + bool ensure_no_dupe_promiscuous_bridge = 28; + + // Custom search domain configurations + CustomSearchDomain custom_search_domain = 29; + + // Custom Linux OS configurations including SwapFile, SysCtl configs, etc. + CustomLinuxOSConfig custom_linux_os_config = 30; + + // Azure private registry server URI + string azure_private_registry_server = 31; + + //Private egress proxy address + string private_egress_proxy_address = 32; + + // Specifies whether artifact streaming is enabled or disabled on the VM node + bool enable_artifact_streaming = 33; + + // Specifies whether the node is a Kata node + bool is_kata = 34; + + // Specifies whether the node needs cgroupv2. + // When we actually work on the go binary, we should be able to query from the system. By then we can remove this. + bool needs_cgroupv2 = 35; -CONTAINER_RUNTIME = "containerd" -CLI_TOOL = "ctr" + // HTTP/HTTPS proxy configuration for the node + HTTPProxyConfig http_proxy_config = 36; -*/ \ No newline at end of file + // GPU configuration for the node + GPUConfig gpu_config = 37; +} \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/containerdconfig.pb.go b/pkg/proto/nbcontract/v1/containerdconfig.pb.go index 4f3c564ee05..5aa9b7de852 100644 --- a/pkg/proto/nbcontract/v1/containerdconfig.pb.go +++ b/pkg/proto/nbcontract/v1/containerdconfig.pb.go @@ -25,9 +25,12 @@ type ContainerdConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The base URL for downloading containerd. ContainerdDownloadUrlBase string `protobuf:"bytes,1,opt,name=containerd_download_url_base,json=containerdDownloadUrlBase,proto3" json:"containerd_download_url_base,omitempty"` - ContainerdVersion string `protobuf:"bytes,2,opt,name=containerd_version,json=containerdVersion,proto3" json:"containerd_version,omitempty"` - ContainerdPackageUrl string `protobuf:"bytes,3,opt,name=containerd_package_url,json=containerdPackageUrl,proto3" json:"containerd_package_url,omitempty"` + // The version of containerd to download. + ContainerdVersion string `protobuf:"bytes,2,opt,name=containerd_version,json=containerdVersion,proto3" json:"containerd_version,omitempty"` + // The URL for downloading the containerd package. + ContainerdPackageUrl string `protobuf:"bytes,3,opt,name=containerd_package_url,json=containerdPackageUrl,proto3" json:"containerd_package_url,omitempty"` } func (x *ContainerdConfig) Reset() { diff --git a/pkg/proto/nbcontract/v1/containerdconfig.proto b/pkg/proto/nbcontract/v1/containerdconfig.proto index ca0e5ff6d88..05cc6be8da9 100644 --- a/pkg/proto/nbcontract/v1/containerdconfig.proto +++ b/pkg/proto/nbcontract/v1/containerdconfig.proto @@ -2,7 +2,13 @@ syntax = "proto3"; package nbcontract.v1; message ContainerdConfig { + + // The base URL for downloading containerd. string containerd_download_url_base = 1; + + // The version of containerd to download. string containerd_version = 2; + + // The URL for downloading the containerd package. string containerd_package_url = 3; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/customcloudconfig.pb.go b/pkg/proto/nbcontract/v1/customcloudconfig.pb.go index ce4e971dab6..9b30c0da775 100644 --- a/pkg/proto/nbcontract/v1/customcloudconfig.pb.go +++ b/pkg/proto/nbcontract/v1/customcloudconfig.pb.go @@ -30,8 +30,10 @@ type CustomCloudConfig struct { // InitFilePath is the path to the file that contains the init script InitFilePath string `protobuf:"bytes,2,opt,name=init_file_path,json=initFilePath,proto3" json:"init_file_path,omitempty"` // RepoDepotEndpoint is the endpoint of the repo depot - RepoDepotEndpoint string `protobuf:"bytes,3,opt,name=repo_depot_endpoint,json=repoDepotEndpoint,proto3" json:"repo_depot_endpoint,omitempty"` - TargetEnvironment string `protobuf:"bytes,4,opt,name=target_environment,json=targetEnvironment,proto3" json:"target_environment,omitempty"` + RepoDepotEndpoint string `protobuf:"bytes,3,opt,name=repo_depot_endpoint,json=repoDepotEndpoint,proto3" json:"repo_depot_endpoint,omitempty"` + // Specifies if target environment is a sovereign cloud, which has its own data compliance regulation, or standard public cloud. + TargetEnvironment string `protobuf:"bytes,4,opt,name=target_environment,json=targetEnvironment,proto3" json:"target_environment,omitempty"` + // Base64 encoded JSON string of custom cloud environment CustomEnvJsonContent string `protobuf:"bytes,5,opt,name=custom_env_json_content,json=customEnvJsonContent,proto3" json:"custom_env_json_content,omitempty"` } diff --git a/pkg/proto/nbcontract/v1/customcloudconfig.proto b/pkg/proto/nbcontract/v1/customcloudconfig.proto index 57258710c00..5ac4a4b370a 100644 --- a/pkg/proto/nbcontract/v1/customcloudconfig.proto +++ b/pkg/proto/nbcontract/v1/customcloudconfig.proto @@ -12,7 +12,9 @@ message CustomCloudConfig { // RepoDepotEndpoint is the endpoint of the repo depot string repo_depot_endpoint = 3; + // Specifies if target environment is a sovereign cloud, which has its own data compliance regulation, or standard public cloud. string target_environment = 4; + // Base64 encoded JSON string of custom cloud environment string custom_env_json_content = 5; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/gpuconfig.pb.go b/pkg/proto/nbcontract/v1/gpuconfig.pb.go index 3d8bea6cff9..92781ea89f0 100644 --- a/pkg/proto/nbcontract/v1/gpuconfig.pb.go +++ b/pkg/proto/nbcontract/v1/gpuconfig.pb.go @@ -25,11 +25,11 @@ type GPUConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // ConfigGpuDriver specifies whether bootstrap process should install and configure the GPU driver when necessary. Configuration includes appropriate set up of components like the fabric manager where applicable. + // Specifies whether bootstrap process should install and configure the GPU driver when necessary. Configuration includes appropriate set up of components like the fabric manager where applicable. ConfigGpuDriver bool `protobuf:"varint,1,opt,name=config_gpu_driver,json=configGpuDriver,proto3" json:"config_gpu_driver,omitempty"` - // GpuDevicePlugin specifies whether special config is needed for MIG GPUs that use GPU dedicated VHDs and enable the device plugin (for all GPU dedicated VHDs) + // Specifies whether special config is needed for MIG GPUs that use GPU dedicated VHDs and enable the device plugin (for all GPU dedicated VHDs) GpuDevicePlugin bool `protobuf:"varint,2,opt,name=gpu_device_plugin,json=gpuDevicePlugin,proto3" json:"gpu_device_plugin,omitempty"` - // GpuInstanceProfile represents the GPU instance profile. + // Represents the GPU instance profile. GpuInstanceProfile string `protobuf:"bytes,3,opt,name=gpu_instance_profile,json=gpuInstanceProfile,proto3" json:"gpu_instance_profile,omitempty"` } diff --git a/pkg/proto/nbcontract/v1/gpuconfig.proto b/pkg/proto/nbcontract/v1/gpuconfig.proto index e0456108171..bb89f9920a5 100644 --- a/pkg/proto/nbcontract/v1/gpuconfig.proto +++ b/pkg/proto/nbcontract/v1/gpuconfig.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package nbcontract.v1; message GPUConfig { - // ConfigGpuDriver specifies whether bootstrap process should install and configure the GPU driver when necessary. Configuration includes appropriate set up of components like the fabric manager where applicable. + // Specifies whether bootstrap process should install and configure the GPU driver when necessary. Configuration includes appropriate set up of components like the fabric manager where applicable. bool config_gpu_driver = 1; - // GpuDevicePlugin specifies whether special config is needed for MIG GPUs that use GPU dedicated VHDs and enable the device plugin (for all GPU dedicated VHDs) + // Specifies whether special config is needed for MIG GPUs that use GPU dedicated VHDs and enable the device plugin (for all GPU dedicated VHDs) bool gpu_device_plugin = 2; - // GpuInstanceProfile represents the GPU instance profile. + // Represents the GPU instance profile. string gpu_instance_profile = 3; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/httpproxyconfig.pb.go b/pkg/proto/nbcontract/v1/httpproxyconfig.pb.go index 6230e1e4be1..e28aee7e2d2 100644 --- a/pkg/proto/nbcontract/v1/httpproxyconfig.pb.go +++ b/pkg/proto/nbcontract/v1/httpproxyconfig.pb.go @@ -25,13 +25,13 @@ type HTTPProxyConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // HTTPProxy represents the proxy endpoint/URL using HTTP, that the traffic should go through for making HTTP connections outside the cluster + // Proxy endpoint/URL using HTTP through which the traffic should be routed for making HTTP connections outside the cluster HttpProxy string `protobuf:"bytes,1,opt,name=http_proxy,json=httpProxy,proto3" json:"http_proxy,omitempty"` - // HTTPSProxy represents the proxy endpoint/URL using HTTPS, that the traffic should go through for making HTTPS connections outside the cluster + // Proxy endpoint/URL using HTTPS through which the traffic should be routed for making HTTPS connections outside the cluster HttpsProxy string `protobuf:"bytes,2,opt,name=https_proxy,json=httpsProxy,proto3" json:"https_proxy,omitempty"` - // NoProxy represents a list of entries including IPs, domains, or other network CIDRs that should not be accessed through the proxy + // A list of entries including IPs, domains, or other network CIDRs that should not be accessed through the proxy NoProxyEntries []string `protobuf:"bytes,3,rep,name=no_proxy_entries,json=noProxyEntries,proto3" json:"no_proxy_entries,omitempty"` - // TrustedCA repesents alternative CA certificate content + // Custom CA certificate that should be trusted by the proxy ProxyTrustedCa string `protobuf:"bytes,4,opt,name=proxy_trusted_ca,json=proxyTrustedCa,proto3" json:"proxy_trusted_ca,omitempty"` } diff --git a/pkg/proto/nbcontract/v1/httpproxyconfig.proto b/pkg/proto/nbcontract/v1/httpproxyconfig.proto index 8988b610b0d..28a8be004cf 100644 --- a/pkg/proto/nbcontract/v1/httpproxyconfig.proto +++ b/pkg/proto/nbcontract/v1/httpproxyconfig.proto @@ -2,15 +2,15 @@ syntax = "proto3"; package nbcontract.v1; message HTTPProxyConfig { - // HTTPProxy represents the proxy endpoint/URL using HTTP, that the traffic should go through for making HTTP connections outside the cluster + // Proxy endpoint/URL using HTTP through which the traffic should be routed for making HTTP connections outside the cluster string http_proxy = 1; - // HTTPSProxy represents the proxy endpoint/URL using HTTPS, that the traffic should go through for making HTTPS connections outside the cluster + // Proxy endpoint/URL using HTTPS through which the traffic should be routed for making HTTPS connections outside the cluster string https_proxy = 2; - // NoProxy represents a list of entries including IPs, domains, or other network CIDRs that should not be accessed through the proxy + // A list of entries including IPs, domains, or other network CIDRs that should not be accessed through the proxy repeated string no_proxy_entries = 3; - // TrustedCA repesents alternative CA certificate content + // Custom CA certificate that should be trusted by the proxy string proxy_trusted_ca = 4; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/kubebinaryconfig.pb.go b/pkg/proto/nbcontract/v1/kubebinaryconfig.pb.go index 53165650489..baea190acb5 100644 --- a/pkg/proto/nbcontract/v1/kubebinaryconfig.pb.go +++ b/pkg/proto/nbcontract/v1/kubebinaryconfig.pb.go @@ -26,9 +26,12 @@ type KubeBinaryConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - KubeBinaryUrl string `protobuf:"bytes,1,opt,name=kube_binary_url,json=kubeBinaryUrl,proto3" json:"kube_binary_url,omitempty"` //default kube binary url - CustomKubeBinaryUrl string `protobuf:"bytes,2,opt,name=custom_kube_binary_url,json=customKubeBinaryUrl,proto3" json:"custom_kube_binary_url,omitempty"` //user's custom kube binary url - PrivateKubeBinaryUrl string `protobuf:"bytes,3,opt,name=private_kube_binary_url,json=privateKubeBinaryUrl,proto3" json:"private_kube_binary_url,omitempty"` //privately cached kube binary url + // default kube binary url + KubeBinaryUrl string `protobuf:"bytes,1,opt,name=kube_binary_url,json=kubeBinaryUrl,proto3" json:"kube_binary_url,omitempty"` + // user's custom kube binary url + CustomKubeBinaryUrl string `protobuf:"bytes,2,opt,name=custom_kube_binary_url,json=customKubeBinaryUrl,proto3" json:"custom_kube_binary_url,omitempty"` + // privately cached kube binary url + PrivateKubeBinaryUrl string `protobuf:"bytes,3,opt,name=private_kube_binary_url,json=privateKubeBinaryUrl,proto3" json:"private_kube_binary_url,omitempty"` } func (x *KubeBinaryConfig) Reset() { diff --git a/pkg/proto/nbcontract/v1/kubebinaryconfig.proto b/pkg/proto/nbcontract/v1/kubebinaryconfig.proto index fa630e486f5..81d40ecbfb0 100644 --- a/pkg/proto/nbcontract/v1/kubebinaryconfig.proto +++ b/pkg/proto/nbcontract/v1/kubebinaryconfig.proto @@ -3,7 +3,13 @@ package nbcontract.v1; // Kube Binary Config message KubeBinaryConfig { - string kube_binary_url = 1; //default kube binary url - string custom_kube_binary_url = 2; //user's custom kube binary url - string private_kube_binary_url = 3; //privately cached kube binary url + + //default kube binary url + string kube_binary_url = 1; + + //user's custom kube binary url + string custom_kube_binary_url = 2; + + //privately cached kube binary url + string private_kube_binary_url = 3; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/kubeletconfig.pb.go b/pkg/proto/nbcontract/v1/kubeletconfig.pb.go index fdc9add27ee..8319ed24d4a 100644 --- a/pkg/proto/nbcontract/v1/kubeletconfig.pb.go +++ b/pkg/proto/nbcontract/v1/kubeletconfig.pb.go @@ -74,15 +74,21 @@ type KubeletConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // TODO(ace): remove these/make api defensible - KubeletFlags map[string]string `protobuf:"bytes,1,rep,name=kubelet_flags,json=kubeletFlags,proto3" json:"kubelet_flags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // A map of kubelet flags to their values. + KubeletFlags map[string]string `protobuf:"bytes,1,rep,name=kubelet_flags,json=kubeletFlags,proto3" json:"kubelet_flags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // A map of node labels to their values. KubeletNodeLabels map[string]string `protobuf:"bytes,2,rep,name=kubelet_node_labels,json=kubeletNodeLabels,proto3" json:"kubelet_node_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Taints []*Taint `protobuf:"bytes,3,rep,name=taints,proto3" json:"taints,omitempty"` - StartupTaints []*Taint `protobuf:"bytes,4,rep,name=startup_taints,json=startupTaints,proto3" json:"startup_taints,omitempty"` - KubeletDiskType KubeletDisk `protobuf:"varint,5,opt,name=kubelet_disk_type,json=kubeletDiskType,proto3,enum=nbcontract.v1.KubeletDisk" json:"kubelet_disk_type,omitempty"` - // kubelet_config_file_content is the content of the kubelet config file. + // A list of taints to apply to the node. + Taints []*Taint `protobuf:"bytes,3,rep,name=taints,proto3" json:"taints,omitempty"` + // A list of taints to apply to the node at startup. + StartupTaints []*Taint `protobuf:"bytes,4,rep,name=startup_taints,json=startupTaints,proto3" json:"startup_taints,omitempty"` + // The type of disk to use for the kubelet. + KubeletDiskType KubeletDisk `protobuf:"varint,5,opt,name=kubelet_disk_type,json=kubeletDiskType,proto3,enum=nbcontract.v1.KubeletDisk" json:"kubelet_disk_type,omitempty"` + // Base64 encoded content of the kubelet config file. KubeletConfigFileContent string `protobuf:"bytes,6,opt,name=kubelet_config_file_content,json=kubeletConfigFileContent,proto3" json:"kubelet_config_file_content,omitempty"` - KubeletClientKey string `protobuf:"bytes,7,opt,name=kubelet_client_key,json=kubeletClientKey,proto3" json:"kubelet_client_key,omitempty"` + // Kubelet client private key + KubeletClientKey string `protobuf:"bytes,7,opt,name=kubelet_client_key,json=kubeletClientKey,proto3" json:"kubelet_client_key,omitempty"` + // The content of the kubelet client certificate file. KubeletClientCertContent string `protobuf:"bytes,8,opt,name=kubelet_client_cert_content,json=kubeletClientCertContent,proto3" json:"kubelet_client_cert_content,omitempty"` } diff --git a/pkg/proto/nbcontract/v1/kubeletconfig.proto b/pkg/proto/nbcontract/v1/kubeletconfig.proto index d4ab0619922..b4b8d8bbbf6 100644 --- a/pkg/proto/nbcontract/v1/kubeletconfig.proto +++ b/pkg/proto/nbcontract/v1/kubeletconfig.proto @@ -2,16 +2,29 @@ syntax = "proto3"; package nbcontract.v1; message KubeletConfig { - // TODO(ace): remove these/make api defensible + + // A map of kubelet flags to their values. map kubelet_flags = 1; + + // A map of node labels to their values. map kubelet_node_labels = 2; + + // A list of taints to apply to the node. repeated Taint taints = 3; + + // A list of taints to apply to the node at startup. repeated Taint startup_taints = 4; + + // The type of disk to use for the kubelet. KubeletDisk kubelet_disk_type = 5; - // kubelet_config_file_content is the content of the kubelet config file. + // Base64 encoded content of the kubelet config file. string kubelet_config_file_content = 6; + + // Kubelet client private key string kubelet_client_key = 7; + + // The content of the kubelet client certificate file. string kubelet_client_cert_content = 8; } diff --git a/pkg/proto/nbcontract/v1/networkconfig.pb.go b/pkg/proto/nbcontract/v1/networkconfig.pb.go index a4d898ef217..f1cb6383fdb 100644 --- a/pkg/proto/nbcontract/v1/networkconfig.pb.go +++ b/pkg/proto/nbcontract/v1/networkconfig.pb.go @@ -129,14 +129,16 @@ type NetworkConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // NetworkPlugin is the network plugin to be used by the cluster. Options are NONE, AZURE, KUBENET. + // Network plugin to be used by the cluster. Options are NONE, AZURE, KUBENET. NetworkPlugin NetworkPlugin `protobuf:"varint,1,opt,name=network_plugin,json=networkPlugin,proto3,enum=nbcontract.v1.NetworkPlugin" json:"network_plugin,omitempty"` - // NetworkPolicy is the network policy to be used by the cluster. + // Network policy to be used by the cluster. // This is still needed to compute ENSURE_NO_DUPE_PROMISCUOUS_BRIDGE. // Other than that, it is not used by others. See the discussions here https://github.com/Azure/AgentBaker/pull/4241#discussion_r1554283228 - NetworkPolicy NetworkPolicy `protobuf:"varint,2,opt,name=network_policy,json=networkPolicy,proto3,enum=nbcontract.v1.NetworkPolicy" json:"network_policy,omitempty"` - VnetCniPluginsUrl string `protobuf:"bytes,3,opt,name=vnet_cni_plugins_url,json=vnetCniPluginsUrl,proto3" json:"vnet_cni_plugins_url,omitempty"` - CniPluginsUrl string `protobuf:"bytes,4,opt,name=cni_plugins_url,json=cniPluginsUrl,proto3" json:"cni_plugins_url,omitempty"` + NetworkPolicy NetworkPolicy `protobuf:"varint,2,opt,name=network_policy,json=networkPolicy,proto3,enum=nbcontract.v1.NetworkPolicy" json:"network_policy,omitempty"` + // URL to the vnet cni plugins tarball. + VnetCniPluginsUrl string `protobuf:"bytes,3,opt,name=vnet_cni_plugins_url,json=vnetCniPluginsUrl,proto3" json:"vnet_cni_plugins_url,omitempty"` + // URL to the cni plugins tarball. + CniPluginsUrl string `protobuf:"bytes,4,opt,name=cni_plugins_url,json=cniPluginsUrl,proto3" json:"cni_plugins_url,omitempty"` } func (x *NetworkConfig) Reset() { diff --git a/pkg/proto/nbcontract/v1/networkconfig.proto b/pkg/proto/nbcontract/v1/networkconfig.proto index 5b0a5cac5b3..e64c7917f75 100644 --- a/pkg/proto/nbcontract/v1/networkconfig.proto +++ b/pkg/proto/nbcontract/v1/networkconfig.proto @@ -3,15 +3,18 @@ package nbcontract.v1; message NetworkConfig { - // NetworkPlugin is the network plugin to be used by the cluster. Options are NONE, AZURE, KUBENET. + // Network plugin to be used by the cluster. Options are NONE, AZURE, KUBENET. NetworkPlugin network_plugin = 1; - // NetworkPolicy is the network policy to be used by the cluster. + // Network policy to be used by the cluster. // This is still needed to compute ENSURE_NO_DUPE_PROMISCUOUS_BRIDGE. // Other than that, it is not used by others. See the discussions here https://github.com/Azure/AgentBaker/pull/4241#discussion_r1554283228 NetworkPolicy network_policy = 2; + // URL to the vnet cni plugins tarball. string vnet_cni_plugins_url = 3; + + // URL to the cni plugins tarball. string cni_plugins_url = 4; } diff --git a/pkg/proto/nbcontract/v1/runcconfig.pb.go b/pkg/proto/nbcontract/v1/runcconfig.pb.go index aa3631768bf..f5042cb2aec 100644 --- a/pkg/proto/nbcontract/v1/runcconfig.pb.go +++ b/pkg/proto/nbcontract/v1/runcconfig.pb.go @@ -25,7 +25,9 @@ type RuncConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - RuncVersion string `protobuf:"bytes,1,opt,name=runc_version,json=runcVersion,proto3" json:"runc_version,omitempty"` + // The version of runc to use. + RuncVersion string `protobuf:"bytes,1,opt,name=runc_version,json=runcVersion,proto3" json:"runc_version,omitempty"` + // The URL to download the runc package from. RuncPackageUrl string `protobuf:"bytes,2,opt,name=runc_package_url,json=runcPackageUrl,proto3" json:"runc_package_url,omitempty"` } diff --git a/pkg/proto/nbcontract/v1/runcconfig.proto b/pkg/proto/nbcontract/v1/runcconfig.proto index 5329b528b13..6871eb518cc 100644 --- a/pkg/proto/nbcontract/v1/runcconfig.proto +++ b/pkg/proto/nbcontract/v1/runcconfig.proto @@ -2,6 +2,10 @@ syntax = "proto3"; package nbcontract.v1; message RuncConfig { + + // The version of runc to use. string runc_version = 1; + + // The URL to download the runc package from. string runc_package_url = 2; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/teleportconfig.pb.go b/pkg/proto/nbcontract/v1/teleportconfig.pb.go index 8d4a6a2c332..f87a794ca94 100644 --- a/pkg/proto/nbcontract/v1/teleportconfig.pb.go +++ b/pkg/proto/nbcontract/v1/teleportconfig.pb.go @@ -25,7 +25,9 @@ type TeleportConfig struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + // The status of the teleportd plugin. If true, the plugin is enabled. + Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` + // The URL to download the teleportd plugin. TeleportdPluginDownloadUrl string `protobuf:"bytes,2,opt,name=teleportd_plugin_download_url,json=teleportdPluginDownloadUrl,proto3" json:"teleportd_plugin_download_url,omitempty"` } diff --git a/pkg/proto/nbcontract/v1/teleportconfig.proto b/pkg/proto/nbcontract/v1/teleportconfig.proto index 45bbdca673a..78bdc7166a7 100644 --- a/pkg/proto/nbcontract/v1/teleportconfig.proto +++ b/pkg/proto/nbcontract/v1/teleportconfig.proto @@ -2,6 +2,10 @@ syntax = "proto3"; package nbcontract.v1; message TeleportConfig { + + // The status of the teleportd plugin. If true, the plugin is enabled. bool status = 1; + + // The URL to download the teleportd plugin. string teleportd_plugin_download_url = 2; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go b/pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go new file mode 100644 index 00000000000..e3379eedd98 --- /dev/null +++ b/pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go @@ -0,0 +1,190 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto + +package nbcontractv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TLSBootstrapConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Enable secure TLS bootstrap for the node. + EnableSecureTlsBootstrap *bool `protobuf:"varint,1,opt,name=enable_secure_tls_bootstrap,json=enableSecureTlsBootstrap,proto3,oneof" json:"enable_secure_tls_bootstrap,omitempty"` + // Only required until Secure TLS bootstrap in place. Would use kubelet identity after that. + TlsBootstrapToken string `protobuf:"bytes,2,opt,name=tls_bootstrap_token,json=tlsBootstrapToken,proto3" json:"tls_bootstrap_token,omitempty"` + // Only used when secure TLS bootstrap is enabled. This is the appserver appid that the node will use to bootstrap + CustomSecureTlsBootstrapAppserverAppid string `protobuf:"bytes,3,opt,name=custom_secure_tls_bootstrap_appserver_appid,json=customSecureTlsBootstrapAppserverAppid,proto3" json:"custom_secure_tls_bootstrap_appserver_appid,omitempty"` +} + +func (x *TLSBootstrapConfig) Reset() { + *x = TLSBootstrapConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TLSBootstrapConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TLSBootstrapConfig) ProtoMessage() {} + +func (x *TLSBootstrapConfig) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TLSBootstrapConfig.ProtoReflect.Descriptor instead. +func (*TLSBootstrapConfig) Descriptor() ([]byte, []int) { + return file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescGZIP(), []int{0} +} + +func (x *TLSBootstrapConfig) GetEnableSecureTlsBootstrap() bool { + if x != nil && x.EnableSecureTlsBootstrap != nil { + return *x.EnableSecureTlsBootstrap + } + return false +} + +func (x *TLSBootstrapConfig) GetTlsBootstrapToken() string { + if x != nil { + return x.TlsBootstrapToken + } + return "" +} + +func (x *TLSBootstrapConfig) GetCustomSecureTlsBootstrapAppserverAppid() string { + if x != nil { + return x.CustomSecureTlsBootstrapAppserverAppid + } + return "" +} + +var File_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto protoreflect.FileDescriptor + +var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc = []byte{ + 0x0a, 0x30, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6c, 0x73, 0x62, 0x6f, 0x6f, + 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, + 0x31, 0x22, 0x85, 0x02, 0x0a, 0x12, 0x54, 0x4c, 0x53, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, + 0x61, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x1b, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, + 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x6c, 0x73, + 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x13, + 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x74, 0x6c, 0x73, 0x42, 0x6f, + 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x5b, 0x0a, 0x2b, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, + 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x61, 0x70, 0x70, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x26, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, + 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x41, 0x70, 0x70, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x69, 0x64, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, + 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x42, 0xc3, 0x01, 0x0a, 0x11, 0x63, 0x6f, + 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x42, + 0x17, 0x54, 0x6c, 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, + 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, + 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, + 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, + 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, + 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescOnce sync.Once + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData = file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc +) + +func file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescGZIP() []byte { + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescOnce.Do(func() { + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData) + }) + return file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData +} + +var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_goTypes = []interface{}{ + (*TLSBootstrapConfig)(nil), // 0: nbcontract.v1.TLSBootstrapConfig +} +var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_init() } +func file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_init() { + if File_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TLSBootstrapConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_goTypes, + DependencyIndexes: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_depIdxs, + MessageInfos: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes, + }.Build() + File_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto = out.File + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc = nil + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_goTypes = nil + file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_depIdxs = nil +} diff --git a/pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto b/pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto new file mode 100644 index 00000000000..b085a3370ae --- /dev/null +++ b/pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package nbcontract.v1; + +message TLSBootstrapConfig { + // Enable secure TLS bootstrap for the node. + optional bool enable_secure_tls_bootstrap = 1; + + // Only required until Secure TLS bootstrap in place. Would use kubelet identity after that. + string tls_bootstrap_token = 2; + + // Only used when secure TLS bootstrap is enabled. This is the appserver appid that the node will use to bootstrap + string custom_secure_tls_bootstrap_appserver_appid = 3; + } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go deleted file mode 100644 index 256394f7611..00000000000 --- a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc (unknown) -// source: pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto - -package nbcontractv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type TLSBootstrappingConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EnableSecureTlsBootstrapping *bool `protobuf:"varint,1,opt,name=enable_secure_tls_bootstrapping,json=enableSecureTlsBootstrapping,proto3,oneof" json:"enable_secure_tls_bootstrapping,omitempty"` - TlsBootstrapToken string `protobuf:"bytes,2,opt,name=tls_bootstrap_token,json=tlsBootstrapToken,proto3" json:"tls_bootstrap_token,omitempty"` // Only required until Secure TLS bootstrapping in place. Would use kubelet identity after that. - CustomSecureTlsBootstrapAppserverAppid string `protobuf:"bytes,3,opt,name=custom_secure_tls_bootstrap_appserver_appid,json=customSecureTlsBootstrapAppserverAppid,proto3" json:"custom_secure_tls_bootstrap_appserver_appid,omitempty"` // Only used when secure TLS bootstrapping is enabled -} - -func (x *TLSBootstrappingConfig) Reset() { - *x = TLSBootstrappingConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TLSBootstrappingConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TLSBootstrappingConfig) ProtoMessage() {} - -func (x *TLSBootstrappingConfig) ProtoReflect() protoreflect.Message { - mi := &file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TLSBootstrappingConfig.ProtoReflect.Descriptor instead. -func (*TLSBootstrappingConfig) Descriptor() ([]byte, []int) { - return file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescGZIP(), []int{0} -} - -func (x *TLSBootstrappingConfig) GetEnableSecureTlsBootstrapping() bool { - if x != nil && x.EnableSecureTlsBootstrapping != nil { - return *x.EnableSecureTlsBootstrapping - } - return false -} - -func (x *TLSBootstrappingConfig) GetTlsBootstrapToken() string { - if x != nil { - return x.TlsBootstrapToken - } - return "" -} - -func (x *TLSBootstrappingConfig) GetCustomSecureTlsBootstrapAppserverAppid() string { - if x != nil { - return x.CustomSecureTlsBootstrapAppserverAppid - } - return "" -} - -var File_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto protoreflect.FileDescriptor - -var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc = []byte{ - 0x0a, 0x34, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6c, 0x73, 0x62, 0x6f, 0x6f, - 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x2e, 0x76, 0x31, 0x22, 0x95, 0x02, 0x0a, 0x16, 0x54, 0x4c, 0x53, 0x42, 0x6f, 0x6f, - 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x4a, 0x0a, 0x1f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, - 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, - 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x1c, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, - 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x13, - 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x74, 0x6c, 0x73, 0x42, 0x6f, - 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x5b, 0x0a, 0x2b, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, - 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x61, 0x70, 0x70, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x26, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, - 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x41, 0x70, 0x70, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x69, 0x64, 0x42, 0x22, 0x0a, 0x20, 0x5f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, - 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0xc7, 0x01, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x2e, 0x76, 0x31, 0x42, 0x1b, 0x54, 0x6c, 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, - 0x70, 0x70, 0x69, 0x6e, 0x67, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, - 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescOnce sync.Once - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData = file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc -) - -func file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescGZIP() []byte { - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescOnce.Do(func() { - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData) - }) - return file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData -} - -var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_goTypes = []interface{}{ - (*TLSBootstrappingConfig)(nil), // 0: nbcontract.v1.TLSBootstrappingConfig -} -var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_init() } -func file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_init() { - if File_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TLSBootstrappingConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_goTypes, - DependencyIndexes: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_depIdxs, - MessageInfos: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes, - }.Build() - File_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto = out.File - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc = nil - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_goTypes = nil - file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_depIdxs = nil -} diff --git a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto deleted file mode 100644 index 60007eb8204..00000000000 --- a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto +++ /dev/null @@ -1,8 +0,0 @@ -syntax = "proto3"; -package nbcontract.v1; - -message TLSBootstrappingConfig { - optional bool enable_secure_tls_bootstrapping = 1; - string tls_bootstrap_token = 2; // Only required until Secure TLS bootstrapping in place. Would use kubelet identity after that. - string custom_secure_tls_bootstrap_appserver_appid = 3; // Only used when secure TLS bootstrapping is enabled - } \ No newline at end of file From 013a1a986499c29a8105abee40e65c051405b71d Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Wed, 10 Apr 2024 10:26:45 -0700 Subject: [PATCH 02/20] minor update --- pkg/proto/nbcontract/v1/config.pb.go | 85 ++++---- pkg/proto/nbcontract/v1/config.proto | 8 +- .../nbcontract/v1/tlsbootstrapconfig.pb.go | 190 ----------------- .../nbcontract/v1/tlsbootstrapconfig.proto | 13 -- .../v1/tlsbootstrappingconfig.pb.go | 192 ++++++++++++++++++ .../v1/tlsbootstrappingconfig.proto | 13 ++ 6 files changed, 252 insertions(+), 249 deletions(-) delete mode 100644 pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go delete mode 100644 pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto create mode 100644 pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go create mode 100644 pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto diff --git a/pkg/proto/nbcontract/v1/config.pb.go b/pkg/proto/nbcontract/v1/config.pb.go index 1b83c71416b..701437ec2b4 100644 --- a/pkg/proto/nbcontract/v1/config.pb.go +++ b/pkg/proto/nbcontract/v1/config.pb.go @@ -76,10 +76,10 @@ type Configuration struct { // Semantic version of this node bootstrap contract Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Kubernetes certificate authority certificate, required by the node to establish TLS with the API server - Kubernetes_CACert string `protobuf:"bytes,2,opt,name=kubernetes_CA_cert,json=kubernetesCACert,proto3" json:"kubernetes_CA_cert,omitempty"` + // Kubernetes certificate authority (CA) certificate, required by the node to establish TLS with the API server + KubernetesCaCert string `protobuf:"bytes,2,opt,name=kubernetes_ca_cert,json=kubernetesCaCert,proto3" json:"kubernetes_ca_cert,omitempty"` // TLS bootstrap config - TlsBootstrapConfig *TLSBootstrapConfig `protobuf:"bytes,3,opt,name=tls_bootstrap_config,json=tlsBootstrapConfig,proto3" json:"tls_bootstrap_config,omitempty"` + TlsBootstrappingConfig *TLSBootstrappingConfig `protobuf:"bytes,3,opt,name=tls_bootstrapping_config,json=tlsBootstrappingConfig,proto3" json:"tls_bootstrapping_config,omitempty"` // Cluster/user config KubernetesVersion string `protobuf:"bytes,4,opt,name=kubernetes_version,json=kubernetesVersion,proto3" json:"kubernetes_version,omitempty"` // Q: can this be auto-detected? Or is this part of specifying the desired node version? // Kube binary URL config @@ -190,16 +190,16 @@ func (x *Configuration) GetVersion() string { return "" } -func (x *Configuration) GetKubernetes_CACert() string { +func (x *Configuration) GetKubernetesCaCert() string { if x != nil { - return x.Kubernetes_CACert + return x.KubernetesCaCert } return "" } -func (x *Configuration) GetTlsBootstrapConfig() *TLSBootstrapConfig { +func (x *Configuration) GetTlsBootstrappingConfig() *TLSBootstrappingConfig { if x != nil { - return x.TlsBootstrapConfig + return x.TlsBootstrappingConfig } return nil } @@ -486,23 +486,24 @@ var file_pkg_proto_nbcontract_v1_config_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2d, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x34, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6c, - 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, - 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x10, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x2c, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x43, 0x41, - 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6b, 0x75, 0x62, - 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x41, 0x43, 0x65, 0x72, 0x74, 0x12, 0x53, 0x0a, - 0x14, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6e, 0x62, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x4c, 0x53, 0x42, - 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x12, - 0x74, 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x43, 0x6f, 0x6e, 0x66, + 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf9, 0x10, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, + 0x73, 0x5f, 0x63, 0x61, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x10, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x43, 0x61, 0x43, 0x65, 0x72, + 0x74, 0x12, 0x5f, 0x0a, 0x18, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, + 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x4c, 0x53, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, + 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x16, 0x74, 0x6c, 0x73, 0x42, + 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2d, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, 0x73, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, @@ -661,26 +662,26 @@ func file_pkg_proto_nbcontract_v1_config_proto_rawDescGZIP() []byte { var file_pkg_proto_nbcontract_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_pkg_proto_nbcontract_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_pkg_proto_nbcontract_v1_config_proto_goTypes = []interface{}{ - (WorkloadRuntime)(0), // 0: nbcontract.v1.WorkloadRuntime - (*Configuration)(nil), // 1: nbcontract.v1.Configuration - (*TLSBootstrapConfig)(nil), // 2: nbcontract.v1.TLSBootstrapConfig - (*KubeBinaryConfig)(nil), // 3: nbcontract.v1.KubeBinaryConfig - (*CustomCloudConfig)(nil), // 4: nbcontract.v1.CustomCloudConfig - (*ApiServerConfig)(nil), // 5: nbcontract.v1.ApiServerConfig - (*ClusterConfig)(nil), // 6: nbcontract.v1.ClusterConfig - (*AuthConfig)(nil), // 7: nbcontract.v1.AuthConfig - (*RuncConfig)(nil), // 8: nbcontract.v1.RuncConfig - (*ContainerdConfig)(nil), // 9: nbcontract.v1.ContainerdConfig - (*NetworkConfig)(nil), // 10: nbcontract.v1.NetworkConfig - (*TeleportConfig)(nil), // 11: nbcontract.v1.TeleportConfig - (*KubeletConfig)(nil), // 12: nbcontract.v1.KubeletConfig - (*CustomSearchDomain)(nil), // 13: nbcontract.v1.CustomSearchDomain - (*CustomLinuxOSConfig)(nil), // 14: nbcontract.v1.CustomLinuxOSConfig - (*HTTPProxyConfig)(nil), // 15: nbcontract.v1.HTTPProxyConfig - (*GPUConfig)(nil), // 16: nbcontract.v1.GPUConfig + (WorkloadRuntime)(0), // 0: nbcontract.v1.WorkloadRuntime + (*Configuration)(nil), // 1: nbcontract.v1.Configuration + (*TLSBootstrappingConfig)(nil), // 2: nbcontract.v1.TLSBootstrappingConfig + (*KubeBinaryConfig)(nil), // 3: nbcontract.v1.KubeBinaryConfig + (*CustomCloudConfig)(nil), // 4: nbcontract.v1.CustomCloudConfig + (*ApiServerConfig)(nil), // 5: nbcontract.v1.ApiServerConfig + (*ClusterConfig)(nil), // 6: nbcontract.v1.ClusterConfig + (*AuthConfig)(nil), // 7: nbcontract.v1.AuthConfig + (*RuncConfig)(nil), // 8: nbcontract.v1.RuncConfig + (*ContainerdConfig)(nil), // 9: nbcontract.v1.ContainerdConfig + (*NetworkConfig)(nil), // 10: nbcontract.v1.NetworkConfig + (*TeleportConfig)(nil), // 11: nbcontract.v1.TeleportConfig + (*KubeletConfig)(nil), // 12: nbcontract.v1.KubeletConfig + (*CustomSearchDomain)(nil), // 13: nbcontract.v1.CustomSearchDomain + (*CustomLinuxOSConfig)(nil), // 14: nbcontract.v1.CustomLinuxOSConfig + (*HTTPProxyConfig)(nil), // 15: nbcontract.v1.HTTPProxyConfig + (*GPUConfig)(nil), // 16: nbcontract.v1.GPUConfig } var file_pkg_proto_nbcontract_v1_config_proto_depIdxs = []int32{ - 2, // 0: nbcontract.v1.Configuration.tls_bootstrap_config:type_name -> nbcontract.v1.TLSBootstrapConfig + 2, // 0: nbcontract.v1.Configuration.tls_bootstrapping_config:type_name -> nbcontract.v1.TLSBootstrappingConfig 3, // 1: nbcontract.v1.Configuration.kube_binary_config:type_name -> nbcontract.v1.KubeBinaryConfig 4, // 2: nbcontract.v1.Configuration.custom_cloud_config:type_name -> nbcontract.v1.CustomCloudConfig 5, // 3: nbcontract.v1.Configuration.api_server_config:type_name -> nbcontract.v1.ApiServerConfig @@ -721,7 +722,7 @@ func file_pkg_proto_nbcontract_v1_config_proto_init() { file_pkg_proto_nbcontract_v1_runcconfig_proto_init() file_pkg_proto_nbcontract_v1_customcloudconfig_proto_init() file_pkg_proto_nbcontract_v1_apiserverconfig_proto_init() - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_init() + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_init() file_pkg_proto_nbcontract_v1_clusterconfig_proto_init() if !protoimpl.UnsafeEnabled { file_pkg_proto_nbcontract_v1_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { diff --git a/pkg/proto/nbcontract/v1/config.proto b/pkg/proto/nbcontract/v1/config.proto index 526474b9179..062920e02d5 100644 --- a/pkg/proto/nbcontract/v1/config.proto +++ b/pkg/proto/nbcontract/v1/config.proto @@ -15,7 +15,7 @@ import "pkg/proto/nbcontract/v1/teleportconfig.proto"; import "pkg/proto/nbcontract/v1/runcconfig.proto"; import "pkg/proto/nbcontract/v1/customcloudconfig.proto"; import "pkg/proto/nbcontract/v1/apiserverconfig.proto"; -import "pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto"; +import "pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto"; import "pkg/proto/nbcontract/v1/clusterconfig.proto"; enum WorkloadRuntime { @@ -29,11 +29,11 @@ message Configuration { // Semantic version of this node bootstrap contract string version = 1; - // Kubernetes certificate authority certificate, required by the node to establish TLS with the API server - string kubernetes_CA_cert = 2; + // Kubernetes certificate authority (CA) certificate, required by the node to establish TLS with the API server + string kubernetes_ca_cert = 2; // TLS bootstrap config - TLSBootstrapConfig tls_bootstrap_config = 3; + TLSBootstrappingConfig tls_bootstrapping_config = 3; // Cluster/user config string kubernetes_version = 4; // Q: can this be auto-detected? Or is this part of specifying the desired node version? diff --git a/pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go b/pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go deleted file mode 100644 index e3379eedd98..00000000000 --- a/pkg/proto/nbcontract/v1/tlsbootstrapconfig.pb.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.33.0 -// protoc (unknown) -// source: pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto - -package nbcontractv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type TLSBootstrapConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Enable secure TLS bootstrap for the node. - EnableSecureTlsBootstrap *bool `protobuf:"varint,1,opt,name=enable_secure_tls_bootstrap,json=enableSecureTlsBootstrap,proto3,oneof" json:"enable_secure_tls_bootstrap,omitempty"` - // Only required until Secure TLS bootstrap in place. Would use kubelet identity after that. - TlsBootstrapToken string `protobuf:"bytes,2,opt,name=tls_bootstrap_token,json=tlsBootstrapToken,proto3" json:"tls_bootstrap_token,omitempty"` - // Only used when secure TLS bootstrap is enabled. This is the appserver appid that the node will use to bootstrap - CustomSecureTlsBootstrapAppserverAppid string `protobuf:"bytes,3,opt,name=custom_secure_tls_bootstrap_appserver_appid,json=customSecureTlsBootstrapAppserverAppid,proto3" json:"custom_secure_tls_bootstrap_appserver_appid,omitempty"` -} - -func (x *TLSBootstrapConfig) Reset() { - *x = TLSBootstrapConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TLSBootstrapConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TLSBootstrapConfig) ProtoMessage() {} - -func (x *TLSBootstrapConfig) ProtoReflect() protoreflect.Message { - mi := &file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TLSBootstrapConfig.ProtoReflect.Descriptor instead. -func (*TLSBootstrapConfig) Descriptor() ([]byte, []int) { - return file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescGZIP(), []int{0} -} - -func (x *TLSBootstrapConfig) GetEnableSecureTlsBootstrap() bool { - if x != nil && x.EnableSecureTlsBootstrap != nil { - return *x.EnableSecureTlsBootstrap - } - return false -} - -func (x *TLSBootstrapConfig) GetTlsBootstrapToken() string { - if x != nil { - return x.TlsBootstrapToken - } - return "" -} - -func (x *TLSBootstrapConfig) GetCustomSecureTlsBootstrapAppserverAppid() string { - if x != nil { - return x.CustomSecureTlsBootstrapAppserverAppid - } - return "" -} - -var File_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto protoreflect.FileDescriptor - -var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6c, 0x73, 0x62, 0x6f, 0x6f, - 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, - 0x31, 0x22, 0x85, 0x02, 0x0a, 0x12, 0x54, 0x4c, 0x53, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, - 0x61, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x42, 0x0a, 0x1b, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, - 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, - 0x18, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x6c, 0x73, - 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x13, - 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x74, 0x6c, 0x73, 0x42, 0x6f, - 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x5b, 0x0a, 0x2b, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, - 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x5f, 0x61, 0x70, 0x70, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x26, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, - 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x41, 0x70, 0x70, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x69, 0x64, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, - 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x42, 0xc3, 0x01, 0x0a, 0x11, 0x63, 0x6f, - 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x42, - 0x17, 0x54, 0x6c, 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, - 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, - 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescOnce sync.Once - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData = file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc -) - -func file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescGZIP() []byte { - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescOnce.Do(func() { - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData) - }) - return file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDescData -} - -var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_goTypes = []interface{}{ - (*TLSBootstrapConfig)(nil), // 0: nbcontract.v1.TLSBootstrapConfig -} -var file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_init() } -func file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_init() { - if File_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TLSBootstrapConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_goTypes, - DependencyIndexes: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_depIdxs, - MessageInfos: file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_msgTypes, - }.Build() - File_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto = out.File - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_rawDesc = nil - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_goTypes = nil - file_pkg_proto_nbcontract_v1_tlsbootstrapconfig_proto_depIdxs = nil -} diff --git a/pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto b/pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto deleted file mode 100644 index b085a3370ae..00000000000 --- a/pkg/proto/nbcontract/v1/tlsbootstrapconfig.proto +++ /dev/null @@ -1,13 +0,0 @@ -syntax = "proto3"; -package nbcontract.v1; - -message TLSBootstrapConfig { - // Enable secure TLS bootstrap for the node. - optional bool enable_secure_tls_bootstrap = 1; - - // Only required until Secure TLS bootstrap in place. Would use kubelet identity after that. - string tls_bootstrap_token = 2; - - // Only used when secure TLS bootstrap is enabled. This is the appserver appid that the node will use to bootstrap - string custom_secure_tls_bootstrap_appserver_appid = 3; - } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go new file mode 100644 index 00000000000..295fce9d950 --- /dev/null +++ b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.pb.go @@ -0,0 +1,192 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.33.0 +// protoc (unknown) +// source: pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto + +package nbcontractv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type TLSBootstrappingConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Enable secure TLS bootstrapping for the node. + EnableSecureTlsBootstrapping *bool `protobuf:"varint,1,opt,name=enable_secure_tls_bootstrapping,json=enableSecureTlsBootstrapping,proto3,oneof" json:"enable_secure_tls_bootstrapping,omitempty"` + // Only required until Secure TLS bootstrapping in place. Would use kubelet identity after that. + TlsBootstrappingToken string `protobuf:"bytes,2,opt,name=tls_bootstrapping_token,json=tlsBootstrappingToken,proto3" json:"tls_bootstrapping_token,omitempty"` + // Only used when secure TLS bootstrapping is enabled. This is the appserver appid that the node will use to bootstrap. + CustomSecureTlsBootstrappingAppserverAppid string `protobuf:"bytes,3,opt,name=custom_secure_tls_bootstrapping_appserver_appid,json=customSecureTlsBootstrappingAppserverAppid,proto3" json:"custom_secure_tls_bootstrapping_appserver_appid,omitempty"` +} + +func (x *TLSBootstrappingConfig) Reset() { + *x = TLSBootstrappingConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TLSBootstrappingConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TLSBootstrappingConfig) ProtoMessage() {} + +func (x *TLSBootstrappingConfig) ProtoReflect() protoreflect.Message { + mi := &file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TLSBootstrappingConfig.ProtoReflect.Descriptor instead. +func (*TLSBootstrappingConfig) Descriptor() ([]byte, []int) { + return file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescGZIP(), []int{0} +} + +func (x *TLSBootstrappingConfig) GetEnableSecureTlsBootstrapping() bool { + if x != nil && x.EnableSecureTlsBootstrapping != nil { + return *x.EnableSecureTlsBootstrapping + } + return false +} + +func (x *TLSBootstrappingConfig) GetTlsBootstrappingToken() string { + if x != nil { + return x.TlsBootstrappingToken + } + return "" +} + +func (x *TLSBootstrappingConfig) GetCustomSecureTlsBootstrappingAppserverAppid() string { + if x != nil { + return x.CustomSecureTlsBootstrappingAppserverAppid + } + return "" +} + +var File_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto protoreflect.FileDescriptor + +var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc = []byte{ + 0x0a, 0x34, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x6c, 0x73, 0x62, 0x6f, 0x6f, + 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x22, 0xa5, 0x02, 0x0a, 0x16, 0x54, 0x4c, 0x53, 0x42, 0x6f, 0x6f, + 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x4a, 0x0a, 0x1f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x1c, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, + 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12, 0x36, 0x0a, 0x17, + 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, + 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x15, 0x74, + 0x6c, 0x73, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x63, 0x0a, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, + 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, + 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x5f, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x2a, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x6c, 0x73, 0x42, 0x6f, + 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x41, 0x70, 0x70, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x41, 0x70, 0x70, 0x69, 0x64, 0x42, 0x22, 0x0a, 0x20, 0x5f, 0x65, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x6c, 0x73, 0x5f, + 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0xc7, 0x01, + 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2e, 0x76, 0x31, 0x42, 0x1b, 0x54, 0x6c, 0x73, 0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, + 0x70, 0x70, 0x69, 0x6e, 0x67, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, + 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescOnce sync.Once + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData = file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc +) + +func file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescGZIP() []byte { + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescOnce.Do(func() { + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData = protoimpl.X.CompressGZIP(file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData) + }) + return file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDescData +} + +var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_goTypes = []interface{}{ + (*TLSBootstrappingConfig)(nil), // 0: nbcontract.v1.TLSBootstrappingConfig +} +var file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_init() } +func file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_init() { + if File_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TLSBootstrappingConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes[0].OneofWrappers = []interface{}{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_goTypes, + DependencyIndexes: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_depIdxs, + MessageInfos: file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_msgTypes, + }.Build() + File_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto = out.File + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_rawDesc = nil + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_goTypes = nil + file_pkg_proto_nbcontract_v1_tlsbootstrappingconfig_proto_depIdxs = nil +} diff --git a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto new file mode 100644 index 00000000000..842a5e57b14 --- /dev/null +++ b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +package nbcontract.v1; + +message TLSBootstrappingConfig { + // Enable secure TLS bootstrapping for the node. + optional bool enable_secure_tls_bootstrapping = 1; + + // Only required until Secure TLS bootstrapping in place. Would use kubelet identity after that. + string tls_bootstrapping_token = 2; + + // Only used when secure TLS bootstrapping is enabled. This is the appserver appid that the node will use to bootstrap. + string custom_secure_tls_bootstrapping_appserver_appid = 3; + } \ No newline at end of file From 3de3b8d28518b73f04815fb7e855facc64f1c51a Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Wed, 10 Apr 2024 11:36:01 -0700 Subject: [PATCH 03/20] remove extra empty lines --- pkg/proto/nbcontract/v1/customcloudconfig.proto | 1 - pkg/proto/nbcontract/v1/customsearchdomainconfig.proto | 1 - pkg/proto/nbcontract/v1/kubebinaryconfig.proto | 1 - pkg/proto/nbcontract/v1/kubeletconfig.proto | 1 - pkg/proto/nbcontract/v1/networkconfig.proto | 1 - pkg/proto/nbcontract/v1/runcconfig.proto | 1 - pkg/proto/nbcontract/v1/teleportconfig.proto | 1 - 7 files changed, 7 deletions(-) diff --git a/pkg/proto/nbcontract/v1/customcloudconfig.proto b/pkg/proto/nbcontract/v1/customcloudconfig.proto index 5ac4a4b370a..6643c040221 100644 --- a/pkg/proto/nbcontract/v1/customcloudconfig.proto +++ b/pkg/proto/nbcontract/v1/customcloudconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message CustomCloudConfig { - // IsAKSCustomCloud is a flag to indicate if it is AKS custom cloud bool is_aks_custom_cloud = 1; diff --git a/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto b/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto index eff026c3fcf..920ff4e9e4c 100644 --- a/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto +++ b/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message CustomSearchDomain { - // The name of the custom search domain. string custom_search_domain_name = 1; diff --git a/pkg/proto/nbcontract/v1/kubebinaryconfig.proto b/pkg/proto/nbcontract/v1/kubebinaryconfig.proto index 81d40ecbfb0..650fa523f66 100644 --- a/pkg/proto/nbcontract/v1/kubebinaryconfig.proto +++ b/pkg/proto/nbcontract/v1/kubebinaryconfig.proto @@ -3,7 +3,6 @@ package nbcontract.v1; // Kube Binary Config message KubeBinaryConfig { - //default kube binary url string kube_binary_url = 1; diff --git a/pkg/proto/nbcontract/v1/kubeletconfig.proto b/pkg/proto/nbcontract/v1/kubeletconfig.proto index b4b8d8bbbf6..aa1f65a26da 100644 --- a/pkg/proto/nbcontract/v1/kubeletconfig.proto +++ b/pkg/proto/nbcontract/v1/kubeletconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message KubeletConfig { - // A map of kubelet flags to their values. map kubelet_flags = 1; diff --git a/pkg/proto/nbcontract/v1/networkconfig.proto b/pkg/proto/nbcontract/v1/networkconfig.proto index e64c7917f75..8cbb82222ec 100644 --- a/pkg/proto/nbcontract/v1/networkconfig.proto +++ b/pkg/proto/nbcontract/v1/networkconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message NetworkConfig { - // Network plugin to be used by the cluster. Options are NONE, AZURE, KUBENET. NetworkPlugin network_plugin = 1; diff --git a/pkg/proto/nbcontract/v1/runcconfig.proto b/pkg/proto/nbcontract/v1/runcconfig.proto index 6871eb518cc..59bde5e3a65 100644 --- a/pkg/proto/nbcontract/v1/runcconfig.proto +++ b/pkg/proto/nbcontract/v1/runcconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message RuncConfig { - // The version of runc to use. string runc_version = 1; diff --git a/pkg/proto/nbcontract/v1/teleportconfig.proto b/pkg/proto/nbcontract/v1/teleportconfig.proto index 78bdc7166a7..7f8d23a19fe 100644 --- a/pkg/proto/nbcontract/v1/teleportconfig.proto +++ b/pkg/proto/nbcontract/v1/teleportconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message TeleportConfig { - // The status of the teleportd plugin. If true, the plugin is enabled. bool status = 1; From 584b4858363e125fa2eb00143c716e0a74ae4c01 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Wed, 10 Apr 2024 11:40:10 -0700 Subject: [PATCH 04/20] fix indents --- pkg/proto/nbcontract/v1/apiserverconfig.proto | 10 +++++----- pkg/proto/nbcontract/v1/clusterconfig.proto | 1 - pkg/proto/nbcontract/v1/config.proto | 1 - .../nbcontract/v1/containerdconfig.proto | 1 - .../nbcontract/v1/customcloudconfig.proto | 20 +++++++++---------- .../v1/tlsbootstrappingconfig.proto | 14 ++++++------- 6 files changed, 22 insertions(+), 25 deletions(-) diff --git a/pkg/proto/nbcontract/v1/apiserverconfig.proto b/pkg/proto/nbcontract/v1/apiserverconfig.proto index e2d3f90748d..f2fccb151db 100644 --- a/pkg/proto/nbcontract/v1/apiserverconfig.proto +++ b/pkg/proto/nbcontract/v1/apiserverconfig.proto @@ -2,9 +2,9 @@ syntax = "proto3"; package nbcontract.v1; message ApiServerConfig { - // The certificate public key of the API server. - string api_server_public_key = 1; + // The certificate public key of the API server. + string api_server_public_key = 1; - // The name or endpoint URI of the API server. - string api_server_name = 2; - } \ No newline at end of file + // The name or endpoint URI of the API server. + string api_server_name = 2; +} \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/clusterconfig.proto b/pkg/proto/nbcontract/v1/clusterconfig.proto index 245207ddcdc..80cb25d598a 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.proto +++ b/pkg/proto/nbcontract/v1/clusterconfig.proto @@ -3,7 +3,6 @@ package nbcontract.v1; // Cluster Config fields stored in azure.json used by cloud-provider-azure message ClusterConfig { - // Rescource group name string resource_group = 1; diff --git a/pkg/proto/nbcontract/v1/config.proto b/pkg/proto/nbcontract/v1/config.proto index 062920e02d5..a098b1c5449 100644 --- a/pkg/proto/nbcontract/v1/config.proto +++ b/pkg/proto/nbcontract/v1/config.proto @@ -25,7 +25,6 @@ enum WorkloadRuntime { } message Configuration { - // Semantic version of this node bootstrap contract string version = 1; diff --git a/pkg/proto/nbcontract/v1/containerdconfig.proto b/pkg/proto/nbcontract/v1/containerdconfig.proto index 05cc6be8da9..1936aa698c2 100644 --- a/pkg/proto/nbcontract/v1/containerdconfig.proto +++ b/pkg/proto/nbcontract/v1/containerdconfig.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package nbcontract.v1; message ContainerdConfig { - // The base URL for downloading containerd. string containerd_download_url_base = 1; diff --git a/pkg/proto/nbcontract/v1/customcloudconfig.proto b/pkg/proto/nbcontract/v1/customcloudconfig.proto index 6643c040221..be421c4cd6d 100644 --- a/pkg/proto/nbcontract/v1/customcloudconfig.proto +++ b/pkg/proto/nbcontract/v1/customcloudconfig.proto @@ -2,18 +2,18 @@ syntax = "proto3"; package nbcontract.v1; message CustomCloudConfig { - // IsAKSCustomCloud is a flag to indicate if it is AKS custom cloud - bool is_aks_custom_cloud = 1; + // IsAKSCustomCloud is a flag to indicate if it is AKS custom cloud + bool is_aks_custom_cloud = 1; - // InitFilePath is the path to the file that contains the init script - string init_file_path = 2; + // InitFilePath is the path to the file that contains the init script + string init_file_path = 2; - // RepoDepotEndpoint is the endpoint of the repo depot - string repo_depot_endpoint = 3; + // RepoDepotEndpoint is the endpoint of the repo depot + string repo_depot_endpoint = 3; - // Specifies if target environment is a sovereign cloud, which has its own data compliance regulation, or standard public cloud. - string target_environment = 4; + // Specifies if target environment is a sovereign cloud, which has its own data compliance regulation, or standard public cloud. + string target_environment = 4; - // Base64 encoded JSON string of custom cloud environment - string custom_env_json_content = 5; + // Base64 encoded JSON string of custom cloud environment + string custom_env_json_content = 5; } \ No newline at end of file diff --git a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto index 842a5e57b14..da66098b10f 100644 --- a/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto +++ b/pkg/proto/nbcontract/v1/tlsbootstrappingconfig.proto @@ -2,12 +2,12 @@ syntax = "proto3"; package nbcontract.v1; message TLSBootstrappingConfig { - // Enable secure TLS bootstrapping for the node. - optional bool enable_secure_tls_bootstrapping = 1; + // Enable secure TLS bootstrapping for the node. + optional bool enable_secure_tls_bootstrapping = 1; - // Only required until Secure TLS bootstrapping in place. Would use kubelet identity after that. - string tls_bootstrapping_token = 2; + // Only required until Secure TLS bootstrapping in place. Would use kubelet identity after that. + string tls_bootstrapping_token = 2; - // Only used when secure TLS bootstrapping is enabled. This is the appserver appid that the node will use to bootstrap. - string custom_secure_tls_bootstrapping_appserver_appid = 3; - } \ No newline at end of file + // Only used when secure TLS bootstrapping is enabled. This is the appserver appid that the node will use to bootstrap. + string custom_secure_tls_bootstrapping_appserver_appid = 3; +} \ No newline at end of file From 2906ae1a60dbab949a85c5a0233fcda02589599c Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Wed, 10 Apr 2024 15:23:36 -0700 Subject: [PATCH 05/20] remove optional from disable_outbound_snat --- pkg/proto/nbcontract/v1/clusterconfig.pb.go | 60 ++++++++++----------- pkg/proto/nbcontract/v1/clusterconfig.proto | 2 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/pkg/proto/nbcontract/v1/clusterconfig.pb.go b/pkg/proto/nbcontract/v1/clusterconfig.pb.go index 438ae620893..1a95237d7b8 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.pb.go +++ b/pkg/proto/nbcontract/v1/clusterconfig.pb.go @@ -326,7 +326,7 @@ type LoadBalancerConfig struct { // Maximum number of load balancer rules, default to 148 MaxLoadBalancerRuleCount *int32 `protobuf:"varint,3,opt,name=max_load_balancer_rule_count,json=maxLoadBalancerRuleCount,proto3,oneof" json:"max_load_balancer_rule_count,omitempty"` // Disable outbound SNAT (Source Network Address Translation) for load balancer, default to false - DisableOutboundSnat *bool `protobuf:"varint,4,opt,name=disable_outbound_snat,json=disableOutboundSnat,proto3,oneof" json:"disable_outbound_snat,omitempty"` + DisableOutboundSnat bool `protobuf:"varint,4,opt,name=disable_outbound_snat,json=disableOutboundSnat,proto3" json:"disable_outbound_snat,omitempty"` } func (x *LoadBalancerConfig) Reset() { @@ -383,8 +383,8 @@ func (x *LoadBalancerConfig) GetMaxLoadBalancerRuleCount() int32 { } func (x *LoadBalancerConfig) GetDisableOutboundSnat() bool { - if x != nil && x.DisableOutboundSnat != nil { - return *x.DisableOutboundSnat + if x != nil { + return x.DisableOutboundSnat } return false } @@ -441,7 +441,7 @@ var file_pkg_proto_nbcontract_v1_clusterconfig_proto_rawDesc = []byte{ 0x11, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x22, 0xf8, 0x03, 0x0a, 0x12, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x22, 0xd9, 0x03, 0x0a, 0x12, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5d, 0x0a, 0x11, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x73, 0x6b, 0x75, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x31, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, @@ -458,34 +458,32 @@ var file_pkg_proto_nbcontract_v1_clusterconfig_proto_rawDesc = []byte{ 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x18, 0x6d, 0x61, 0x78, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x37, + 0x65, 0x72, 0x52, 0x75, 0x6c, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, 0x15, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, - 0x6e, 0x64, 0x5f, 0x73, 0x6e, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, - 0x13, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, - 0x53, 0x6e, 0x61, 0x74, 0x88, 0x01, 0x01, 0x22, 0x3b, 0x0a, 0x0f, 0x4c, 0x6f, 0x61, 0x64, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x53, 0x6b, 0x75, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x42, - 0x41, 0x53, 0x49, 0x43, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, - 0x52, 0x44, 0x10, 0x02, 0x42, 0x2d, 0x0a, 0x2b, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x5f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x73, 0x74, 0x61, - 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x72, 0x42, 0x1f, 0x0a, 0x1d, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x6f, 0x61, 0x64, - 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x18, 0x0a, 0x16, 0x5f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x6e, 0x61, 0x74, 0x42, 0xbe, - 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x2e, 0x76, 0x31, 0x42, 0x12, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, - 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, - 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, - 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x64, 0x5f, 0x73, 0x6e, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x64, + 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x6e, + 0x61, 0x74, 0x22, 0x3b, 0x0a, 0x0f, 0x4c, 0x6f, 0x61, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x72, 0x53, 0x6b, 0x75, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, + 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x02, 0x42, + 0x2d, 0x0a, 0x2b, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x74, + 0x65, 0x72, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, + 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x72, 0x42, 0x1f, + 0x0a, 0x1d, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x72, 0x5f, 0x72, 0x75, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, + 0xbe, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x12, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, + 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, + 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, + 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/proto/nbcontract/v1/clusterconfig.proto b/pkg/proto/nbcontract/v1/clusterconfig.proto index 80cb25d598a..a18a0bfc2f8 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.proto +++ b/pkg/proto/nbcontract/v1/clusterconfig.proto @@ -62,7 +62,7 @@ message LoadBalancerConfig { optional int32 max_load_balancer_rule_count = 3; // Disable outbound SNAT (Source Network Address Translation) for load balancer, default to false - optional bool disable_outbound_snat = 4; + bool disable_outbound_snat = 4; enum LoadBalancerSku { UNSPECIFIED = 0; From d37c16b7c537cf2e2d9e82cf50c7e81d2134a1db Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Mon, 15 Apr 2024 14:09:05 -0700 Subject: [PATCH 06/20] Rename CustomSearchDomain to CustomSearchDomainConfig --- pkg/proto/nbcontract/v1/config.pb.go | 150 +++++++++--------- pkg/proto/nbcontract/v1/config.proto | 2 +- .../v1/customsearchdomainconfig.pb.go | 89 +++++------ .../v1/customsearchdomainconfig.proto | 8 +- 4 files changed, 122 insertions(+), 127 deletions(-) diff --git a/pkg/proto/nbcontract/v1/config.pb.go b/pkg/proto/nbcontract/v1/config.pb.go index 701437ec2b4..8d1f9347f75 100644 --- a/pkg/proto/nbcontract/v1/config.pb.go +++ b/pkg/proto/nbcontract/v1/config.pb.go @@ -131,7 +131,7 @@ type Configuration struct { // specifies whether to ensure no duplicate promiscuous bridge EnsureNoDupePromiscuousBridge bool `protobuf:"varint,28,opt,name=ensure_no_dupe_promiscuous_bridge,json=ensureNoDupePromiscuousBridge,proto3" json:"ensure_no_dupe_promiscuous_bridge,omitempty"` // Custom search domain configurations - CustomSearchDomain *CustomSearchDomain `protobuf:"bytes,29,opt,name=custom_search_domain,json=customSearchDomain,proto3" json:"custom_search_domain,omitempty"` + CustomSearchDomainConfig *CustomSearchDomainConfig `protobuf:"bytes,29,opt,name=custom_search_domain_config,json=customSearchDomainConfig,proto3" json:"custom_search_domain_config,omitempty"` // Custom Linux OS configurations including SwapFile, SysCtl configs, etc. CustomLinuxOsConfig *CustomLinuxOSConfig `protobuf:"bytes,30,opt,name=custom_linux_os_config,json=customLinuxOsConfig,proto3" json:"custom_linux_os_config,omitempty"` // Azure private registry server URI @@ -379,9 +379,9 @@ func (x *Configuration) GetEnsureNoDupePromiscuousBridge() bool { return false } -func (x *Configuration) GetCustomSearchDomain() *CustomSearchDomain { +func (x *Configuration) GetCustomSearchDomainConfig() *CustomSearchDomainConfig { if x != nil { - return x.CustomSearchDomain + return x.CustomSearchDomainConfig } return nil } @@ -492,7 +492,7 @@ var file_pkg_proto_nbcontract_v1_config_proto_rawDesc = []byte{ 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf9, 0x10, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, + 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x11, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x6b, 0x75, 0x62, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x65, @@ -593,58 +593,60 @@ var file_pkg_proto_nbcontract_v1_config_proto_rawDesc = []byte{ 0x75, 0x6f, 0x75, 0x73, 0x5f, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1d, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x4e, 0x6f, 0x44, 0x75, 0x70, 0x65, 0x50, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x63, 0x75, 0x6f, 0x75, 0x73, 0x42, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x12, 0x53, 0x0a, 0x14, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x57, 0x0a, 0x16, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, - 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x69, 0x6e, 0x75, - 0x78, 0x4f, 0x53, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, - 0x0a, 0x1d, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, - 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x50, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x3f, 0x0a, 0x1c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x67, 0x72, - 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x74, - 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, - 0x21, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x72, 0x74, - 0x69, 0x66, 0x61, 0x63, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x17, - 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6b, 0x61, 0x74, 0x61, 0x18, 0x22, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x69, 0x73, 0x4b, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, 0x65, 0x64, 0x73, - 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x18, 0x23, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x12, 0x4a, - 0x0a, 0x11, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x50, 0x72, - 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, 0x68, 0x74, 0x74, 0x70, 0x50, - 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, 0x0a, 0x67, 0x70, - 0x75, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x25, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x50, 0x55, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x67, 0x70, 0x75, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2a, 0x47, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x57, 0x52, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x43, - 0x49, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0d, 0x0a, - 0x09, 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x57, 0x41, 0x53, 0x49, 0x10, 0x02, 0x42, 0xb7, 0x01, 0x0a, - 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, - 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, 0x7a, - 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, 0x70, - 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x12, 0x66, 0x0a, 0x1b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, + 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x18, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x57, 0x0a, 0x16, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x6c, 0x69, 0x6e, 0x75, 0x78, 0x5f, 0x6f, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, + 0x69, 0x6e, 0x75, 0x78, 0x4f, 0x53, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x13, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x4f, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x12, 0x41, 0x0a, 0x1d, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, + 0x74, 0x65, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x50, + 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x1c, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, + 0x65, 0x67, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x20, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x70, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x65, 0x45, 0x67, 0x72, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, + 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, + 0x6e, 0x67, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x41, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, + 0x67, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6b, 0x61, 0x74, 0x61, 0x18, 0x22, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4b, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x65, + 0x65, 0x64, 0x73, 0x5f, 0x63, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, 0x32, 0x18, 0x23, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0d, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x43, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x76, + 0x32, 0x12, 0x4a, 0x0a, 0x11, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6e, + 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, + 0x50, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0f, 0x68, 0x74, + 0x74, 0x70, 0x50, 0x72, 0x6f, 0x78, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x37, 0x0a, + 0x0a, 0x67, 0x70, 0x75, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x25, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x50, 0x55, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x67, 0x70, 0x75, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2a, 0x47, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, + 0x61, 0x64, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x57, 0x52, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, + 0x0d, 0x4f, 0x43, 0x49, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x10, 0x01, + 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x57, 0x41, 0x53, 0x49, 0x10, 0x02, 0x42, + 0xb7, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, + 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, + 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, + 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, + 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -662,23 +664,23 @@ func file_pkg_proto_nbcontract_v1_config_proto_rawDescGZIP() []byte { var file_pkg_proto_nbcontract_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_pkg_proto_nbcontract_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_pkg_proto_nbcontract_v1_config_proto_goTypes = []interface{}{ - (WorkloadRuntime)(0), // 0: nbcontract.v1.WorkloadRuntime - (*Configuration)(nil), // 1: nbcontract.v1.Configuration - (*TLSBootstrappingConfig)(nil), // 2: nbcontract.v1.TLSBootstrappingConfig - (*KubeBinaryConfig)(nil), // 3: nbcontract.v1.KubeBinaryConfig - (*CustomCloudConfig)(nil), // 4: nbcontract.v1.CustomCloudConfig - (*ApiServerConfig)(nil), // 5: nbcontract.v1.ApiServerConfig - (*ClusterConfig)(nil), // 6: nbcontract.v1.ClusterConfig - (*AuthConfig)(nil), // 7: nbcontract.v1.AuthConfig - (*RuncConfig)(nil), // 8: nbcontract.v1.RuncConfig - (*ContainerdConfig)(nil), // 9: nbcontract.v1.ContainerdConfig - (*NetworkConfig)(nil), // 10: nbcontract.v1.NetworkConfig - (*TeleportConfig)(nil), // 11: nbcontract.v1.TeleportConfig - (*KubeletConfig)(nil), // 12: nbcontract.v1.KubeletConfig - (*CustomSearchDomain)(nil), // 13: nbcontract.v1.CustomSearchDomain - (*CustomLinuxOSConfig)(nil), // 14: nbcontract.v1.CustomLinuxOSConfig - (*HTTPProxyConfig)(nil), // 15: nbcontract.v1.HTTPProxyConfig - (*GPUConfig)(nil), // 16: nbcontract.v1.GPUConfig + (WorkloadRuntime)(0), // 0: nbcontract.v1.WorkloadRuntime + (*Configuration)(nil), // 1: nbcontract.v1.Configuration + (*TLSBootstrappingConfig)(nil), // 2: nbcontract.v1.TLSBootstrappingConfig + (*KubeBinaryConfig)(nil), // 3: nbcontract.v1.KubeBinaryConfig + (*CustomCloudConfig)(nil), // 4: nbcontract.v1.CustomCloudConfig + (*ApiServerConfig)(nil), // 5: nbcontract.v1.ApiServerConfig + (*ClusterConfig)(nil), // 6: nbcontract.v1.ClusterConfig + (*AuthConfig)(nil), // 7: nbcontract.v1.AuthConfig + (*RuncConfig)(nil), // 8: nbcontract.v1.RuncConfig + (*ContainerdConfig)(nil), // 9: nbcontract.v1.ContainerdConfig + (*NetworkConfig)(nil), // 10: nbcontract.v1.NetworkConfig + (*TeleportConfig)(nil), // 11: nbcontract.v1.TeleportConfig + (*KubeletConfig)(nil), // 12: nbcontract.v1.KubeletConfig + (*CustomSearchDomainConfig)(nil), // 13: nbcontract.v1.CustomSearchDomainConfig + (*CustomLinuxOSConfig)(nil), // 14: nbcontract.v1.CustomLinuxOSConfig + (*HTTPProxyConfig)(nil), // 15: nbcontract.v1.HTTPProxyConfig + (*GPUConfig)(nil), // 16: nbcontract.v1.GPUConfig } var file_pkg_proto_nbcontract_v1_config_proto_depIdxs = []int32{ 2, // 0: nbcontract.v1.Configuration.tls_bootstrapping_config:type_name -> nbcontract.v1.TLSBootstrappingConfig @@ -693,7 +695,7 @@ var file_pkg_proto_nbcontract_v1_config_proto_depIdxs = []int32{ 11, // 9: nbcontract.v1.Configuration.teleport_config:type_name -> nbcontract.v1.TeleportConfig 12, // 10: nbcontract.v1.Configuration.kubelet_config:type_name -> nbcontract.v1.KubeletConfig 0, // 11: nbcontract.v1.Configuration.workload_runtime:type_name -> nbcontract.v1.WorkloadRuntime - 13, // 12: nbcontract.v1.Configuration.custom_search_domain:type_name -> nbcontract.v1.CustomSearchDomain + 13, // 12: nbcontract.v1.Configuration.custom_search_domain_config:type_name -> nbcontract.v1.CustomSearchDomainConfig 14, // 13: nbcontract.v1.Configuration.custom_linux_os_config:type_name -> nbcontract.v1.CustomLinuxOSConfig 15, // 14: nbcontract.v1.Configuration.http_proxy_config:type_name -> nbcontract.v1.HTTPProxyConfig 16, // 15: nbcontract.v1.Configuration.gpu_config:type_name -> nbcontract.v1.GPUConfig diff --git a/pkg/proto/nbcontract/v1/config.proto b/pkg/proto/nbcontract/v1/config.proto index a098b1c5449..b25c1effd8f 100644 --- a/pkg/proto/nbcontract/v1/config.proto +++ b/pkg/proto/nbcontract/v1/config.proto @@ -110,7 +110,7 @@ message Configuration { bool ensure_no_dupe_promiscuous_bridge = 28; // Custom search domain configurations - CustomSearchDomain custom_search_domain = 29; + CustomSearchDomainConfig custom_search_domain_config = 29; // Custom Linux OS configurations including SwapFile, SysCtl configs, etc. CustomLinuxOSConfig custom_linux_os_config = 30; diff --git a/pkg/proto/nbcontract/v1/customsearchdomainconfig.pb.go b/pkg/proto/nbcontract/v1/customsearchdomainconfig.pb.go index 9524bad40b9..dad05857625 100644 --- a/pkg/proto/nbcontract/v1/customsearchdomainconfig.pb.go +++ b/pkg/proto/nbcontract/v1/customsearchdomainconfig.pb.go @@ -20,21 +20,21 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type CustomSearchDomain struct { +type CustomSearchDomainConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name of the custom search domain. - CustomSearchDomainName string `protobuf:"bytes,1,opt,name=custom_search_domain_name,json=customSearchDomainName,proto3" json:"custom_search_domain_name,omitempty"` + DomainName string `protobuf:"bytes,1,opt,name=domain_name,json=domainName,proto3" json:"domain_name,omitempty"` // The user name for the custom search domain. - CustomSearchDomainRealmUser string `protobuf:"bytes,2,opt,name=custom_search_domain_realm_user,json=customSearchDomainRealmUser,proto3" json:"custom_search_domain_realm_user,omitempty"` + RealmUser string `protobuf:"bytes,2,opt,name=realm_user,json=realmUser,proto3" json:"realm_user,omitempty"` // The password for the custom search domain. - CustomSearchDomainRealmPassword string `protobuf:"bytes,3,opt,name=custom_search_domain_realm_password,json=customSearchDomainRealmPassword,proto3" json:"custom_search_domain_realm_password,omitempty"` + RealmPassword string `protobuf:"bytes,3,opt,name=realm_password,json=realmPassword,proto3" json:"realm_password,omitempty"` } -func (x *CustomSearchDomain) Reset() { - *x = CustomSearchDomain{} +func (x *CustomSearchDomainConfig) Reset() { + *x = CustomSearchDomainConfig{} if protoimpl.UnsafeEnabled { mi := &file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -42,13 +42,13 @@ func (x *CustomSearchDomain) Reset() { } } -func (x *CustomSearchDomain) String() string { +func (x *CustomSearchDomainConfig) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CustomSearchDomain) ProtoMessage() {} +func (*CustomSearchDomainConfig) ProtoMessage() {} -func (x *CustomSearchDomain) ProtoReflect() protoreflect.Message { +func (x *CustomSearchDomainConfig) ProtoReflect() protoreflect.Message { mi := &file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -60,28 +60,28 @@ func (x *CustomSearchDomain) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CustomSearchDomain.ProtoReflect.Descriptor instead. -func (*CustomSearchDomain) Descriptor() ([]byte, []int) { +// Deprecated: Use CustomSearchDomainConfig.ProtoReflect.Descriptor instead. +func (*CustomSearchDomainConfig) Descriptor() ([]byte, []int) { return file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_rawDescGZIP(), []int{0} } -func (x *CustomSearchDomain) GetCustomSearchDomainName() string { +func (x *CustomSearchDomainConfig) GetDomainName() string { if x != nil { - return x.CustomSearchDomainName + return x.DomainName } return "" } -func (x *CustomSearchDomain) GetCustomSearchDomainRealmUser() string { +func (x *CustomSearchDomainConfig) GetRealmUser() string { if x != nil { - return x.CustomSearchDomainRealmUser + return x.RealmUser } return "" } -func (x *CustomSearchDomain) GetCustomSearchDomainRealmPassword() string { +func (x *CustomSearchDomainConfig) GetRealmPassword() string { if x != nil { - return x.CustomSearchDomainRealmPassword + return x.RealmPassword } return "" } @@ -93,35 +93,28 @@ var file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_rawDesc = []byte 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x22, 0xe3, 0x01, 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x39, - 0x0a, 0x19, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, - 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x16, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x1f, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x1b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x4c, 0x0a, 0x23, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1f, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, - 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0xc9, 0x01, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x2e, 0x76, 0x31, 0x42, 0x1d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, - 0x72, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, - 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, - 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, - 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x22, 0x81, 0x01, 0x0a, 0x18, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1f, 0x0a, 0x0b, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x61, 0x6c, 0x6d, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, + 0x61, 0x6c, 0x6d, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0xc9, 0x01, 0x0a, 0x11, + 0x63, 0x6f, 0x6d, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, + 0x31, 0x42, 0x1d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x64, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x50, 0x01, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x41, + 0x7a, 0x75, 0x72, 0x65, 0x2f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x6b, 0x65, 0x72, 0x2f, + 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4e, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4e, 0x62, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -138,7 +131,7 @@ func file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_rawDescGZIP() [ var file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_goTypes = []interface{}{ - (*CustomSearchDomain)(nil), // 0: nbcontract.v1.CustomSearchDomain + (*CustomSearchDomainConfig)(nil), // 0: nbcontract.v1.CustomSearchDomainConfig } var file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -155,7 +148,7 @@ func file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_init() { } if !protoimpl.UnsafeEnabled { file_pkg_proto_nbcontract_v1_customsearchdomainconfig_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CustomSearchDomain); i { + switch v := v.(*CustomSearchDomainConfig); i { case 0: return &v.state case 1: diff --git a/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto b/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto index 920ff4e9e4c..26a8ac18913 100644 --- a/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto +++ b/pkg/proto/nbcontract/v1/customsearchdomainconfig.proto @@ -1,13 +1,13 @@ syntax = "proto3"; package nbcontract.v1; -message CustomSearchDomain { +message CustomSearchDomainConfig { // The name of the custom search domain. - string custom_search_domain_name = 1; + string domain_name = 1; // The user name for the custom search domain. - string custom_search_domain_realm_user = 2; + string realm_user = 2; // The password for the custom search domain. - string custom_search_domain_realm_password = 3; + string realm_password = 3; } \ No newline at end of file From aeff7e6749bfad61b26d67fc5eea8183f8c15d44 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Mon, 15 Apr 2024 18:31:09 -0700 Subject: [PATCH 07/20] Add NewNBContractConfiguration in utlities --- go.mod | 31 +++++++++++-- go.sum | 57 +++++++++++++++++++++++ pkg/parser/cse_cmd.sh.gtpl | 1 - pkg/parser/utilities.go | 36 +++++++++++++++ pkg/parser/utilities_test.go | 90 ++++++++++++++++++++++++++++++++++++ 5 files changed, 210 insertions(+), 5 deletions(-) create mode 100644 pkg/parser/utilities_test.go diff --git a/go.mod b/go.mod index daeaf6a8250..b3fbd7bf3e7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/Azure/agentbaker -go 1.18 +go 1.21 + +toolchain go1.21.6 require ( github.com/Azure/go-autorest/autorest/to v0.4.0 @@ -13,8 +15,8 @@ require ( github.com/onsi/ginkgo v1.12.2 github.com/onsi/gomega v1.27.2 github.com/pkg/errors v0.9.1 - github.com/spf13/cobra v1.6.1 - github.com/stretchr/testify v1.8.0 + github.com/spf13/cobra v1.7.0 + github.com/stretchr/testify v1.8.4 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/apimachinery v0.26.2 @@ -22,15 +24,36 @@ require ( require ( github.com/Azure/go-autorest v14.2.0+incompatible // indirect + github.com/cilium/ebpf v0.11.0 // indirect + github.com/cosiner/argv v0.1.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/cweill/gotests v1.6.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/go-delve/delve v1.22.1 // indirect + github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 // indirect + github.com/google/go-dap v0.11.0 // indirect + github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.13 // indirect github.com/nxadm/tail v1.4.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rivo/uniseg v0.2.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect + go.starlark.net v0.0.0-20231101134539-556fd59b42f6 // indirect + golang.org/x/arch v0.6.0 // indirect + golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.14.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index af72e728b65..9debb061e82 100644 --- a/go.sum +++ b/go.sum @@ -8,15 +8,28 @@ github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLo github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df/go.mod h1:hiVxq5OP2bUGBRNS3Z/bt/reCLFNbdcST6gISi1fiOM= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y= +github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUgWsVs= +github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg= +github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= +github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cweill/gotests v1.6.0 h1:KJx+/p4EweijYzqPb4Y/8umDCip1Cv6hEVyOx0mE9W8= +github.com/cweill/gotests v1.6.0/go.mod h1:CaRYbxQZGQOxXDvM9l0XJVV2Tjb2E5H53vq+reR2GrA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d h1:hUWoLdw5kvo2xCsqlsIBMvWUc1QCSsCYD2J2+Fg6YoU= +github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d/go.mod h1:C7Es+DLenIpPc9J6IYw4jrK0h7S9bKj4DNl8+KxGEXU= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/go-delve/delve v1.22.1 h1:LQSF2sv+lP3mmOzMkadl5HGQGgSS2bFg2tbyALqHu8Y= +github.com/go-delve/delve v1.22.1/go.mod h1:TfOb+G5H6YYKheZYAmA59ojoHbOimGfs5trbghHdLbM= +github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 h1:IGtvsNyIuRjl04XAOFGACozgUD7A82UffYxZt4DWbvA= +github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62/go.mod h1:biJCRbqp51wS+I92HMqn5H8/A0PAhxn2vyOT+JqhiGI= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -34,15 +47,29 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-dap v0.11.0 h1:SpAZJL41rOOvd85PuLCCLE1dteTQOyKNnn0H3DBHywo= +github.com/google/go-dap v0.11.0/go.mod h1:HAeyoSd2WIfTfg+0GRXcFrb+RnojAtGNh+k+XTIxJDE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= +github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -59,22 +86,42 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +go.starlark.net v0.0.0-20231101134539-556fd59b42f6 h1:+eC0F/k4aBLC4szgOcjd7bDTEnpxADJyWJE0yowgM3E= +go.starlark.net v0.0.0-20231101134539-556fd59b42f6/go.mod h1:LcLNIzVOMp4oV+uusnpk+VU+SzXaJakUuBjoCSWH5dM= +golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc= +golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= +golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -82,6 +129,10 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -89,7 +140,11 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -107,6 +162,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/parser/cse_cmd.sh.gtpl b/pkg/parser/cse_cmd.sh.gtpl index 6ee74043056..0fb0096a2a9 100644 --- a/pkg/parser/cse_cmd.sh.gtpl +++ b/pkg/parser/cse_cmd.sh.gtpl @@ -12,5 +12,4 @@ KUBE_BINARY_URL="{{.KubeBinaryUrl}}" CUSTOM_KUBE_BINARY_URL="{{.CustomKubeBinaryUrl}}" KUBEPROXY_URL="{{.KubeproxyUrl}}" -DISABLE_SSH="{{getInverseBoolStr .SshStatus}}" IS_CUSTOM_CLOUD={{.CustomCloudConfig.IsCustomCloud}} \ No newline at end of file diff --git a/pkg/parser/utilities.go b/pkg/parser/utilities.go index ef3ac95c65d..977a99efd1e 100644 --- a/pkg/parser/utilities.go +++ b/pkg/parser/utilities.go @@ -24,3 +24,39 @@ func getBaseTemplate() *nbcontractv1.Configuration { func getFuncMap() template.FuncMap { return template.FuncMap{} } + +// Check and initialize each field if it is nil +func initializeIfNil[T any](field **T) { + if *field == nil { + *field = new(T) + } +} + +// EnsureConfigsNonNil checks if the config is nil and initializes it if it is. +func ensureConfigsNonNil(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { + if v == nil { + v = &nbcontractv1.Configuration{} + } + + initializeIfNil(&v.KubeBinaryConfig) + initializeIfNil(&v.ApiServerConfig) + initializeIfNil(&v.AuthConfig) + initializeIfNil(&v.ClusterConfig) + initializeIfNil(&v.NetworkConfig) + initializeIfNil(&v.GpuConfig) + initializeIfNil(&v.TlsBootstrappingConfig) + initializeIfNil(&v.KubeletConfig) + initializeIfNil(&v.RuncConfig) + initializeIfNil(&v.ContainerdConfig) + initializeIfNil(&v.TeleportConfig) + initializeIfNil(&v.CustomLinuxOsConfig) + initializeIfNil(&v.HttpProxyConfig) + initializeIfNil(&v.CustomCloudConfig) + initializeIfNil(&v.CustomSearchDomainConfig) + + return v +} + +func NewNBContractConfiguration(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { + return ensureConfigsNonNil(v) +} diff --git a/pkg/parser/utilities_test.go b/pkg/parser/utilities_test.go new file mode 100644 index 00000000000..3e200c3d6c2 --- /dev/null +++ b/pkg/parser/utilities_test.go @@ -0,0 +1,90 @@ +package parser + +import ( + "reflect" + "testing" + + nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" +) + +func Test_ensureConfigsNonNil(t *testing.T) { + type args struct { + v *nbcontractv1.Configuration + } + wantedResult := &nbcontractv1.Configuration{ + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + ApiServerConfig: &nbcontractv1.ApiServerConfig{}, + AuthConfig: &nbcontractv1.AuthConfig{}, + ClusterConfig: &nbcontractv1.ClusterConfig{}, + NetworkConfig: &nbcontractv1.NetworkConfig{}, + GpuConfig: &nbcontractv1.GPUConfig{}, + TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, + KubeletConfig: &nbcontractv1.KubeletConfig{}, + RuncConfig: &nbcontractv1.RuncConfig{}, + ContainerdConfig: &nbcontractv1.ContainerdConfig{}, + TeleportConfig: &nbcontractv1.TeleportConfig{}, + CustomLinuxOsConfig: &nbcontractv1.CustomLinuxOSConfig{}, + HttpProxyConfig: &nbcontractv1.HTTPProxyConfig{}, + CustomCloudConfig: &nbcontractv1.CustomCloudConfig{}, + CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, + } + tests := []struct { + name string + args args + want *nbcontractv1.Configuration + }{ + { + name: "Test with nil configuration", + args: args{ + v: nil, + }, + want: wantedResult, + }, + { + name: "Test with non-nil configuration and all nil Configs", + args: args{ + v: &nbcontractv1.Configuration{}, + }, + want: wantedResult, + }, + { + name: "Test with non-nil configuration and partially nil Configs", + args: args{ + v: &nbcontractv1.Configuration{ + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + }, + }, + want: wantedResult, + }, + { + name: "Test with non-nil configuration and all non-nil Configs", + args: args{ + v: &nbcontractv1.Configuration{ + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + ApiServerConfig: &nbcontractv1.ApiServerConfig{}, + AuthConfig: &nbcontractv1.AuthConfig{}, + ClusterConfig: &nbcontractv1.ClusterConfig{}, + NetworkConfig: &nbcontractv1.NetworkConfig{}, + GpuConfig: &nbcontractv1.GPUConfig{}, + TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, + KubeletConfig: &nbcontractv1.KubeletConfig{}, + RuncConfig: &nbcontractv1.RuncConfig{}, + ContainerdConfig: &nbcontractv1.ContainerdConfig{}, + TeleportConfig: &nbcontractv1.TeleportConfig{}, + CustomLinuxOsConfig: &nbcontractv1.CustomLinuxOSConfig{}, + HttpProxyConfig: &nbcontractv1.HTTPProxyConfig{}, + CustomCloudConfig: &nbcontractv1.CustomCloudConfig{}, + CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, + }, + }, + want: wantedResult, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := ensureConfigsNonNil(tt.args.v); !reflect.DeepEqual(got, tt.want) { + t.Errorf("ensureConfigsNonNil() = %v, want %v", got, tt.want) + } + }) + } +} From 8ffdab4579b5b99dbd508abcdc6afadff51eb2bb Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Mon, 15 Apr 2024 18:37:52 -0700 Subject: [PATCH 08/20] move NewNBContractConfiguration to nbcontracthelper package --- pkg/nbcontracthelper/helper.go | 40 +++++++++++++++++-- .../helper_test.go} | 8 ++-- pkg/parser/utilities.go | 36 ----------------- 3 files changed, 40 insertions(+), 44 deletions(-) rename pkg/{parser/utilities_test.go => nbcontracthelper/helper_test.go} (92%) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index d638d1b420c..265dc421737 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -1,9 +1,41 @@ package nbcontracthelper -const ( - defaultLinuxUser = "azureuser" +import ( + nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) -func GetDefaultLinuxAdminUsername() string { - return defaultLinuxUser +// Check and initialize each field if it is nil +func initializeIfNil[T any](field **T) { + if *field == nil { + *field = new(T) + } +} + +// EnsureConfigsNonNil checks if the config is nil and initializes it if it is. +func ensureConfigsNonNil(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { + if v == nil { + v = &nbcontractv1.Configuration{} + } + + initializeIfNil(&v.KubeBinaryConfig) + initializeIfNil(&v.ApiServerConfig) + initializeIfNil(&v.AuthConfig) + initializeIfNil(&v.ClusterConfig) + initializeIfNil(&v.NetworkConfig) + initializeIfNil(&v.GpuConfig) + initializeIfNil(&v.TlsBootstrappingConfig) + initializeIfNil(&v.KubeletConfig) + initializeIfNil(&v.RuncConfig) + initializeIfNil(&v.ContainerdConfig) + initializeIfNil(&v.TeleportConfig) + initializeIfNil(&v.CustomLinuxOsConfig) + initializeIfNil(&v.HttpProxyConfig) + initializeIfNil(&v.CustomCloudConfig) + initializeIfNil(&v.CustomSearchDomainConfig) + + return v +} + +func NewNBContractConfiguration(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { + return ensureConfigsNonNil(v) } diff --git a/pkg/parser/utilities_test.go b/pkg/nbcontracthelper/helper_test.go similarity index 92% rename from pkg/parser/utilities_test.go rename to pkg/nbcontracthelper/helper_test.go index 3e200c3d6c2..e3d29a2dca1 100644 --- a/pkg/parser/utilities_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -1,4 +1,4 @@ -package parser +package nbcontracthelper import ( "reflect" @@ -7,7 +7,7 @@ import ( nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) -func Test_ensureConfigsNonNil(t *testing.T) { +func TestNewNBContractConfiguration(t *testing.T) { type args struct { v *nbcontractv1.Configuration } @@ -82,8 +82,8 @@ func Test_ensureConfigsNonNil(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := ensureConfigsNonNil(tt.args.v); !reflect.DeepEqual(got, tt.want) { - t.Errorf("ensureConfigsNonNil() = %v, want %v", got, tt.want) + if got := NewNBContractConfiguration(tt.args.v); !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewNBContractConfiguration() = %v, want %v", got, tt.want) } }) } diff --git a/pkg/parser/utilities.go b/pkg/parser/utilities.go index 977a99efd1e..ef3ac95c65d 100644 --- a/pkg/parser/utilities.go +++ b/pkg/parser/utilities.go @@ -24,39 +24,3 @@ func getBaseTemplate() *nbcontractv1.Configuration { func getFuncMap() template.FuncMap { return template.FuncMap{} } - -// Check and initialize each field if it is nil -func initializeIfNil[T any](field **T) { - if *field == nil { - *field = new(T) - } -} - -// EnsureConfigsNonNil checks if the config is nil and initializes it if it is. -func ensureConfigsNonNil(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { - if v == nil { - v = &nbcontractv1.Configuration{} - } - - initializeIfNil(&v.KubeBinaryConfig) - initializeIfNil(&v.ApiServerConfig) - initializeIfNil(&v.AuthConfig) - initializeIfNil(&v.ClusterConfig) - initializeIfNil(&v.NetworkConfig) - initializeIfNil(&v.GpuConfig) - initializeIfNil(&v.TlsBootstrappingConfig) - initializeIfNil(&v.KubeletConfig) - initializeIfNil(&v.RuncConfig) - initializeIfNil(&v.ContainerdConfig) - initializeIfNil(&v.TeleportConfig) - initializeIfNil(&v.CustomLinuxOsConfig) - initializeIfNil(&v.HttpProxyConfig) - initializeIfNil(&v.CustomCloudConfig) - initializeIfNil(&v.CustomSearchDomainConfig) - - return v -} - -func NewNBContractConfiguration(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { - return ensureConfigsNonNil(v) -} From 3bcb719122f30409fd4e2c37587684dbb4f89ba3 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Mon, 15 Apr 2024 22:06:55 -0700 Subject: [PATCH 09/20] add comment --- pkg/nbcontracthelper/helper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index 265dc421737..cdb35aac598 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -36,6 +36,8 @@ func ensureConfigsNonNil(v *nbcontractv1.Configuration) *nbcontractv1.Configurat return v } +// Creates a new instance of nbcontractv1.Configuration and ensures that +// all fields are non-nil unless it's set as proto3 explicit presence (with label optional). func NewNBContractConfiguration(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { return ensureConfigsNonNil(v) } From 6ff557886c96f9a2f3959cc14ee36446debe411a Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 11:48:25 -0700 Subject: [PATCH 10/20] Refactor NBContractConfig initialization and configuration handling --- pkg/nbcontracthelper/helper.go | 81 ++++++++++++++++-------- pkg/nbcontracthelper/helper_test.go | 95 ++++++++++++++++++----------- 2 files changed, 116 insertions(+), 60 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index cdb35aac598..6edcd403839 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -4,6 +4,11 @@ import ( nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) +type NBContractConfig struct { + // NBContractConfiguration is the configuration object for the NBContract (Node Bootstrap Contract) + nBContractConfiguration *nbcontractv1.Configuration +} + // Check and initialize each field if it is nil func initializeIfNil[T any](field **T) { if *field == nil { @@ -11,33 +16,59 @@ func initializeIfNil[T any](field **T) { } } -// EnsureConfigsNonNil checks if the config is nil and initializes it if it is. -func ensureConfigsNonNil(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { - if v == nil { - v = &nbcontractv1.Configuration{} - } +// Ensure all objects are non-nil. Please add new objects here. +func (nbcc *NBContractConfig) ensureConfigsNonNil() { + initializeIfNil(&nbcc.nBContractConfiguration.KubeBinaryConfig) + initializeIfNil(&nbcc.nBContractConfiguration.ApiServerConfig) + initializeIfNil(&nbcc.nBContractConfiguration.AuthConfig) + initializeIfNil(&nbcc.nBContractConfiguration.ClusterConfig) + initializeIfNil(&nbcc.nBContractConfiguration.NetworkConfig) + initializeIfNil(&nbcc.nBContractConfiguration.GpuConfig) + initializeIfNil(&nbcc.nBContractConfiguration.TlsBootstrappingConfig) + initializeIfNil(&nbcc.nBContractConfiguration.KubeletConfig) + initializeIfNil(&nbcc.nBContractConfiguration.RuncConfig) + initializeIfNil(&nbcc.nBContractConfiguration.ContainerdConfig) + initializeIfNil(&nbcc.nBContractConfiguration.TeleportConfig) + initializeIfNil(&nbcc.nBContractConfiguration.CustomLinuxOsConfig) + initializeIfNil(&nbcc.nBContractConfiguration.HttpProxyConfig) + initializeIfNil(&nbcc.nBContractConfiguration.CustomCloudConfig) + initializeIfNil(&nbcc.nBContractConfiguration.CustomSearchDomainConfig) +} - initializeIfNil(&v.KubeBinaryConfig) - initializeIfNil(&v.ApiServerConfig) - initializeIfNil(&v.AuthConfig) - initializeIfNil(&v.ClusterConfig) - initializeIfNil(&v.NetworkConfig) - initializeIfNil(&v.GpuConfig) - initializeIfNil(&v.TlsBootstrappingConfig) - initializeIfNil(&v.KubeletConfig) - initializeIfNil(&v.RuncConfig) - initializeIfNil(&v.ContainerdConfig) - initializeIfNil(&v.TeleportConfig) - initializeIfNil(&v.CustomLinuxOsConfig) - initializeIfNil(&v.HttpProxyConfig) - initializeIfNil(&v.CustomCloudConfig) - initializeIfNil(&v.CustomSearchDomainConfig) +// Creates a new instance of NBContractConfig and ensures all objects are non-nil +func NewNBContractConfiguration() *NBContractConfig { + nbcc := &NBContractConfig{ + nBContractConfiguration: &nbcontractv1.Configuration{ + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + ApiServerConfig: &nbcontractv1.ApiServerConfig{}, + AuthConfig: &nbcontractv1.AuthConfig{}, + ClusterConfig: &nbcontractv1.ClusterConfig{}, + NetworkConfig: &nbcontractv1.NetworkConfig{}, + GpuConfig: &nbcontractv1.GPUConfig{}, + TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, + KubeletConfig: &nbcontractv1.KubeletConfig{}, + RuncConfig: &nbcontractv1.RuncConfig{}, + ContainerdConfig: &nbcontractv1.ContainerdConfig{}, + TeleportConfig: &nbcontractv1.TeleportConfig{}, + CustomLinuxOsConfig: &nbcontractv1.CustomLinuxOSConfig{}, + HttpProxyConfig: &nbcontractv1.HTTPProxyConfig{}, + CustomCloudConfig: &nbcontractv1.CustomCloudConfig{}, + CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, + }, + } + return nbcc +} - return v +// Apply the configuration to the NBContractConfig nbContractConfiguration object +func (nbcc *NBContractConfig) ApplyConfiguration(config *nbcontractv1.Configuration) { + if config == nil { + return + } + nbcc.nBContractConfiguration = config + nbcc.ensureConfigsNonNil() } -// Creates a new instance of nbcontractv1.Configuration and ensures that -// all fields are non-nil unless it's set as proto3 explicit presence (with label optional). -func NewNBContractConfiguration(v *nbcontractv1.Configuration) *nbcontractv1.Configuration { - return ensureConfigsNonNil(v) +// Get the NBContractConfiguration object +func (nbcc *NBContractConfig) GetNBContractConfiguration() *nbcontractv1.Configuration { + return nbcc.nBContractConfiguration } diff --git a/pkg/nbcontracthelper/helper_test.go b/pkg/nbcontracthelper/helper_test.go index e3d29a2dca1..6dfc9905424 100644 --- a/pkg/nbcontracthelper/helper_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -8,9 +8,6 @@ import ( ) func TestNewNBContractConfiguration(t *testing.T) { - type args struct { - v *nbcontractv1.Configuration - } wantedResult := &nbcontractv1.Configuration{ KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, ApiServerConfig: &nbcontractv1.ApiServerConfig{}, @@ -30,60 +27,88 @@ func TestNewNBContractConfiguration(t *testing.T) { } tests := []struct { name string - args args want *nbcontractv1.Configuration }{ { name: "Test with nil configuration", - args: args{ - v: nil, - }, want: wantedResult, }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := NewNBContractConfiguration().nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewNBContractConfiguration() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestNBContractConfig_ApplyConfiguration(t *testing.T) { + type fields struct { + nBContractConfiguration *nbcontractv1.Configuration + } + wantedResult := &nbcontractv1.Configuration{ + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + ApiServerConfig: &nbcontractv1.ApiServerConfig{}, + AuthConfig: &nbcontractv1.AuthConfig{}, + ClusterConfig: &nbcontractv1.ClusterConfig{}, + NetworkConfig: &nbcontractv1.NetworkConfig{}, + GpuConfig: &nbcontractv1.GPUConfig{}, + TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, + KubeletConfig: &nbcontractv1.KubeletConfig{}, + RuncConfig: &nbcontractv1.RuncConfig{}, + ContainerdConfig: &nbcontractv1.ContainerdConfig{}, + TeleportConfig: &nbcontractv1.TeleportConfig{}, + CustomLinuxOsConfig: &nbcontractv1.CustomLinuxOSConfig{}, + HttpProxyConfig: &nbcontractv1.HTTPProxyConfig{}, + CustomCloudConfig: &nbcontractv1.CustomCloudConfig{}, + CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, + } + tests := []struct { + name string + fields fields + want *nbcontractv1.Configuration + }{ { - name: "Test with non-nil configuration and all nil Configs", - args: args{ - v: &nbcontractv1.Configuration{}, + name: "Test with nil configuration", + fields: fields{ + nBContractConfiguration: &nbcontractv1.Configuration{}, }, want: wantedResult, }, { - name: "Test with non-nil configuration and partially nil Configs", - args: args{ - v: &nbcontractv1.Configuration{ - KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + name: "Apply nil AuthConfig configuration and expect AuthConfig in nBContractConfiguration to be non-nil", + fields: fields{ + nBContractConfiguration: &nbcontractv1.Configuration{ + AuthConfig: nil, }, }, want: wantedResult, }, { - name: "Test with non-nil configuration and all non-nil Configs", - args: args{ - v: &nbcontractv1.Configuration{ - KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, - ApiServerConfig: &nbcontractv1.ApiServerConfig{}, - AuthConfig: &nbcontractv1.AuthConfig{}, - ClusterConfig: &nbcontractv1.ClusterConfig{}, - NetworkConfig: &nbcontractv1.NetworkConfig{}, - GpuConfig: &nbcontractv1.GPUConfig{}, - TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, - KubeletConfig: &nbcontractv1.KubeletConfig{}, - RuncConfig: &nbcontractv1.RuncConfig{}, - ContainerdConfig: &nbcontractv1.ContainerdConfig{}, - TeleportConfig: &nbcontractv1.TeleportConfig{}, - CustomLinuxOsConfig: &nbcontractv1.CustomLinuxOSConfig{}, - HttpProxyConfig: &nbcontractv1.HTTPProxyConfig{}, - CustomCloudConfig: &nbcontractv1.CustomCloudConfig{}, - CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, + name: "Apply some configurations and expect them to be applied", + fields: fields{ + nBContractConfiguration: &nbcontractv1.Configuration{ + AuthConfig: &nbcontractv1.AuthConfig{ + TargetCloud: "some-cloud", + }, + LinuxAdminUsername: "testuser", }, }, - want: wantedResult, + want: func() *nbcontractv1.Configuration { + tmpResult := NewNBContractConfiguration().nBContractConfiguration + tmpResult.AuthConfig.TargetCloud = "some-cloud" + tmpResult.LinuxAdminUsername = "testuser" + return tmpResult + }(), }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := NewNBContractConfiguration(tt.args.v); !reflect.DeepEqual(got, tt.want) { - t.Errorf("NewNBContractConfiguration() = %v, want %v", got, tt.want) + nbcc := NewNBContractConfiguration() + nbcc.ApplyConfiguration(tt.fields.nBContractConfiguration) + if got := nbcc.nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { + t.Errorf("ApplyConfiguration() = %v, want %v", got, tt.want) } }) } From c8982aedbdf8ea4515d7450dd313a41632611f50 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 11:58:51 -0700 Subject: [PATCH 11/20] rename to NBContractBuilder --- pkg/nbcontracthelper/helper.go | 50 ++++++++++++++--------------- pkg/nbcontracthelper/helper_test.go | 14 ++++---- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index 6edcd403839..628e7b16518 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -4,7 +4,7 @@ import ( nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) -type NBContractConfig struct { +type NBContractBuilder struct { // NBContractConfiguration is the configuration object for the NBContract (Node Bootstrap Contract) nBContractConfiguration *nbcontractv1.Configuration } @@ -17,27 +17,27 @@ func initializeIfNil[T any](field **T) { } // Ensure all objects are non-nil. Please add new objects here. -func (nbcc *NBContractConfig) ensureConfigsNonNil() { - initializeIfNil(&nbcc.nBContractConfiguration.KubeBinaryConfig) - initializeIfNil(&nbcc.nBContractConfiguration.ApiServerConfig) - initializeIfNil(&nbcc.nBContractConfiguration.AuthConfig) - initializeIfNil(&nbcc.nBContractConfiguration.ClusterConfig) - initializeIfNil(&nbcc.nBContractConfiguration.NetworkConfig) - initializeIfNil(&nbcc.nBContractConfiguration.GpuConfig) - initializeIfNil(&nbcc.nBContractConfiguration.TlsBootstrappingConfig) - initializeIfNil(&nbcc.nBContractConfiguration.KubeletConfig) - initializeIfNil(&nbcc.nBContractConfiguration.RuncConfig) - initializeIfNil(&nbcc.nBContractConfiguration.ContainerdConfig) - initializeIfNil(&nbcc.nBContractConfiguration.TeleportConfig) - initializeIfNil(&nbcc.nBContractConfiguration.CustomLinuxOsConfig) - initializeIfNil(&nbcc.nBContractConfiguration.HttpProxyConfig) - initializeIfNil(&nbcc.nBContractConfiguration.CustomCloudConfig) - initializeIfNil(&nbcc.nBContractConfiguration.CustomSearchDomainConfig) +func (nBCB *NBContractBuilder) ensureConfigsNonNil() { + initializeIfNil(&nBCB.nBContractConfiguration.KubeBinaryConfig) + initializeIfNil(&nBCB.nBContractConfiguration.ApiServerConfig) + initializeIfNil(&nBCB.nBContractConfiguration.AuthConfig) + initializeIfNil(&nBCB.nBContractConfiguration.ClusterConfig) + initializeIfNil(&nBCB.nBContractConfiguration.NetworkConfig) + initializeIfNil(&nBCB.nBContractConfiguration.GpuConfig) + initializeIfNil(&nBCB.nBContractConfiguration.TlsBootstrappingConfig) + initializeIfNil(&nBCB.nBContractConfiguration.KubeletConfig) + initializeIfNil(&nBCB.nBContractConfiguration.RuncConfig) + initializeIfNil(&nBCB.nBContractConfiguration.ContainerdConfig) + initializeIfNil(&nBCB.nBContractConfiguration.TeleportConfig) + initializeIfNil(&nBCB.nBContractConfiguration.CustomLinuxOsConfig) + initializeIfNil(&nBCB.nBContractConfiguration.HttpProxyConfig) + initializeIfNil(&nBCB.nBContractConfiguration.CustomCloudConfig) + initializeIfNil(&nBCB.nBContractConfiguration.CustomSearchDomainConfig) } // Creates a new instance of NBContractConfig and ensures all objects are non-nil -func NewNBContractConfiguration() *NBContractConfig { - nbcc := &NBContractConfig{ +func NewNBContractBuilder() *NBContractBuilder { + nBCB := &NBContractBuilder{ nBContractConfiguration: &nbcontractv1.Configuration{ KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, ApiServerConfig: &nbcontractv1.ApiServerConfig{}, @@ -56,19 +56,19 @@ func NewNBContractConfiguration() *NBContractConfig { CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, }, } - return nbcc + return nBCB } // Apply the configuration to the NBContractConfig nbContractConfiguration object -func (nbcc *NBContractConfig) ApplyConfiguration(config *nbcontractv1.Configuration) { +func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configuration) { if config == nil { return } - nbcc.nBContractConfiguration = config - nbcc.ensureConfigsNonNil() + nBCB.nBContractConfiguration = config + nBCB.ensureConfigsNonNil() } // Get the NBContractConfiguration object -func (nbcc *NBContractConfig) GetNBContractConfiguration() *nbcontractv1.Configuration { - return nbcc.nBContractConfiguration +func (nBCB *NBContractBuilder) GetNBContractConfiguration() *nbcontractv1.Configuration { + return nBCB.nBContractConfiguration } diff --git a/pkg/nbcontracthelper/helper_test.go b/pkg/nbcontracthelper/helper_test.go index 6dfc9905424..7a3bdb6e34f 100644 --- a/pkg/nbcontracthelper/helper_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -7,7 +7,7 @@ import ( nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) -func TestNewNBContractConfiguration(t *testing.T) { +func TestNewNBContractBuilder(t *testing.T) { wantedResult := &nbcontractv1.Configuration{ KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, ApiServerConfig: &nbcontractv1.ApiServerConfig{}, @@ -36,14 +36,14 @@ func TestNewNBContractConfiguration(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := NewNBContractConfiguration().nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { + if got := NewNBContractBuilder().nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { t.Errorf("NewNBContractConfiguration() = %v, want %v", got, tt.want) } }) } } -func TestNBContractConfig_ApplyConfiguration(t *testing.T) { +func TestNBContractBuilder_ApplyConfiguration(t *testing.T) { type fields struct { nBContractConfiguration *nbcontractv1.Configuration } @@ -96,7 +96,7 @@ func TestNBContractConfig_ApplyConfiguration(t *testing.T) { }, }, want: func() *nbcontractv1.Configuration { - tmpResult := NewNBContractConfiguration().nBContractConfiguration + tmpResult := NewNBContractBuilder().nBContractConfiguration tmpResult.AuthConfig.TargetCloud = "some-cloud" tmpResult.LinuxAdminUsername = "testuser" return tmpResult @@ -105,9 +105,9 @@ func TestNBContractConfig_ApplyConfiguration(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - nbcc := NewNBContractConfiguration() - nbcc.ApplyConfiguration(tt.fields.nBContractConfiguration) - if got := nbcc.nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { + builder := NewNBContractBuilder() + builder.ApplyConfiguration(tt.fields.nBContractConfiguration) + if got := builder.nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { t.Errorf("ApplyConfiguration() = %v, want %v", got, tt.want) } }) From d55d2196fc33b2515cb79f9cb7ab8d734a32dd33 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 13:38:29 -0700 Subject: [PATCH 12/20] add deepCopy --- pkg/nbcontracthelper/helper.go | 29 +++++++- pkg/nbcontracthelper/helper_test.go | 101 ++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+), 3 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index 628e7b16518..6b8ebfa3f6d 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -1,6 +1,9 @@ package nbcontracthelper import ( + "bytes" + "encoding/gob" + nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) @@ -35,7 +38,7 @@ func (nBCB *NBContractBuilder) ensureConfigsNonNil() { initializeIfNil(&nBCB.nBContractConfiguration.CustomSearchDomainConfig) } -// Creates a new instance of NBContractConfig and ensures all objects are non-nil +// Creates a new instance of NBContractBuilder and ensures all objects in nBContractConfiguration are non-nil func NewNBContractBuilder() *NBContractBuilder { nBCB := &NBContractBuilder{ nBContractConfiguration: &nbcontractv1.Configuration{ @@ -59,12 +62,14 @@ func NewNBContractBuilder() *NBContractBuilder { return nBCB } -// Apply the configuration to the NBContractConfig nbContractConfiguration object +// Apply the configuration to the nbContractConfiguration object func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configuration) { if config == nil { return } - nBCB.nBContractConfiguration = config + + // Use deep copy to avoid modifying the original object 'config' + nBCB.deepCopy(config, nBCB.nBContractConfiguration) nBCB.ensureConfigsNonNil() } @@ -72,3 +77,21 @@ func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configura func (nBCB *NBContractBuilder) GetNBContractConfiguration() *nbcontractv1.Configuration { return nBCB.nBContractConfiguration } + +// Deep copy the source object to the destination object. +// Note that the existing value in the destination object will not be cleared +// if the source object doesn't have that field +func (nBCB *NBContractBuilder) deepCopy(src, dst interface{}) error { + if src == nil { + return nil + } + + var buf bytes.Buffer + if err := gob.NewEncoder(&buf).Encode(src); err != nil { + return err + } + if err := gob.NewDecoder(&buf).Decode(dst); err != nil { + return err + } + return nil +} diff --git a/pkg/nbcontracthelper/helper_test.go b/pkg/nbcontracthelper/helper_test.go index 7a3bdb6e34f..61924388834 100644 --- a/pkg/nbcontracthelper/helper_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -1,10 +1,12 @@ package nbcontracthelper import ( + "log" "reflect" "testing" nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" + "github.com/Azure/go-autorest/autorest/to" ) func TestNewNBContractBuilder(t *testing.T) { @@ -113,3 +115,102 @@ func TestNBContractBuilder_ApplyConfiguration(t *testing.T) { }) } } + +func TestNBContractBuilder_deepCopy(t *testing.T) { + type Teststruct struct { + A string + B *int + C bool + } + type args struct { + src *Teststruct + dst *Teststruct + } + tests := []struct { + name string + args args + want *Teststruct + isChangeDst bool + }{ + { + name: "Test with empty src", + args: args{ + src: &Teststruct{}, + dst: &Teststruct{}, + }, + want: &Teststruct{}, + isChangeDst: false, + }, + { + name: "Test with non-empty src", + args: args{ + src: &Teststruct{ + A: "some-string", + B: to.IntPtr(123), + C: true, + }, + dst: &Teststruct{}, + }, + want: &Teststruct{ + A: "some-string", + B: to.IntPtr(123), + C: true, + }, + isChangeDst: false, + }, + { + name: "Test with dst which has some existing values. Expect them to be overwritten", + args: args{ + src: &Teststruct{ + A: "some-string", + B: to.IntPtr(123), + }, + dst: &Teststruct{ + A: "some-other-string", + B: to.IntPtr(456), + C: false, + }, + }, + want: &Teststruct{ + A: "some-string", + B: to.IntPtr(123), + C: false, + }, + isChangeDst: false, + }, + { + name: "After deepCopy, changes in dst should not affect src", + args: args{ + src: &Teststruct{ + A: "some-string", + B: to.IntPtr(123), + }, + dst: &Teststruct{}, + }, + want: &Teststruct{ + A: "some-string", + B: to.IntPtr(123), + }, + isChangeDst: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + nBCB := &NBContractBuilder{ + nBContractConfiguration: &nbcontractv1.Configuration{}, + } + nBCB.deepCopy(tt.args.src, tt.args.dst) + log.Printf("dst = %v, src %v", tt.args.dst, tt.args.src) + if got := tt.args.dst; !reflect.DeepEqual(got, tt.want) { + t.Errorf("got = %v, want %v", got, tt.want) + } + if tt.isChangeDst { + tt.args.dst.A = "some-other-string" + tt.args.dst.B = to.IntPtr(456) + if got := tt.args.src; !reflect.DeepEqual(got, tt.want) { + t.Errorf("src = %v, want %v", got, tt.want) + } + } + }) + } +} From 664ceddcc495425316a717a5aea75a7bd5a4340b Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 14:18:44 -0700 Subject: [PATCH 13/20] make ensureConfigsNonNil local in order to reuse it --- pkg/nbcontracthelper/helper.go | 56 ++++++++++++---------------------- 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index 6b8ebfa3f6d..aae1d9012f2 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -20,45 +20,29 @@ func initializeIfNil[T any](field **T) { } // Ensure all objects are non-nil. Please add new objects here. -func (nBCB *NBContractBuilder) ensureConfigsNonNil() { - initializeIfNil(&nBCB.nBContractConfiguration.KubeBinaryConfig) - initializeIfNil(&nBCB.nBContractConfiguration.ApiServerConfig) - initializeIfNil(&nBCB.nBContractConfiguration.AuthConfig) - initializeIfNil(&nBCB.nBContractConfiguration.ClusterConfig) - initializeIfNil(&nBCB.nBContractConfiguration.NetworkConfig) - initializeIfNil(&nBCB.nBContractConfiguration.GpuConfig) - initializeIfNil(&nBCB.nBContractConfiguration.TlsBootstrappingConfig) - initializeIfNil(&nBCB.nBContractConfiguration.KubeletConfig) - initializeIfNil(&nBCB.nBContractConfiguration.RuncConfig) - initializeIfNil(&nBCB.nBContractConfiguration.ContainerdConfig) - initializeIfNil(&nBCB.nBContractConfiguration.TeleportConfig) - initializeIfNil(&nBCB.nBContractConfiguration.CustomLinuxOsConfig) - initializeIfNil(&nBCB.nBContractConfiguration.HttpProxyConfig) - initializeIfNil(&nBCB.nBContractConfiguration.CustomCloudConfig) - initializeIfNil(&nBCB.nBContractConfiguration.CustomSearchDomainConfig) +func ensureConfigsNonNil(nBC *nbcontractv1.Configuration) { + initializeIfNil(&nBC.KubeBinaryConfig) + initializeIfNil(&nBC.ApiServerConfig) + initializeIfNil(&nBC.AuthConfig) + initializeIfNil(&nBC.ClusterConfig) + initializeIfNil(&nBC.NetworkConfig) + initializeIfNil(&nBC.GpuConfig) + initializeIfNil(&nBC.TlsBootstrappingConfig) + initializeIfNil(&nBC.KubeletConfig) + initializeIfNil(&nBC.RuncConfig) + initializeIfNil(&nBC.ContainerdConfig) + initializeIfNil(&nBC.TeleportConfig) + initializeIfNil(&nBC.CustomLinuxOsConfig) + initializeIfNil(&nBC.HttpProxyConfig) + initializeIfNil(&nBC.CustomCloudConfig) + initializeIfNil(&nBC.CustomSearchDomainConfig) } // Creates a new instance of NBContractBuilder and ensures all objects in nBContractConfiguration are non-nil func NewNBContractBuilder() *NBContractBuilder { - nBCB := &NBContractBuilder{ - nBContractConfiguration: &nbcontractv1.Configuration{ - KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, - ApiServerConfig: &nbcontractv1.ApiServerConfig{}, - AuthConfig: &nbcontractv1.AuthConfig{}, - ClusterConfig: &nbcontractv1.ClusterConfig{}, - NetworkConfig: &nbcontractv1.NetworkConfig{}, - GpuConfig: &nbcontractv1.GPUConfig{}, - TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, - KubeletConfig: &nbcontractv1.KubeletConfig{}, - RuncConfig: &nbcontractv1.RuncConfig{}, - ContainerdConfig: &nbcontractv1.ContainerdConfig{}, - TeleportConfig: &nbcontractv1.TeleportConfig{}, - CustomLinuxOsConfig: &nbcontractv1.CustomLinuxOSConfig{}, - HttpProxyConfig: &nbcontractv1.HTTPProxyConfig{}, - CustomCloudConfig: &nbcontractv1.CustomCloudConfig{}, - CustomSearchDomainConfig: &nbcontractv1.CustomSearchDomainConfig{}, - }, - } + nbc := &nbcontractv1.Configuration{} + ensureConfigsNonNil(nbc) + nBCB := &NBContractBuilder{nBContractConfiguration: nbc} return nBCB } @@ -70,7 +54,7 @@ func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configura // Use deep copy to avoid modifying the original object 'config' nBCB.deepCopy(config, nBCB.nBContractConfiguration) - nBCB.ensureConfigsNonNil() + ensureConfigsNonNil(nBCB.nBContractConfiguration) } // Get the NBContractConfiguration object From ea5a8be50fb311a4139f621562c40ef75690f0d8 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 14:39:08 -0700 Subject: [PATCH 14/20] rename nBContractConfiguration to nodeBootstrapConfig --- pkg/nbcontracthelper/helper.go | 20 ++++++++++---------- pkg/nbcontracthelper/helper_test.go | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index aae1d9012f2..bea90698a32 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -8,8 +8,8 @@ import ( ) type NBContractBuilder struct { - // NBContractConfiguration is the configuration object for the NBContract (Node Bootstrap Contract) - nBContractConfiguration *nbcontractv1.Configuration + // nodeBootstrapConfig is the configuration object for the NBContract (Node Bootstrap Contract) + nodeBootstrapConfig *nbcontractv1.Configuration } // Check and initialize each field if it is nil @@ -38,28 +38,28 @@ func ensureConfigsNonNil(nBC *nbcontractv1.Configuration) { initializeIfNil(&nBC.CustomSearchDomainConfig) } -// Creates a new instance of NBContractBuilder and ensures all objects in nBContractConfiguration are non-nil +// Creates a new instance of NBContractBuilder and ensures all objects in nodeBootstrapConfig are non-nil func NewNBContractBuilder() *NBContractBuilder { nbc := &nbcontractv1.Configuration{} ensureConfigsNonNil(nbc) - nBCB := &NBContractBuilder{nBContractConfiguration: nbc} + nBCB := &NBContractBuilder{nodeBootstrapConfig: nbc} return nBCB } -// Apply the configuration to the nbContractConfiguration object +// Apply the configuration to the nodeBootstrapConfig object func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configuration) { if config == nil { return } // Use deep copy to avoid modifying the original object 'config' - nBCB.deepCopy(config, nBCB.nBContractConfiguration) - ensureConfigsNonNil(nBCB.nBContractConfiguration) + nBCB.deepCopy(config, nBCB.nodeBootstrapConfig) + ensureConfigsNonNil(nBCB.nodeBootstrapConfig) } -// Get the NBContractConfiguration object -func (nBCB *NBContractBuilder) GetNBContractConfiguration() *nbcontractv1.Configuration { - return nBCB.nBContractConfiguration +// Get the nodeBootstrapConfig object +func (nBCB *NBContractBuilder) GetNodeBootstrapConfig() *nbcontractv1.Configuration { + return nBCB.nodeBootstrapConfig } // Deep copy the source object to the destination object. diff --git a/pkg/nbcontracthelper/helper_test.go b/pkg/nbcontracthelper/helper_test.go index 61924388834..eb5e12d2d9c 100644 --- a/pkg/nbcontracthelper/helper_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -38,7 +38,7 @@ func TestNewNBContractBuilder(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := NewNBContractBuilder().nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { + if got := NewNBContractBuilder().nodeBootstrapConfig; !reflect.DeepEqual(got, tt.want) { t.Errorf("NewNBContractConfiguration() = %v, want %v", got, tt.want) } }) @@ -98,7 +98,7 @@ func TestNBContractBuilder_ApplyConfiguration(t *testing.T) { }, }, want: func() *nbcontractv1.Configuration { - tmpResult := NewNBContractBuilder().nBContractConfiguration + tmpResult := NewNBContractBuilder().nodeBootstrapConfig tmpResult.AuthConfig.TargetCloud = "some-cloud" tmpResult.LinuxAdminUsername = "testuser" return tmpResult @@ -109,7 +109,7 @@ func TestNBContractBuilder_ApplyConfiguration(t *testing.T) { t.Run(tt.name, func(t *testing.T) { builder := NewNBContractBuilder() builder.ApplyConfiguration(tt.fields.nBContractConfiguration) - if got := builder.nBContractConfiguration; !reflect.DeepEqual(got, tt.want) { + if got := builder.nodeBootstrapConfig; !reflect.DeepEqual(got, tt.want) { t.Errorf("ApplyConfiguration() = %v, want %v", got, tt.want) } }) @@ -197,7 +197,7 @@ func TestNBContractBuilder_deepCopy(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { nBCB := &NBContractBuilder{ - nBContractConfiguration: &nbcontractv1.Configuration{}, + nodeBootstrapConfig: &nbcontractv1.Configuration{}, } nBCB.deepCopy(tt.args.src, tt.args.dst) log.Printf("dst = %v, src %v", tt.args.dst, tt.args.src) From a87f186a2889af4225d255bb5ce49b4db03f7a5b Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 15:16:42 -0700 Subject: [PATCH 15/20] init next level configs --- pkg/nbcontracthelper/helper.go | 2 ++ pkg/nbcontracthelper/helper_test.go | 22 +++++++++++++-------- pkg/proto/nbcontract/v1/clusterconfig.pb.go | 12 +++++------ pkg/proto/nbcontract/v1/clusterconfig.proto | 2 +- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index bea90698a32..baddce02194 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -25,6 +25,8 @@ func ensureConfigsNonNil(nBC *nbcontractv1.Configuration) { initializeIfNil(&nBC.ApiServerConfig) initializeIfNil(&nBC.AuthConfig) initializeIfNil(&nBC.ClusterConfig) + initializeIfNil(&nBC.ClusterConfig.LoadBalancerConfig) + initializeIfNil(&nBC.ClusterConfig.ClusterNetworkConfig) initializeIfNil(&nBC.NetworkConfig) initializeIfNil(&nBC.GpuConfig) initializeIfNil(&nBC.TlsBootstrappingConfig) diff --git a/pkg/nbcontracthelper/helper_test.go b/pkg/nbcontracthelper/helper_test.go index eb5e12d2d9c..006dddc0281 100644 --- a/pkg/nbcontracthelper/helper_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -11,10 +11,13 @@ import ( func TestNewNBContractBuilder(t *testing.T) { wantedResult := &nbcontractv1.Configuration{ - KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, - ApiServerConfig: &nbcontractv1.ApiServerConfig{}, - AuthConfig: &nbcontractv1.AuthConfig{}, - ClusterConfig: &nbcontractv1.ClusterConfig{}, + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + ApiServerConfig: &nbcontractv1.ApiServerConfig{}, + AuthConfig: &nbcontractv1.AuthConfig{}, + ClusterConfig: &nbcontractv1.ClusterConfig{ + LoadBalancerConfig: &nbcontractv1.LoadBalancerConfig{}, + ClusterNetworkConfig: &nbcontractv1.ClusterNetworkConfig{}, + }, NetworkConfig: &nbcontractv1.NetworkConfig{}, GpuConfig: &nbcontractv1.GPUConfig{}, TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, @@ -50,10 +53,13 @@ func TestNBContractBuilder_ApplyConfiguration(t *testing.T) { nBContractConfiguration *nbcontractv1.Configuration } wantedResult := &nbcontractv1.Configuration{ - KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, - ApiServerConfig: &nbcontractv1.ApiServerConfig{}, - AuthConfig: &nbcontractv1.AuthConfig{}, - ClusterConfig: &nbcontractv1.ClusterConfig{}, + KubeBinaryConfig: &nbcontractv1.KubeBinaryConfig{}, + ApiServerConfig: &nbcontractv1.ApiServerConfig{}, + AuthConfig: &nbcontractv1.AuthConfig{}, + ClusterConfig: &nbcontractv1.ClusterConfig{ + LoadBalancerConfig: &nbcontractv1.LoadBalancerConfig{}, + ClusterNetworkConfig: &nbcontractv1.ClusterNetworkConfig{}, + }, NetworkConfig: &nbcontractv1.NetworkConfig{}, GpuConfig: &nbcontractv1.GPUConfig{}, TlsBootstrappingConfig: &nbcontractv1.TLSBootstrappingConfig{}, diff --git a/pkg/proto/nbcontract/v1/clusterconfig.pb.go b/pkg/proto/nbcontract/v1/clusterconfig.pb.go index 1a95237d7b8..8188590d2f8 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.pb.go +++ b/pkg/proto/nbcontract/v1/clusterconfig.pb.go @@ -135,7 +135,7 @@ type ClusterConfig struct { // Primary scale set name PrimaryScaleSet string `protobuf:"bytes,5,opt,name=primary_scale_set,json=primaryScaleSet,proto3" json:"primary_scale_set,omitempty"` // Cluster network config - VirtualNetworkConfig *ClusterNetworkConfig `protobuf:"bytes,6,opt,name=virtual_network_config,json=virtualNetworkConfig,proto3" json:"virtual_network_config,omitempty"` + ClusterNetworkConfig *ClusterNetworkConfig `protobuf:"bytes,6,opt,name=cluster_network_config,json=clusterNetworkConfig,proto3" json:"cluster_network_config,omitempty"` // Specifiy if it uses instance metadata UseInstanceMetadata bool `protobuf:"varint,7,opt,name=use_instance_metadata,json=useInstanceMetadata,proto3" json:"use_instance_metadata,omitempty"` // default to false // Load balancer config @@ -209,9 +209,9 @@ func (x *ClusterConfig) GetPrimaryScaleSet() string { return "" } -func (x *ClusterConfig) GetVirtualNetworkConfig() *ClusterNetworkConfig { +func (x *ClusterConfig) GetClusterNetworkConfig() *ClusterNetworkConfig { if x != nil { - return x.VirtualNetworkConfig + return x.ClusterNetworkConfig } return nil } @@ -411,11 +411,11 @@ var file_pkg_proto_nbcontract_v1_clusterconfig_proto_rawDesc = []byte{ 0x74, 0x79, 0x53, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x53, 0x65, - 0x74, 0x12, 0x59, 0x0a, 0x16, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x6e, 0x65, 0x74, + 0x74, 0x12, 0x59, 0x0a, 0x16, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6e, 0x62, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x14, 0x76, 0x69, 0x72, 0x74, 0x75, 0x61, 0x6c, 0x4e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x14, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x32, 0x0a, 0x15, 0x75, 0x73, 0x65, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x75, 0x73, 0x65, @@ -509,7 +509,7 @@ var file_pkg_proto_nbcontract_v1_clusterconfig_proto_goTypes = []interface{}{ } var file_pkg_proto_nbcontract_v1_clusterconfig_proto_depIdxs = []int32{ 0, // 0: nbcontract.v1.ClusterConfig.vm_type:type_name -> nbcontract.v1.ClusterConfig.VM - 3, // 1: nbcontract.v1.ClusterConfig.virtual_network_config:type_name -> nbcontract.v1.ClusterNetworkConfig + 3, // 1: nbcontract.v1.ClusterConfig.cluster_network_config:type_name -> nbcontract.v1.ClusterNetworkConfig 4, // 2: nbcontract.v1.ClusterConfig.load_balancer_config:type_name -> nbcontract.v1.LoadBalancerConfig 1, // 3: nbcontract.v1.LoadBalancerConfig.load_balancer_sku:type_name -> nbcontract.v1.LoadBalancerConfig.LoadBalancerSku 4, // [4:4] is the sub-list for method output_type diff --git a/pkg/proto/nbcontract/v1/clusterconfig.proto b/pkg/proto/nbcontract/v1/clusterconfig.proto index a18a0bfc2f8..fc4becb448d 100644 --- a/pkg/proto/nbcontract/v1/clusterconfig.proto +++ b/pkg/proto/nbcontract/v1/clusterconfig.proto @@ -19,7 +19,7 @@ message ClusterConfig { string primary_scale_set = 5; // Cluster network config - ClusterNetworkConfig virtual_network_config = 6; + ClusterNetworkConfig cluster_network_config = 6; // Specifiy if it uses instance metadata bool use_instance_metadata = 7; // default to false From 20a1fc8d1007b4d6c545d23f5c839f2978b76748 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 16:23:18 -0700 Subject: [PATCH 16/20] revert changes to go.mod and go.sum --- go.mod | 30 +++--------------------------- go.sum | 57 --------------------------------------------------------- 2 files changed, 3 insertions(+), 84 deletions(-) diff --git a/go.mod b/go.mod index b3fbd7bf3e7..128d8412e1e 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/Azure/agentbaker -go 1.21 - -toolchain go1.21.6 +go 1.18 require ( github.com/Azure/go-autorest/autorest/to v0.4.0 @@ -15,8 +13,8 @@ require ( github.com/onsi/ginkgo v1.12.2 github.com/onsi/gomega v1.27.2 github.com/pkg/errors v0.9.1 - github.com/spf13/cobra v1.7.0 - github.com/stretchr/testify v1.8.4 + github.com/spf13/cobra v1.6.1 + github.com/stretchr/testify v1.8.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v3 v3.0.1 k8s.io/apimachinery v0.26.2 @@ -24,36 +22,14 @@ require ( require ( github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/cilium/ebpf v0.11.0 // indirect - github.com/cosiner/argv v0.1.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/cweill/gotests v1.6.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect - github.com/go-delve/delve v1.22.1 // indirect - github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 // indirect - github.com/google/go-dap v0.11.0 // indirect - github.com/hashicorp/golang-lru v1.0.2 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect github.com/nxadm/tail v1.4.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.starlark.net v0.0.0-20231101134539-556fd59b42f6 // indirect - golang.org/x/arch v0.6.0 // indirect - golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect - golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.14.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 9debb061e82..af72e728b65 100644 --- a/go.sum +++ b/go.sum @@ -8,28 +8,15 @@ github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df h1:GSoSVRLo github.com/barkimedes/go-deepcopy v0.0.0-20220514131651-17c30cfc62df/go.mod h1:hiVxq5OP2bUGBRNS3Z/bt/reCLFNbdcST6gISi1fiOM= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y= -github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUgWsVs= -github.com/cosiner/argv v0.1.0 h1:BVDiEL32lwHukgJKP87btEPenzrrHUjajs/8yzaqcXg= -github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= -github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cweill/gotests v1.6.0 h1:KJx+/p4EweijYzqPb4Y/8umDCip1Cv6hEVyOx0mE9W8= -github.com/cweill/gotests v1.6.0/go.mod h1:CaRYbxQZGQOxXDvM9l0XJVV2Tjb2E5H53vq+reR2GrA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d h1:hUWoLdw5kvo2xCsqlsIBMvWUc1QCSsCYD2J2+Fg6YoU= -github.com/derekparker/trie v0.0.0-20230829180723-39f4de51ef7d/go.mod h1:C7Es+DLenIpPc9J6IYw4jrK0h7S9bKj4DNl8+KxGEXU= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/go-delve/delve v1.22.1 h1:LQSF2sv+lP3mmOzMkadl5HGQGgSS2bFg2tbyALqHu8Y= -github.com/go-delve/delve v1.22.1/go.mod h1:TfOb+G5H6YYKheZYAmA59ojoHbOimGfs5trbghHdLbM= -github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62 h1:IGtvsNyIuRjl04XAOFGACozgUD7A82UffYxZt4DWbvA= -github.com/go-delve/liner v1.2.3-0.20231231155935-4726ab1d7f62/go.mod h1:biJCRbqp51wS+I92HMqn5H8/A0PAhxn2vyOT+JqhiGI= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -47,29 +34,15 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-dap v0.11.0 h1:SpAZJL41rOOvd85PuLCCLE1dteTQOyKNnn0H3DBHywo= -github.com/google/go-dap v0.11.0/go.mod h1:HAeyoSd2WIfTfg+0GRXcFrb+RnojAtGNh+k+XTIxJDE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= -github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= -github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -86,42 +59,22 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -go.starlark.net v0.0.0-20231101134539-556fd59b42f6 h1:+eC0F/k4aBLC4szgOcjd7bDTEnpxADJyWJE0yowgM3E= -go.starlark.net v0.0.0-20231101134539-556fd59b42f6/go.mod h1:LcLNIzVOMp4oV+uusnpk+VU+SzXaJakUuBjoCSWH5dM= -golang.org/x/arch v0.6.0 h1:S0JTfE48HbRj80+4tbvZDYsJ3tGv6BUU3XxyZ7CirAc= -golang.org/x/arch v0.6.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 h1:Jvc7gsqn21cJHCmAWx0LiimpP18LZmUxkT5Mp7EZ1mI= -golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -129,10 +82,6 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211117180635-dee7805ff2e1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -140,11 +89,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191109212701-97ad0ed33101/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -162,8 +107,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From ab7afb0906f43144f22ebdb71f422802547068e9 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 16:24:18 -0700 Subject: [PATCH 17/20] revert go.mod --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 128d8412e1e..daeaf6a8250 100644 --- a/go.mod +++ b/go.mod @@ -25,6 +25,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/nxadm/tail v1.4.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect From 9cec4295891902c743c3716e3aa147930c1c8296 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 16:43:33 -0700 Subject: [PATCH 18/20] cleaning up lint --- pkg/nbcontracthelper/helper.go | 15 +++++++++------ pkg/nbcontracthelper/helper_test.go | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index baddce02194..010055f3ebc 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -3,16 +3,17 @@ package nbcontracthelper import ( "bytes" "encoding/gob" + "log" nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) type NBContractBuilder struct { - // nodeBootstrapConfig is the configuration object for the NBContract (Node Bootstrap Contract) + // nodeBootstrapConfig is the configuration object for the NBContract (Node Bootstrap Contract). nodeBootstrapConfig *nbcontractv1.Configuration } -// Check and initialize each field if it is nil +// Check and initialize each field if it is nil. func initializeIfNil[T any](field **T) { if *field == nil { *field = new(T) @@ -40,7 +41,7 @@ func ensureConfigsNonNil(nBC *nbcontractv1.Configuration) { initializeIfNil(&nBC.CustomSearchDomainConfig) } -// Creates a new instance of NBContractBuilder and ensures all objects in nodeBootstrapConfig are non-nil +// Creates a new instance of NBContractBuilder and ensures all objects in nodeBootstrapConfig are non-nil. func NewNBContractBuilder() *NBContractBuilder { nbc := &nbcontractv1.Configuration{} ensureConfigsNonNil(nbc) @@ -55,8 +56,10 @@ func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configura } // Use deep copy to avoid modifying the original object 'config' - nBCB.deepCopy(config, nBCB.nodeBootstrapConfig) - ensureConfigsNonNil(nBCB.nodeBootstrapConfig) + if err := nBCB.deepCopy(config, nBCB.nodeBootstrapConfig); err != nil { + log.Printf("Failed to deep copy the configuration: %v", err) + ensureConfigsNonNil(nBCB.nodeBootstrapConfig) + } } // Get the nodeBootstrapConfig object @@ -66,7 +69,7 @@ func (nBCB *NBContractBuilder) GetNodeBootstrapConfig() *nbcontractv1.Configurat // Deep copy the source object to the destination object. // Note that the existing value in the destination object will not be cleared -// if the source object doesn't have that field +// if the source object doesn't have that field. func (nBCB *NBContractBuilder) deepCopy(src, dst interface{}) error { if src == nil { return nil diff --git a/pkg/nbcontracthelper/helper_test.go b/pkg/nbcontracthelper/helper_test.go index 006dddc0281..7006f814c97 100644 --- a/pkg/nbcontracthelper/helper_test.go +++ b/pkg/nbcontracthelper/helper_test.go @@ -205,7 +205,9 @@ func TestNBContractBuilder_deepCopy(t *testing.T) { nBCB := &NBContractBuilder{ nodeBootstrapConfig: &nbcontractv1.Configuration{}, } - nBCB.deepCopy(tt.args.src, tt.args.dst) + if err := nBCB.deepCopy(tt.args.src, tt.args.dst); err != nil { + log.Printf("Failed to deep copy the configuration: %v", err) + } log.Printf("dst = %v, src %v", tt.args.dst, tt.args.src) if got := tt.args.dst; !reflect.DeepEqual(got, tt.want) { t.Errorf("got = %v, want %v", got, tt.want) From 8b3b7f50a6c16dc58dc0aeae6aaac3b2cc3a5542 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 16:45:22 -0700 Subject: [PATCH 19/20] Fix lint --- pkg/nbcontracthelper/helper.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index 010055f3ebc..c9f85b2ebb2 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -49,13 +49,13 @@ func NewNBContractBuilder() *NBContractBuilder { return nBCB } -// Apply the configuration to the nodeBootstrapConfig object +// Apply the configuration to the nodeBootstrapConfig object. func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configuration) { if config == nil { return } - // Use deep copy to avoid modifying the original object 'config' + // Use deep copy to avoid modifying the original object 'config'. if err := nBCB.deepCopy(config, nBCB.nodeBootstrapConfig); err != nil { log.Printf("Failed to deep copy the configuration: %v", err) ensureConfigsNonNil(nBCB.nodeBootstrapConfig) From 9fe216667ae5d2e854e4beec6bc60b7962a83379 Mon Sep 17 00:00:00 2001 From: Devin Wong Date: Tue, 16 Apr 2024 16:47:58 -0700 Subject: [PATCH 20/20] fix lint --- pkg/nbcontracthelper/helper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index c9f85b2ebb2..7baedc24184 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -62,7 +62,7 @@ func (nBCB *NBContractBuilder) ApplyConfiguration(config *nbcontractv1.Configura } } -// Get the nodeBootstrapConfig object +// Get the nodeBootstrapConfig object. func (nBCB *NBContractBuilder) GetNodeBootstrapConfig() *nbcontractv1.Configuration { return nBCB.nodeBootstrapConfig }