From 780c44921af3c6d2f3691ace057d8079171b143a Mon Sep 17 00:00:00 2001 From: Cameron Meissner Date: Tue, 16 Apr 2024 11:38:49 -0700 Subject: [PATCH 1/4] fix: keep prefetching azure-cns 1.5.23 (#4302) Co-authored-by: Cameron Meissner --- vhdbuilder/packer/components.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vhdbuilder/packer/components.json b/vhdbuilder/packer/components.json index 973ae11766e..db3480b8a1c 100644 --- a/vhdbuilder/packer/components.json +++ b/vhdbuilder/packer/components.json @@ -47,6 +47,12 @@ "v1.5.26" ], "prefetchOptimizations": [ + { + "version": "v1.5.23", + "binaries": [ + "usr/local/bin/azure-cns" + ] + }, { "version": "v1.5.26", "binaries": [ From d20c3eb8d214b55e8c93c7cccfa03b2a6881dc40 Mon Sep 17 00:00:00 2001 From: anujmaheshwari1 Date: Tue, 16 Apr 2024 12:00:08 -0700 Subject: [PATCH 2/4] fix: add variable IMG_VERSION to build time vars (#4262) Co-authored-by: anujmaheshwari1 --- .pipelines/.vsts-vhd-builder-release.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.pipelines/.vsts-vhd-builder-release.yaml b/.pipelines/.vsts-vhd-builder-release.yaml index 2c8746cc150..8d58ef87fce 100644 --- a/.pipelines/.vsts-vhd-builder-release.yaml +++ b/.pipelines/.vsts-vhd-builder-release.yaml @@ -161,6 +161,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]UbuntuServer' echo '##vso[task.setvariable variable=IMG_SKU]18.04-LTS' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -212,6 +213,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]UbuntuServer' echo '##vso[task.setvariable variable=IMG_SKU]18.04-LTS' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_NC16as_T4_v3' echo '##vso[task.setvariable variable=FEATURE_FLAGS]fullgpudaemon' @@ -263,6 +265,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -290,6 +293,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -317,6 +321,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -344,6 +349,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -372,6 +378,7 @@ stages: echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' echo '##vso[task.setvariable variable=CONTAINER_RUNTIME]containerd' @@ -398,6 +405,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -426,6 +434,7 @@ stages: echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' echo '##vso[task.setvariable variable=CONTAINER_RUNTIME]containerd' @@ -452,6 +461,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -479,6 +489,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-arm64' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16pds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -506,6 +517,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-arm64' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16pds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -533,6 +545,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ads_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]kata' @@ -560,6 +573,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-kata' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ads_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]kata' @@ -587,6 +601,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -614,6 +629,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -641,6 +657,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-kata' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ads_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]kata' @@ -668,6 +685,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner' echo '##vso[task.setvariable variable=IMG_OFFER]cbl-mariner' echo '##vso[task.setvariable variable=IMG_SKU]cbl-mariner-2-kata' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ads_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]kata' @@ -695,6 +713,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]UbuntuServer' echo '##vso[task.setvariable variable=IMG_SKU]18.04-LTS' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -748,6 +767,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]0001-com-ubuntu-server-focal' echo '##vso[task.setvariable variable=IMG_SKU]20_04-lts' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -801,6 +821,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]0001-com-ubuntu-server-jammy' echo '##vso[task.setvariable variable=IMG_SKU]22_04-lts' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_DS2_v2' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -828,6 +849,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]0001-com-ubuntu-server-jammy' echo '##vso[task.setvariable variable=IMG_SKU]22_04-lts-gen2' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V2' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_DS2_v2' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' @@ -882,6 +904,7 @@ stages: echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical' echo '##vso[task.setvariable variable=IMG_OFFER]0001-com-ubuntu-server-jammy' echo '##vso[task.setvariable variable=IMG_SKU]22_04-lts' + echo '##vso[task.setvariable variable=IMG_VERSION]latest' echo '##vso[task.setvariable variable=HYPERV_GENERATION]V1' echo '##vso[task.setvariable variable=AZURE_VM_SIZE]Standard_D16ds_v5' echo '##vso[task.setvariable variable=FEATURE_FLAGS]None' From ffd5dc7d7999def3b20833f5d63b9b15d6819871 Mon Sep 17 00:00:00 2001 From: Chih-Sheng Huang Date: Tue, 16 Apr 2024 15:13:27 -0700 Subject: [PATCH 3/4] chore: bump kube-state-metrics to 2.11.0 (#4294) --- vhdbuilder/packer/components.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vhdbuilder/packer/components.json b/vhdbuilder/packer/components.json index db3480b8a1c..5bb23f6736e 100644 --- a/vhdbuilder/packer/components.json +++ b/vhdbuilder/packer/components.json @@ -139,7 +139,7 @@ "downloadURL": "mcr.microsoft.com/oss/kubernetes/kube-state-metrics:*", "amd64OnlyVersions": [], "multiArchVersions": [ - "v2.9.2" + "v2.11.0" ] }, { From 1296bd19eca7f6d972e6fbe9a27f086877aa9536 Mon Sep 17 00:00:00 2001 From: Devinwong Date: Tue, 16 Apr 2024 16:51:56 -0700 Subject: [PATCH 4/4] feat: Use NBContractBuilder to build NBContract. Rename CustomSearchDomain to CustomSearchDomainConfig (#4296) Co-authored-by: Devin Wong --- pkg/nbcontracthelper/helper.go | 85 ++++++- pkg/nbcontracthelper/helper_test.go | 224 ++++++++++++++++++ pkg/parser/cse_cmd.sh.gtpl | 1 - pkg/proto/nbcontract/v1/clusterconfig.pb.go | 12 +- pkg/proto/nbcontract/v1/clusterconfig.proto | 2 +- pkg/proto/nbcontract/v1/config.pb.go | 150 ++++++------ pkg/proto/nbcontract/v1/config.proto | 2 +- .../v1/customsearchdomainconfig.pb.go | 89 ++++--- .../v1/customsearchdomainconfig.proto | 8 +- 9 files changed, 434 insertions(+), 139 deletions(-) create mode 100644 pkg/nbcontracthelper/helper_test.go diff --git a/pkg/nbcontracthelper/helper.go b/pkg/nbcontracthelper/helper.go index d638d1b420c..7baedc24184 100644 --- a/pkg/nbcontracthelper/helper.go +++ b/pkg/nbcontracthelper/helper.go @@ -1,9 +1,86 @@ package nbcontracthelper -const ( - defaultLinuxUser = "azureuser" +import ( + "bytes" + "encoding/gob" + "log" + + nbcontractv1 "github.com/Azure/agentbaker/pkg/proto/nbcontract/v1" ) -func GetDefaultLinuxAdminUsername() string { - return defaultLinuxUser +type NBContractBuilder struct { + // nodeBootstrapConfig is the configuration object for the NBContract (Node Bootstrap Contract). + nodeBootstrapConfig *nbcontractv1.Configuration +} + +// Check and initialize each field if it is nil. +func initializeIfNil[T any](field **T) { + if *field == nil { + *field = new(T) + } +} + +// Ensure all objects are non-nil. Please add new objects here. +func ensureConfigsNonNil(nBC *nbcontractv1.Configuration) { + initializeIfNil(&nBC.KubeBinaryConfig) + 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) + 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 nodeBootstrapConfig are non-nil. +func NewNBContractBuilder() *NBContractBuilder { + nbc := &nbcontractv1.Configuration{} + ensureConfigsNonNil(nbc) + nBCB := &NBContractBuilder{nodeBootstrapConfig: nbc} + return nBCB +} + +// 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'. + 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. +func (nBCB *NBContractBuilder) GetNodeBootstrapConfig() *nbcontractv1.Configuration { + return nBCB.nodeBootstrapConfig +} + +// 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 new file mode 100644 index 00000000000..7006f814c97 --- /dev/null +++ b/pkg/nbcontracthelper/helper_test.go @@ -0,0 +1,224 @@ +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) { + wantedResult := &nbcontractv1.Configuration{ + 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{}, + 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 + want *nbcontractv1.Configuration + }{ + { + name: "Test with nil configuration", + want: wantedResult, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := NewNBContractBuilder().nodeBootstrapConfig; !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewNBContractConfiguration() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestNBContractBuilder_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{ + LoadBalancerConfig: &nbcontractv1.LoadBalancerConfig{}, + ClusterNetworkConfig: &nbcontractv1.ClusterNetworkConfig{}, + }, + 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 nil configuration", + fields: fields{ + nBContractConfiguration: &nbcontractv1.Configuration{}, + }, + want: wantedResult, + }, + { + name: "Apply nil AuthConfig configuration and expect AuthConfig in nBContractConfiguration to be non-nil", + fields: fields{ + nBContractConfiguration: &nbcontractv1.Configuration{ + AuthConfig: nil, + }, + }, + want: wantedResult, + }, + { + name: "Apply some configurations and expect them to be applied", + fields: fields{ + nBContractConfiguration: &nbcontractv1.Configuration{ + AuthConfig: &nbcontractv1.AuthConfig{ + TargetCloud: "some-cloud", + }, + LinuxAdminUsername: "testuser", + }, + }, + want: func() *nbcontractv1.Configuration { + tmpResult := NewNBContractBuilder().nodeBootstrapConfig + tmpResult.AuthConfig.TargetCloud = "some-cloud" + tmpResult.LinuxAdminUsername = "testuser" + return tmpResult + }(), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + builder := NewNBContractBuilder() + builder.ApplyConfiguration(tt.fields.nBContractConfiguration) + if got := builder.nodeBootstrapConfig; !reflect.DeepEqual(got, tt.want) { + t.Errorf("ApplyConfiguration() = %v, want %v", got, tt.want) + } + }) + } +} + +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{ + nodeBootstrapConfig: &nbcontractv1.Configuration{}, + } + 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) + } + 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) + } + } + }) + } +} 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/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 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